Debugging Core Files Using HP WDB
#1 0x4000a00:0 in inline foo () at a.c:30
#2 0x40009b0:1 in main () at a.c:37
(gdb) up
#1 0x4000a00:0 in inline foo () at a.c:30
30 generate_core_dump();
(gdb) p local_j
No symbol "local_j" in current context.
The debugger cannot display information about the arguments and local variables because the
program is compiled with the -O option (level 2 optimization). However, the debugger can
display the inlined functions in the backtrace and provide the line number information. The line
numbers may not be displayed accurately because the code is moved during optimization.
If you encounter issues while debugging inlined functions, you can use the +d compiler option
to disable inlining, as follows:
$ aCC -g -O +d a.c
Examples on Integrity systems built without -g display significantly greater inlining and source
line information than the same examples that are built on HP 9000 systems.
Sample Debugging Session 2
Debugging a Core File Created by Code Compiled Without the -g Option
$ aCC a.c
$ /opt/langtools/bin/gdb ./a.out core
HP gdb for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for
warranty/support.
..
Core was generated by `a.out'.
Program terminated with signal 11, Segmentation fault.
SEGV_ACCERR - Invalid Permissions for object
#0 0x40009b0:1 in generate_core_dump () at a.c:10
10 *(int*)i = 10;
(gdb) bt
#0 0x40009b0:1 in generate_core_dump () at a.c:10
#1 0x4000b40:0 in foo () at a.c:30
#2 0x4000bd0:0 in main () at a.c:37
(gdb) p local_j
No symbol "local_j" in current context.
(gdb)
In the case of core files created by PA-RISC - based binaries, the source line information is not
available if the binary has not been compiled with the -g option. The information about the
arguments and the local variables is not displayed.
In the case of core files created by Itanium-based binaries, the source line information is available,
irrespective of whether the binary is compiled with the -g option, or not.
Sample Debugging Session 3
Debugging a Core File Created by a Stripped Binary When the Symbol Table is Not Available
24