Originally posted by: sanket
gdb with gcore support for AIX is now available on AIX toolbox.
https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gdb/gdb-7.9.1-6.aix6.1.ppc.rpm
gcore subcommand is now supported in AIX gdb.
Running gcore subcommand on gdb produces the core in the form of core.<process id>.
Optional file name can be give to gcore command as well.
Example:
(gdb) br main
Breakpoint 1 at 0x1000053c: file test.c, line 18.
(gdb) gcore
You can't do that without a process to debug. <= Process must be
running for this command to work
(gdb) r
Starting program: /tmp/test
Breakpoint 1, main () at test.c:18
18 int i = 1;
(gdb) disassemble main
Dump of assembler code for function main:
0x0000000100000528 <+0>: mflr r0
0x000000010000052c <+4>: std r0,16(r1)
0x0000000100000530 <+8>: std r31,-8(r1)
0x0000000100000534 <+12>: stdu r1,-144(r1)
0x0000000100000538 <+16>: mr r31,r1
=> 0x000000010000053c <+20>: li r9,1 <= Current PC
0x0000000100000540 <+24>: stw r9,112(r31)
...................
End of assembler dump.
(gdb) gcore
Saved corefile 'core.10289432'
0x0000000100000540 18 int i = 1;
(gdb) disassemble main
Dump of assembler code for function main:
0x0000000100000528 <+0>: mflr r0
0x000000010000052c <+4>: std r0,16(r1)
0x0000000100000530 <+8>: std r31,-8(r1)
0x0000000100000534 <+12>: stdu r1,-144(r1)
0x0000000100000538 <+16>: mr r31,r1
0x000000010000053c <+20>: li r9,1
=> 0x0000000100000540 <+24>: stw r9,112(r31) <= Current PC after
gcore
0x0000000100000544 <+28>: addi r9,r31,112
..................
End of assembler dump.
(gdb) s
20 foo(&i);
(gdb) gcore test_core
Saved corefile 'test_core'
0x0000000100000548 20 foo(&i);
(gdb) disassemble
Dump of assembler code for function main:
...................
0x0000000100000544 <+28>: addi r9,r31,112
=> 0x0000000100000548 <+32>: mr r3,r9
0x000000010000054c <+36>: bl 0x1000004bc <foo>
...................
End of assembler dump.
#AIXOpenSource#AIX-Open-Source-Software