Home | Screenshots | Download | Change log | Tips & Tricks | Todo | Manual
If you like KDbg, please go here.
For more tips see the online documentation.
Displaying variable values in different formats
You can use gdb's format specifiers for displaying values in the expression
watch window in different formats. Just prefix the expression to display
by the format specifier. Example: /x foo->bar will display the
value of foo->bar in hexadecimal notation. Here is a list of gdb's
format specifiers:
| /x | hexadecimal |
| /o | octal |
| /d | decimal |
| /u | unsigned decimal |
| /t | binary |
| /f | float |
| /a | address |
| /i | instruction |
| /c | char |
| /s | string |
Setting breakpoints in dynamically loaded modules
The problem with dynamically loaded modules is that the debugger doesn't know about the symbol information until the module has been loaded by dlopen(). This is extremely annoying if you want to debug constructors that are run for static variables. The following trick works on systems that use glibc2.
Note that the orphaned breakpoints feature does not really help. The reason is that orphaned breakpoints are not tried to be installed until the program stops. For this reason it is still required to set the breakpoint in _dl_debug_state. However, the breakpoints are preserved and can be set at any time, even before the program starts.
There's a hack so you can do remote debugging. Invoke kdbg like this:
kdbg -r /dev/ttya proggyThen KDbg issues the following gdb commands, in effect, it allows you to debug a remote target:
target remote /dev/ttyaAs you see, you could also do remote debugging through TCP/IP connection like this:
file proggy
kdbg -r flaky:12345 proggyassuming host flaky is running gdbserver with proggy on port 12345.
Note that you can set a program specific gdb command using the Settings|This Program menu.
|
Last modified May 02, 2006. |
You are visitor number
since February 21, 2001. Thank you! |