[PATCH] Debugging core file support for AIX
Sangamesh Mallayya
sangamesh.swamy@in.ibm.com
Mon Oct 26 11:04:00 GMT 2015
Hi All,
Please let me know if the provided information is enough to do the review
or should i open a defect and attach a patch?
Thanks,
Sangamesh
Sangamesh Mallayya/India/IBM
10/21/2015 11:38 AM
To
binutils@sourceware.org,
cc
Subject
Debugging core file support for AIX
Hi All,
Below patches adds support for debugging core file's in AIX with gdb.
Right now gdb doesn't recognise the AIX core file and doesn't have method
to identify if we are using old format or new core format.
These patch adds support for debugging both 32-bit & 64-bit core file in
case of both 32-bit and 64-bit gdb.
1) With the first patch (core_patch.txt) we resolve these errors
is not a core dump: File format not recognized
And also the compilation error like this after adding powerpc64 entry
in configuration file.
rs6000-core.c:112: error: field 'old' has incomplete type
rs6000-core.c:125: error: field 'old' has incomplete type
rs6000-core.c: In function 'read_hdr':
rs6000-core.c:286: error: dereferencing pointer to incomplete type
rs6000-core.c:286: error: dereferencing pointer to incomplete type
Here is sample example to test this.
# cat test.c
int foo(char **p)
{
strcpy(*p, "Hello");
}
int main()
{
char *p;
foo(&p);
}
# file test_32 core
test_32: executable (RISC System/6000 V3.1) or obj module not stripped
core: AIX core file 32-bit, test_32
Program terminated with signal 11, Segmentation fault.
#0 0x0000f014 in ?? ()
(gdb) bt
#0 0x0000f014 in ?? ()
#1 0x10000390 in foo (p=0x2ff22bf8) at test.c:3
#2 0x100003e4 in main () at test.c:9
(gdb) frame 1
#1 0x10000390 in foo (p=0x2ff22bf8) at test.c:3
3 strcpy(*p, "Hello");
# file test_64 core
test_64: 64-bit XCOFF executable or object module
core: AIX core file 64-bit, test_64
Program terminated with signal 11, Segmentation fault.
#0 0x000000000000f414 in ?? ()
(gdb) bt
#0 0x000000000000f414 in ?? ()
#1 0x0000000100000490 in foo (p=0xffffffffffffb00) at test.c:3
#2 0x00000001000004e4 in main () at test.c:9
(gdb) frame 1
#1 0x0000000100000490 in foo (p=0xffffffffffffb00) at test.c:3
3 strcpy(*p, "Hello");
(gdb)
2) Second patch(core_bmax_patch.txt) adds the support for debugging core
file generated by binaries in case of the large memory model.
If a binary has been compiled with -bmaxdata option then we can't be able
access the value stored in .data section
xlc -g -o test test.c -bmaxdata:0x80000000
(gdb) bt
#0 0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
#1 0xd01b3088 in abort () from /usr/lib/libc.a(shr.o)
#2 0x100003b8 in main () at test.c:7
(gdb) frame 2
#2 0x100003b8 in main () at test.c:7
7 test.c: A file or directory in the path name does not exist..
(gdb) info locals
c = 0x30000a68 <error: Cannot access memory at address 0x30000a68>
__func__ = "main"
(gdb)
with fix
(gdb) bt
#0 0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
#1 0xd01b3088 in abort () from /usr/lib/libc.a(shr.o)
#2 0x100003b8 in main () at test.c:7
(gdb) frame 2
#2 0x100003b8 in main () at test.c:7
7 test.c: A file or directory in the path name does not exist..
(gdb) info locals
c = 0x30000a68 "Hello"
__func__ = "main"
(gdb)
Thanks & Regards,
-Sangamesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd_ChangeLog
Type: application/octet-stream
Size: 814 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20151026/c8765bf1/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: core_bmax_patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20151026/c8765bf1/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: core_patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20151026/c8765bf1/attachment-0001.txt>
More information about the Binutils
mailing list