Debugging Core Files Using HP WDB
The values of the variables in the structure st_two are determined by using these
offsets, as follows:
— To examine the first word of the structure st_two, enter the following command
at the gdb prompt:
(gdb) x/x 0x7f7e669c
0x7f7e669c: 0x40001130
To display the string value at this address, enter the following command at the
gdb prompt:
gdb) x/s 0x40001130
0x40001130 <__d_trap_fptr+276>: "of life"
— To examine the second word of the structure st_two, enter the following command
at the gdb prompt:
(gdb) x/x 0x7f7e669c+0x4
0x7f7e66a0: 0x00000063
— To display the float value at the third word, enter the following command at the
gdb prompt:
(gdb) x/f 0x7f7e669c+0x8
0x7f7e66a4: 19.2099991
— To display the char* value at the fourth word, enter the following command at
the gdb prompt:
(gdb) x/x 0x7f7e669c+0xc
0x7f7e66a8: 0x40001138
To display the string value at the displayed address, enter the following command
at the gdb prompt:
(gdb) x/s 0x40001138
0x40001138 <__d_trap_fptr+284>: "is 42"
— To display the address of the structure, enter the following command at the gdb
prompt:
(gdb) x/x $sp-0x64
0x7f7e673c: 0x7f7e6688
To display the int value at the start of the structure, enter the following command
at the gdb prompt:
(gdb) x/x 0x7f7e6688
0x7f7e6688: 0x00000011
Examples Illustrating Core File Debugging 37