From: Beket Date: Thu, 12 Mar 2009 19:22:34 +0000 (-0700) Subject: Add more debugging steps X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/commitdiff_plain/41b49ce53e4242e46e46a7dc12896a7163eb96cf Add more debugging steps --- diff --git a/docs/howtos/HowToDebugVKernels/index.mdwn b/docs/howtos/HowToDebugVKernels/index.mdwn index 18d347d6..05e3e644 100644 --- a/docs/howtos/HowToDebugVKernels/index.mdwn +++ b/docs/howtos/HowToDebugVKernels/index.mdwn @@ -107,7 +107,7 @@ We need to do better this time. Let's break into the kernel _before_ it crashes. Breakpoint 1 at 0x80acf43: file ./machine/thread.h, line 83. (gdb) -Next type 'c' in the gdb prompt to resume vkernel execution: +Next we type 'c' in the gdb prompt to resume vkernel execution: (gdb) c Continuing. @@ -122,6 +122,22 @@ Gdb stops the execution of vkernel and a message pops up in gdb buffer: 83 __asm ("movl %%fs:globaldata,%0" : "=r" (gd) : "m"(__mycpu__dummy)); (gdb) -We navigate through source code with the 'step' and 'next' gdb commands. They are identical, except that 'step' follows function calls. We +We navigate through source code with the 'step' and 'next' gdb commands. They are identical, except that 'step' follows function calls. When we meet this call: -276 allproc_scan(ktrace_clear_callback, &info); + 276 allproc_scan(ktrace_clear_callback, &info); + +we 'step' inside it. alloproc_scan() iterates through the process list and applies the ktrace_clear_callback() to each one of them. +Later we see this: + + 347 if (p->p_tracenode->kn_vp == info->tracenode->kn_vp) { + +Here p is a pointer to the current process: + (gdb) print p + $1 = (struct proc *) 0x57098c00 + +Let's see if this process is traced: + (gdb) print p->p_tracenode + $2 = (struct ktrace_node *) 0x0 + (gdb) + +Oops. There is no trace to a vnode for this process.