This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
Here is a test program: char * pc; int main () { return 0; } Compile with gcc -gstabs+ -S. Here are the stabs with gcc 2004-03-23 23:40:00 UTC .stabs "char:t(0,2)=r(0,2);0;127;",128,0,0,0 .stabs "pc:G(0,16)=*(0,2)",32,0,1,0 Here are the stabs with gcc 2004-03-24 00:00:00 UTC .stabs "pc:G(0,2)=*(0,3)=r(0,3);0;127;",32,0,1,0 The problem with the new stabs is that type (0,3) has no name. So gdb cannot print this type: # gdb 6.0 (gdb) ptype pc type = <invalid type code 7> * I narrowed the regression down to this patch: 2004-03-23 Zack Weinberg <zack@codesourcery.com> PR 12267, 12391, 12560, 13129, 14114, 14133 This problem does not happen with -gdwarf-2. This problem happens with gcc HEAD and gcc tree-ssa-20020619-branch. It does not happen with gcc gcc-3_4-branch or gcc gcc-3_3-branch. I suspect that the problem is related to the removal of first_builtin_decl and last_builtin_decl. When I compile an empty program with the old compiler, there are stab lines for about 20 builtin types (int, char, float, double, etc). When I compile an empty program with the new compiler, there are no such stab lines.
Created an attachment (id=6039) [edit] C Source file which exhibits the problem
Created an attachment (id=6040) [edit] Good assembly output, gcc 2004-03-23 23:40:00 UTC Compile builtin.c with gcc -gstabs+ -S
Created an attachment (id=6041) [edit] bad assembly output, gcc HEAD 2004-03-24 00:00:00 UTC Compile builtin.c with gcc -gstabs+ -S. The problem is the lack of name for "char" type, so gdb prints "pointer to char" as something like "pointer to <unknown integral type>".
Confirmed.
mine. not critical, though.
This is very important to Darwin and other targets which use stabs still by default.
As I said this effects darwin and some other targets like AIX too.
Subject: [PR 14860] candidate patch Candidate patch for PR 14860. It's remarkably simple - the builtin types are not available to dbxout_init through its syms argument (since C getdecls always returns 0) so c-decl.c's record_builtin_type needs to call debug_hooks->type_decl. And it even says so, in a comment in dbxout.c which I wrote. I somehow forgot to do the other half. I'll be testing this on a DWARF system (amd64-linux) as well as a stabs system (powerpc-darwin) since this change is visible to all debug info generators. zw
Created an attachment (id=6875) [edit]
(From update of attachment 6875 [edit]) arrr, this be a patch, matey
dunno where the commit message went, but the patch is checked in now.
Works great for me on native i686-pc-linux-gnu. All my sample programs behave now. I ran the gdb test suite with the usual battery: gdb 6.1.1, gdb HEAD gdb test suite HEAD with local modifications gcc 3.4.1, gcc HEAD 200407031, gcc HEAD 20040804 dwarf-2 and stabs+ About 800 FAILs went away with -gstabs+ (out of 10_000 tests), and now gdb is usable again. Nothing regressed. Color me happy. Another cheer for Zack.