Contents
Tips and Tricks
-
Always set the environment variable LD_BIND_NOW=1 on glibc2 systems.
See here how to set environment
variables.
-
You can use breakpoints as bookmarks: Just set a breakpoint and disable
it. Later, you can quickly come back to that breakpoint by double-clicking
it in the breakpoint list (or select it and click View Code). Since
breakpoints are persistent (i.e. KDbg remembers them across invocations
of a program), you get them back next time you invoke KDbg for that particular
program.
-
You can change a program variable's value: In the variable watch section
(in the lower right) type an assignment like this: var.member=17
and click Add. This immediately changes the value of the variable.
You should delete the expression from the list right away (by selecting
it in the window below and clicking Del). This is because the watch
expressions are evaluate each time the program stops, and by this the variable
would be changed to the specified value again and again!
-
You can display a value in the watch section in different ways by prepending
gdb's format specifiers in front of the variable to display. E.g. /x
var.member displays the var.member in hexadecimal notation.