Hi all,

I discovered that when you use a type in a program, and this type is not
defined in a unit for which debug-info is generated, there is no
DW_TAG_typedef entry generated for the dwarf-debuginfo.

The result is that gdb doesn't recognise the type. Using 'ptype
<typename>' will result in the message that the type is not found.

When you use 'info type' the type is in the list, but not in the form

type longing=longint

but only:

longint=longint
(this is the dw_tag_reference_type entry in the dwarf-debuginfo)

The attached patch solves the problem, but I doubt this is the right
place to do this, since this way the 'DW_TAG_typedef' entry is always
added, and in some cases double.

How (and where) to fix this properly? And can someone see if this is a
problem within gdb, or is it according to the dwarf-specs that this
entry should be there?

Joost.



Index: dbgdwarf.pas
===================================================================
--- dbgdwarf.pas	(revision 13409)
+++ dbgdwarf.pas	(working copy)
@@ -1673,6 +1673,11 @@
         append_entry(DW_TAG_reference_type,false,[]);
         append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
         finish_entry;
+        append_entry(DW_TAG_typedef,false,[
+           DW_AT_name,DW_FORM_string,upper(def.typename)+#0
+        ]);
+        append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
+        finish_entry;
       end;
 
 
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to