====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:gdbstub [2009/11/20 09:02] pcervicek "#define GDBSERIAL" in config/general.h |
dev:gdbstub [2010/03/28 21:27] (current) stefanha |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Overview ===== | ===== Overview ===== | ||
- | You can use the [[http://www.gnu.org/software/gdb/|GNU Project Debugger (GDB)]] to debug gPXE. You either need two computers or virtualization software (e.g. [[http://bellard.org/qemu/|QEMU]]). One host runs gPXE while the other runs GDB. | + | You can use the [[http://www.gnu.org/software/gdb/|GNU Project Debugger (GDB)]] to debug gPXE. You either need two computers or virtualization software (e.g. [[http://qemu.org/|QEMU]]). One host runs gPXE while the other runs GDB. |
gPXE supports debugging via serial port or over the network. For serial, you need a null modem serial cable. For network, you need the machine to be connected to a network with UDP port 43770 traffic allowed. | gPXE supports debugging via serial port or over the network. For serial, you need a null modem serial cable. For network, you need the machine to be connected to a network with UDP port 43770 traffic allowed. | ||
Line 65: | Line 65: | ||
The ''.tmp'' file must correspond to your gPXE image. For example, ''gpxe.dsk'' -> ''gpxe.dsk.tmp'', ''gpxe.pxe'' -> ''gpxe.pxe.tmp'', and ''gpxe.usb'' -> ''gpxe.hd.tmp''. | The ''.tmp'' file must correspond to your gPXE image. For example, ''gpxe.dsk'' -> ''gpxe.dsk.tmp'', ''gpxe.pxe'' -> ''gpxe.pxe.tmp'', and ''gpxe.usb'' -> ''gpxe.hd.tmp''. | ||
- | Next you should set up the serial port in GDB if you are debugging via serial. The ''set remotebaud N'' command is used to set the serial port baud rate to ''N''. See [[http://sourceware.org/gdb/current/onlinedocs/gdb_18.html#SEC173|Remote Configuration]] in the GDB Manual. | + | Next you should set up the serial port in GDB if you are debugging via serial. The ''set remotebaud N'' command is used to set the serial port baud rate to ''N''. See [[http://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Configuration.html#Remote-Configuration|Remote Configuration]] in the GDB Manual. |
Now connect to gPXE, which is already waiting since we entered the ''gdbstub'' command in the gPXE shell: | Now connect to gPXE, which is already waiting since we entered the ''gdbstub'' command in the gPXE shell: | ||
Line 156: | Line 156: | ||
* **CPU registers** (''i r'') shows many but not all of the registers. | * **CPU registers** (''i r'') shows many but not all of the registers. | ||
- | <code> | ||
- | TODO | ||
- | </code> | ||
- | * **Print** (''p'') shows the value of program variables and arbitrary expressions in C-like syntax (see [[http://sourceware.org/gdb/current/onlinedocs/gdb_9.html#SEC58|GDB Manual]]). | + | * **Print** (''p'') shows the value of program variables and arbitrary expressions in C-like syntax (see [[http://sourceware.org/gdb/current/onlinedocs/gdb/Data.html|GDB Manual]]). |
<code> | <code> | ||
(gdb) p response | (gdb) p response | ||
Line 172: | Line 169: | ||
===== GDB documentation ===== | ===== GDB documentation ===== | ||
- | * [[http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html|Debugging with GDB (official manual)]] | + | * [[http://sourceware.org/gdb/current/onlinedocs/gdb/index.html|Debugging with GDB (official manual)]] |
* [[http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf|A cheatsheet]], note that there are several others [[http://google.com/search?q=gdb+cheat+sheet|available]]. | * [[http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf|A cheatsheet]], note that there are several others [[http://google.com/search?q=gdb+cheat+sheet|available]]. | ||
- | ===== Getting help ===== | + | |
- | You can email the [[https://lists.sourceforge.net/lists/listinfo/etherboot-developers|Etherboot-Developers]] list or ask on the [[http://www.etherboot.org/wiki/contact|IRC channel]]. | + |