gcc HEAD, stabs+, TYPE_CODE_INT problem

Michael Elizabeth Chastain mec.gnu@mindspring.com
Mon Apr 5 20:26:00 GMT 2004

Daniel's on the money, as usual.

With these stabs:

    # gcc 3.3.3
    .stabs	"char:t(0,2)=r(0,2);0;127;",128,0,0,0
    .stabs	"__caddr_t:t(7,35)=(7,36)=*(0,2)",128,0,82,0
    .stabs	"s:G(7,36)",32,0,7,0

gdb prints "(7,36)" as "(0,2) *" and prints "(0,2)" as "char" because
"char" is the name of the type, for an end result of "char *".  I can
see this happening by stepping through gdb.  Also, if I hand-edit the
first stab and change "char:t(0,2)=r(0,2)" to "foo_char:t(0,2)=r(0,2)",
then the name of the type changes.

With these stabs:

    # gcc HEAD
    .stabs	"__caddr_t:t(3,44)=(3,45)=*(3,46)=r(3,46);0;127;",128,0,82,0
    .stabs	"s:G(3,45)",32,0,7,0

gdb prints "(3,45)" as "(3,46) *", but the type "(3,46)" has no name.

Zack, this happened with your c-decl rewrite.  I did the date-narrowing
process and isolated it to this patch.

gcc 3.3.3 (and gcc HEAD 20040323) emitted about 20 stab lines for the
list from first_builtin_decl to last_builtin_decl.  This provides gdb
with names for "char", "int", "float", et cetera.  gcc HEAD 20040330 no
longer uses provides this list so there are no more stab lines for the
builtin types.  Can we change gcc to bring these builtins back?

Either that, or we have to change gdb to recognize the unnamed ranges
and interpolate names for them, which gets icky real fast for a

Michael C

More information about the Gdb mailing list