This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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
Attachment:
bfd_ChangeLog
Description: Binary data
Attachment:
core_bmax_patch.txt
Description: Text document
Attachment:
core_patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |