Re: Exception debugging with qemu_x86/gdb

Boie, Andrew P

On Sat, 2016-09-17 at 23:53 +0300, Paul Sokolovsky wrote:
I would naively think that QEMU's GDB stub would override any
relevant guest exception handling, but that apparently not happen.

I'm not sure how we could get QEMU's stubs in Zephyr's IDT to be honest.

It may be the case that we could do some work on the Zephyr x86
exception handling stubs to be more GDB friendly. I don't know off the
top of my head what it would take to get 'backtrace' to work the way
you describe. We might just need to massage the stack a bit and issue a
debugger 'break' in the error handler.

Currently, for x86 exceptions with CONFIG_EXCEPTION_DEBUG turned on we install a bunch of handler stubs, you can see the code in arch/x86/core/fatal.c. That is what prints out the message. It then calls _SysFatalErrorHandler which either aborts the thread or spins forever.

Faulting segment:address = 0x00000008:0x001782da
This is where your code is generating an exception. I'd set a
breakpoint there.


Join to automatically receive all group messages.