X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fscripts%2FeipToFunction;fp=misc%2Ftest_vm%2Fscripts%2FeipToFunction;h=0000000000000000000000000000000000000000;hp=98bffa6adb4b564fb22b57729a7f9017c46a692d;hb=a70930549d1b741704dd7af4e6bb0e89f6f8a519;hpb=afb634a80f946634454a5d067a92aa600227bd93 diff --git a/misc/test_vm/scripts/eipToFunction b/misc/test_vm/scripts/eipToFunction deleted file mode 100755 index 98bffa6..0000000 --- a/misc/test_vm/scripts/eipToFunction +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/perl - -# Find the function name from the value of the EIP (instruction pointer) -# register from a Bochs crash report. Uses the kernel symbol -# map (kernel.syms) produced by compiling the kernel. - -use strict qw(refs vars); -use FileHandle; - -if (scalar(@ARGV) != 2){ - print STDERR "Usage: eipToFunction kernel.syms \n"; - print STDERR " eip value should be in hex\n"; - exit 1; -} - -my $syms = shift @ARGV; -my $eip = hex(shift @ARGV); - -my @text = (); - -my $fh = new FileHandle("<$syms"); -(defined $fh) || die "Couldn't open $syms: $!\n"; -while (<$fh>) { - #print $_; - if (/^([0-9A-Fa-f]+)\s+[Tt]\s+(\S+)\s*$/) { - push @text, [hex($1), $2]; - } -} -$fh->close(); -#print scalar(@text),"\n"; - -@text = sort { $a->[0] <=> $b->[0] } @text; - -my $last = undef; - -foreach my $entry (@text) { - last if ($eip < $entry->[0]); - $last = $entry; -} -printf("%s\n",(defined $last) ? $last->[1] : "not found"); - -# vim:ts=4