From 8cedbc8399c84f31a1e13708ff4344e1547c1945 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 19 May 2006 17:44:13 +0000 Subject: [PATCH] Improve automatic test failure interpretation by extending backtrace to the binary that failed. --- src/tests/tests.pm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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/) { -- 2.30.2