X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fscripts%2Ffindaddr;fp=misc%2Ftest_vm%2Fscripts%2Ffindaddr;h=7b9b877288371d8aafeeda0f8bac9a2caf03d547;hp=0000000000000000000000000000000000000000;hb=ddc16b0737cf58f7aa90a69c6652cdf4090aec51;hpb=626595465a2c6987606a6bc697df65130ad8c2d3 diff --git a/misc/test_vm/scripts/findaddr b/misc/test_vm/scripts/findaddr new file mode 100755 index 0000000..7b9b877 --- /dev/null +++ b/misc/test_vm/scripts/findaddr @@ -0,0 +1,26 @@ +#! /usr/bin/perl + +# Find the address of a symbol in the storage map. + +use strict qw(refs vars); +use FileHandle; + +if ( scalar(@ARGV) != 2 ) { + print "Usage: findaddr \n"; + exit 1; +} + +my $storage = shift @ARGV; +my $symbol = shift @ARGV; + +my $fh = new FileHandle("<$storage"); +(defined $fh) || die "Couldn't open storage map: $!\n"; + +while ( <$fh> ) { + if ( /^\s*(0x([0-9]|[a-f]|[A-F])+)\s+\Q$symbol\E\s*$/ ) { + print $1, "\n"; + last; + } +} + +$fh->close();