This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

-fdebug-types-section unidentifiable anonymous struct (PR debug/49750)


Hi all and Cary,

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49750
It is a part of former Bug (FIXED):
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510

currently -fdebug-types-section regresses GDB testsuite for:
	FAIL: gdb.cp/anon-struct.exp: print type of X::t2::t2
	FAIL: gdb.cp/member-ptr.exp: *

Describing `gdb.cp/anon-struct.exp' which is addressed also by Tom Tromey's
Bug above.  Unaware if it fixes also gdb.cp/member-ptr.exp, I hope so.

There is no way to find out where the "t2" method (constructor) belongs from
DIE <77> (it belongs to "X::t2", making the constructor name "X::t2::t2()").

With posted FSF GDB HEAD fix (fixing another unrelated issue):
	[patch] Fix printed anonymous struct name
	http://sourceware.org/ml/gdb-patches/2011-09/msg00483.html

I think it would be enough to just put proper declarations around the "t2"
method DIE, at least it works for me with the GDB patch above.  But maybe
a better DWARF solution exists.


Thanks,
Jan


Attaching "anonstruct4b.s" patched by hand as the diff below suggests:
echo 'int main(){}'|g++ -g -c -o anonstructmain4.o -Wall -x c++ -;g++ -o anonstruct4b anonstructmain4.o anonstruct4b.s -Wall

./gdb -q -nx -ex 'set language c++' -ex "ptype X::t2::t2" -ex q ~/t/anonstruct4b
-There is no field named t2
 ->
+type = void (X::t2 * const)

  <1><>: Abbrev Number: 18 (DW_TAG_namespace)
     <>   DW_AT_name        : X
  <2><>: Abbrev Number: 19 (DW_TAG_typedef)
     <>   DW_AT_name        : t2
     <>   DW_AT_type        : signature: 9d52f6834a49e845
  <2><>: Abbrev Number: 20 (DW_TAG_variable)
     <>   DW_AT_name        : v
     <>   DW_AT_linkage_name: (indirect string, offset: ): _ZN1X1vE
     <>   DW_AT_type        : <>
     <>   DW_AT_external    : 1
     <>   DW_AT_declaration : 1
- <1><>: Abbrev Number: 21 (DW_TAG_structure_type)
-    <>   DW_AT_declaration : 1
+ <2><>: Abbrev Number: 21 (DW_TAG_structure_type)
+    <>   DW_AT_declaration : 1
+    <>   DW_AT_MIPS_linkage_name: (indirect string, offset: ): N1X2t2E
- <2><>: Abbrev Number: 22 (DW_TAG_subprogram)
+ <3><>: Abbrev Number: 22 (DW_TAG_subprogram)
     <>   DW_AT_name        : t2
     <>   DW_AT_artificial  : 1
     <>   DW_AT_declaration : 1
     <>   DW_AT_object_pointer: <>

Attachment: anonstruct4b.s
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]