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=fcd755e5014f5c0a50491fa8e651f9f11d50f192;p=pintos-anon Improve automatic test failure interpretation by extending backtrace to the binary that failed. --- diff --git a/TODO b/TODO index 080eb60..0e8047e 100644 --- a/TODO +++ b/TODO @@ -74,8 +74,6 @@ via Godmar Back: * Internal tests. -* Improve automatic interpretation of exception messages. - * Filesys project: - Need a better way to measure performance improvement of buffer 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/) {