X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fdebug.texi;h=958e51b3bafcb2e3288ed28aa58ed4605ddfe4da;hb=13bc50213bc87981f67ceabd7a623e05917fd09d;hp=1aea23874c1715814663aabe1e28b99b1a8b641b;hpb=51878ce2ad4922e38f3e3c84a2108e18ec9e5517;p=pintos-anon diff --git a/doc/debug.texi b/doc/debug.texi index 1aea238..958e51b 100644 --- a/doc/debug.texi +++ b/doc/debug.texi @@ -21,13 +21,12 @@ introduces you to a few of them. Don't underestimate the value of @func{printf}. The way @func{printf} is implemented in Pintos, you can call it from practically anywhere in the kernel, whether it's in a kernel thread or -an interrupt handler, almost regardless of what locks are held (but see -@ref{printf Reboots} for a counterexample). +an interrupt handler, almost regardless of what locks are held. @func{printf} is useful for more than just examining data. It can also help figure out when and where something goes wrong, even when the kernel crashes or panics without a useful error message. The -strategy is to sprinkle calls to @func{print} with different strings +strategy is to sprinkle calls to @func{printf} with different strings (e.g.@: @code{"<1>"}, @code{"<2>"}, @dots{}) throughout the pieces of code you suspect are failing. If you don't even see @code{<1>} printed, then something bad happened before that point, if you see @code{<1>} @@ -444,6 +443,10 @@ in your kernel, because your kernel should never crash. Starting with Project 3, the situation will change if you use @func{get_user} and @func{put_user} strategy to verify user memory accesses (@pxref{Accessing User Memory}). + +If you don't want GDB to stop for page faults, then issue the command +@code{handle SIGSEGV nostop}. GDB will still print a message for +every page fault, but it will not come back to a command prompt. @end deffn @node Example GDB Session