From: Ben Pfaff Date: Fri, 19 May 2006 17:44:13 +0000 (+0000) Subject: Improve automatic test failure interpretation by extending backtrace X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cedbc8399c84f31a1e13708ff4344e1547c1945;p=pintos-anon Improve automatic test failure interpretation by extending backtrace to the binary that failed. --- diff --git a/src/tests/tests.pm b/src/tests/tests.pm index 01259dd..858d8a4 100644 --- a/src/tests/tests.pm +++ b/src/tests/tests.pm @@ -50,10 +50,27 @@ sub check_for_panic { my (@stack_line) = grep (/Call stack:/, @output); if (@stack_line != 0) { - my (@addrs) = $stack_line[0] =~ /Call stack:((?: 0x[0-9a-f]+)+)/; - print "Call stack: @addrs\n"; + my ($addrs) = $stack_line[0] =~ /Call stack:((?: 0x[0-9a-f]+)+)/; + + # Find a user program to translate user virtual addresses. + my ($userprog) = ""; + $userprog = "$test" + if grep (hex ($_) < 0xc0000000, split (' ', $addrs)) > 0 && -e $test; + + # Get and print the backtrace. + my ($trace) = scalar (`backtrace kernel.o $userprog $addrs`); + print "Call stack:$addrs\n"; print "Translation of call stack:\n"; - print `backtrace kernel.o @addrs`; + print $trace; + + # Print disclaimer. + if ($userprog ne '' && index ($trace, $userprog) >= 0) { + print <capacity/) {