How to debug ring0 code?
Posted: Sun Feb 20, 2011 6:05 pm
Hi once again,
I am trying to debug my kernel code (if I dare to call it that) with bochs. I have recompiled bochs with gdb stubs, however I am unable to set breakpoints at all.
So I start bochs with gdb stubs enabled, it halts, waits for gdb to connect. I then issue these commands:
I have as well tried with qemu -s -S options with the same gdb commands as above however that doesn't do any good to me either. Have I not set something up well?
I have compiled my code with -g so the debug symbols should be present. Any tips?
I am trying to debug my kernel code (if I dare to call it that) with bochs. I have recompiled bochs with gdb stubs, however I am unable to set breakpoints at all.
So I start bochs with gdb stubs enabled, it halts, waits for gdb to connect. I then issue these commands:
Execution continues but nothing happens in the GDB. Am I missing something?gdb
gdb remote localhost:1234
symbol-file kernel.bin
break kmain
break kernel.c:11
continue
I have as well tried with qemu -s -S options with the same gdb commands as above however that doesn't do any good to me either. Have I not set something up well?
I have compiled my code with -g so the debug symbols should be present. Any tips?