# Both connections are telnet based
sub getDataFromDevice {
# login to the device
# define the read/write commands
&dumpData($conn, \%cmds)
}
sub getDataFromJtag {
# login to the device
# define the read/write commands
&dumpData($conn, \%cmds)
}
sub dumpData {
my $conn = shift;
my $cmds = shift;
my $addr = qr/^\s*0?x?[[:xdigit:]]{8}:\s+0?x?([[:xdigit:]]{8}).*$/;
@output = $conn->cmd("$cmd->{read} 0xfeedbeef");
push @obuf, (grep {s/$addr/$1/} @out);
}
####
% read 0xfeedbeef
f80e205c: 30000000 ........
805306368
####
ppc8641-A[0,h] % mr 0xfeedbeef
0xf80e2044: 0x00100000 ........