Debugging with GDB (September 2007)
Chapter 14: HP-UX Configuration-Specific Information 181
When GDB has no debug information; it does not know where the arguments are
located or even the type of the arguments. GDB cannot infer this in an optimized,
non-debug executable.
However, for integer arguments you can find the first few parameters for the top-of-
stack frame by looking at the registers. On PA-RISC systems, the first parameter will
be in $r26, the second in $r25 and so on. On IPF systems, the first few paramete rs
will be in $gr32 and $gr33.
14.25 De bugging optimized code
HP WDB supports debugging of optimized code (compiled with both -g and -O) for
HP aC++, HP ANSI C and HP WDB for HP Itanium.
The following commands evaluate the name of a function and hence are affected by the
optimization level of the program be ing debugged (in particular, due to inlining):
• break
• call
• clear
• disassem
• list
The following commands evaluate an expression referring to variables in the use r pro-
gram and hence, are affected by the optimization level of the program being debugged:
• break
• call
• cond
• jump
• return
• print
• set <var>
• watch
• whatis x
Note: The break and call commands involve evaluation of both the name of a function
and an expression.
The following commands are also affected by the optimization level of the program
being debugged:
• backtrace
• display
• down
• finish
• frame
• info *