Kernel Debugging: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
→‎Use gdb with Qemu: Use kdbg as a gdb GUI
Solar (talk | contribs)
Nice point mentioning that there are GUI frontends; KDBG is by no means special though.
Line 111: Line 111:
I won't start explaining all the nice things about gdb, but as you can see, it is a very powerful tool for debugging OSes.
I won't start explaining all the nice things about gdb, but as you can see, it is a very powerful tool for debugging OSes.


=== Use kdbg as a gdb GUI ===
== GUI frontends ==


While GDB provides a text-based user interface (available via the `-tui` command line option or by entering `wh` at the GDB prompt), you might want to use one of the available GUI frontents to GDB. These include but are not limited to:
[http://www.kdbg.org/ kdbg] brings a nice GUI to gdb. Like with gdb you start have to start your OS with


* [http://www.kdbg.org/ kdbg]
qemu -s -S <harddrive.img>
* [http://sources.redhat.com/insight/ insight]
* [http://www.gnu.org/s/ddd/ ddd]


Attaching to a QEMU session works similar to the command line GDB described above.
To attach kdbg run

kdbg -r localhost:1234 <kernel.bin>

The binary can be the whole elf or a symbol file.


== Develop in hosted environment ==
== Develop in hosted environment ==