Summary: | gdb does not resolve opaque structures in binaries compiled with ICC. | ||
---|---|---|---|
Product: | gdb | Reporter: | John Steele Scott <toojays> |
Component: | symtab | Assignee: | John Steele Scott <toojays> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jan, tromey |
Priority: | P2 | ||
Version: | 7.3 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: |
Simple test case which can be used to demonstrate bug 13277.
Patch against gdb-7.3.1 to resolve opaque types on ICC compiled binaries. Simple test case which can be used to demonstrate bug 13277. |
Description
John Steele Scott
2011-10-09 10:27:14 UTC
Created attachment 5968 [details] Simple test case which can be used to demonstrate bug 13277. The attached tarball contains the source code for this testcase. Binaries produced with ICC and GCC are also included for comparison. The ICC binary was produced with 'CC="icc -debug extended" make'. The GCC binary was produced with 'CC="gcc -g" make'. Created attachment 5969 [details]
Patch against gdb-7.3.1 to resolve opaque types on ICC compiled binaries.
This patch against gdb-7.3.1 sets the "stub" flag on structures with a zero size attribute, which allows GDB to resolve the opaque structure pointers produced by ICC.
For the patch, please follow: http://sourceware.org/gdb/contribute/ Patch submission is at http://sourceware.org/ml/gdb-patches/2011-10/msg00442.html Created attachment 6055 [details] Simple test case which can be used to demonstrate bug 13277. I've made a simpler testcase, which I'm attaching here. The tarball also includes the assembler generated by ICC. I've used that to construct a test case suitable for committing to the GDB mainline, I'll send that to gdb-patches shortly. CVSROOT: /cvs/src Module name: src Changes by: jkratoch@sourceware.org 2012-05-24 22:09:21 Modified files: gdb : ChangeLog dwarf2read.c gdb/testsuite : ChangeLog Added files: gdb/testsuite/gdb.dwarf2: dw2-icc-opaque.S dw2-icc-opaque.exp Log message: gdb/ PR symtab/13277: Resolving opaque structures in ICC generated binaries. * dwarf2read.c (struct dwarf2_cu) <producer_is_icc>: New field. (producer_is_gxx_lt_4_6): Move the checking and caching to... (check_producer): ... this new function, which also checks for ICC and caches the result. (producer_is_icc): New function. (read_structure_type): Don't set TYPE_STUB_SUPPORTED if the producer was ICC. gdb/testsuite/ PR symtab/13277: Resolving opaque structures in ICC generated binaries. * gdb.dwarf2/dw2-icc-opaque.S: New file. * gdb.dwarf2/dw2-icc-opaque.exp: New file. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14292&r2=1.14293 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.655&r2=1.656 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3205&r2=1.3206 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp.diff?cvsroot=src&r1=NONE&r2=1.1 Checked in. |