X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fdebug.texi;h=12ca40ee3641017fffd269c40a10c25a3a8625c8;hb=1c2b347fd2b3b1d9f78cc2a40160dfb2a23a9bd9;hp=f93eeda3ad0251375e96f8ac02b31ad06bd0aa60;hpb=f09c875281ab27bd51e1da5f97d327d69695ccec;p=pintos-anon diff --git a/doc/debug.texi b/doc/debug.texi index f93eeda..12ca40e 100644 --- a/doc/debug.texi +++ b/doc/debug.texi @@ -221,9 +221,8 @@ panicked, you can re-run @command{backtrace} on the user program, like so: (typing the command on a single line, of course): @example -~/cs140/pintos/src/utils/backtrace grow-too-big 0xc0106eff 0xc01102fb -0xc010dc22 0xc010cf67 0xc0102319 0xc010325a 0x804812c 0x8048a96 -0x8048ac8 +backtrace grow-too-big 0xc0106eff 0xc01102fb 0xc010dc22 0xc010cf67 +0xc0102319 0xc010325a 0x804812c 0x8048a96 0x8048ac8 @end example The results look like this: @@ -240,13 +239,24 @@ The results look like this: 0x8048ac8: _start (../../src/lib/user/entry.c:9) @end example +Here's an extra tip for anyone who read this far: @command{backtrace} +is smart enough to strip the @code{Call stack:} header and @samp{.} +trailer from the command line if you include them. This can save you +a little bit of trouble in cutting and pasting. Thus, the following +command prints the same output as the first one we used: + +@example +backtrace kernel.o Call stack: 0xc0106eff 0xc01102fb 0xc010dc22 +0xc010cf67 0xc0102319 0xc010325a 0x804812c 0x8048a96 0x8048ac8. +@end example + @node i386-elf-gdb @section @command{i386-elf-gdb} You can run the Pintos kernel under the supervision of the @command{i386-elf-gdb} debugger.@footnote{If you're using an 80@var{x}86 system for development, it's probably just called -@command{addr2line}.} There are two steps in the process. First, +@command{gdb}.} There are two steps in the process. First, start Pintos with the @option{--gdb} option, e.g.@: @command{pintos --gdb run}. Second, in a second terminal, invoke @command{gdb} on @file{kernel.o}: