Kernel Debugging: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
Line 141: Line 141:


(gdb) si
(gdb) si

=== Use LLDB with QEMU ===

LLDB supports GDB server that QEMU uses, so you can do the same thing with the previous section, but with some command modification as LLDB has some commands that are different than GDB

You can run QEMU to listen for a "GDB connection" before it starts executing any code to debug it.

qemu -s -S <harddrive.img>

...will setup QEMU to listen on port 1234 and wait for a GDB connection to it. Then, from a remote or local shell:

lldb
(lldb) process connect --plugin gdb-remote connect://localhost:1234
Process 1 stopped
* thread #1, stop reason = signal SIGTRAP
frame #0: 0x000000000000fff0
-> 0xfff0: addb %al, (%rax)
0xfff2: addb %al, (%rax)
0xfff4: addb %al, (%rax)
0xfff6: addb %al, (%rax)

(Replace localhost with remote IP / URL if necessary.) Then start execution:


=== Use bochs debugger ===
=== Use bochs debugger ===