------- Additional Comments From mark at codesourcery dot com 2005-07-22 23:43 ------- Subject: Re: [4.0 Regression] debug info omitted for uninitialized variables
Devang Patel wrote: > > $ gdb --batch -x gdbcmds t > Reading symbols for shared libraries ... done > Breakpoint 1 at 0x2d14: file t.c, line 6. > type = <unknown type> > type = <unknown type> > $1 = <unknown type> > $2 = <unknown type> > > This is on powerpc-darwin. I expected this patch to fix this. Am I > missing something ? First, your example was not the one in the original bug report. Second, you're using STABS, not DWARF-2. I suspect the stabs debug generator, or the GDB stabs reader is not as good as DWARF. On GNU/Linux, GDB knows that "bar" has type "int". It still doesn't know the type of "foo"; apparently too much of the debug information is optimized away. But, that's some other problem -- perhaps in GDB itself. The information is clearly there for it: .uleb128 0x2 # (DIE (0x2d) DW_TAG_variable) .ascii "foo\0" # DW_AT_name .byte 0x1 # DW_AT_decl_file .byte 0x1 # DW_AT_decl_line .long 0x38 # DW_AT_type .uleb128 0x3 # (DIE (0x38) DW_TAG_base_type) .ascii "int\0" # DW_AT_name .byte 0x4 # DW_AT_byte_size .byte 0x5 # DW_AT_encoding -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21828