Re: [PATCH] Documentation: How to use GDB to decode OOPSes

From: Andrew Morton
Date: Tue May 29 2007 - 19:44:59 EST


On Mon, 28 May 2007 10:46:18 +0300 (EEST)
Pekka J Enberg <penberg@xxxxxxxxxxxxxx> wrote:

> +In addition, you can use GDB to figure out the exact file and line
> +number of the OOPS from the vmlinux file. If you have
> +CONFIG_DEBUG_INFO enabled, you can simply copy the EIP value from the
> +OOPS:
> +
> + EIP: 0060:[<c021e50e>] Not tainted VLI
> +
> +And use GDB to translate that to human-readable form:
> +
> + gdb vmlinux
> + (gdb) l *0xc021e50e
> +
> +If you don't have CONFIG_DEBUG_INFO enabled, you use the function
> +offset from the OOPS:
> +
> + EIP is at vt_ioctl+0xda8/0x1482
> +
> +And recompile the kernel with CONFIG_DEBUG_INFO enabled:
> +
> + make vmlinux
> + gdb vmlinux
> + (gdb) p vt_ioctl
> + (gdb) l *(0x<address of vt_ioctl> + 0xda8)
> +

yeah. Often this process will tell you that the oops was in
spin_lock_irq() or list_add() or something useless like that.

So the next step is to start adding and subtracting 4, 8, 12, ...
to the EIP value until you "fall out" of the inlined function and
back into the callee.

But I'm not sure that I'd want to have to describe that process
(especially the means by which one determines that it is necessary)
to normal people ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/