[Dwarf-Discuss] gcc, g++ and dwarf

ranjith kumar ranjithproxy at gmail.com
Mon Apr 27 00:28:51 PDT 2009


Hi,

----------------------------------------------------------------------------------------------------------------------------------------------
#include<stdio.h>
typedef struct
{
	int x;
	int y;
}type27;

int a;

int main()
{
	int m,n;
	type27 t;
	a=100;
	printf("\n %d %d %d ",t.x,t.y,(t.x)+(t.y)+a);
}
----------------------------------------------------------------------------------------------------------------------------------------------

 I compiled the above program as

armv5tel-redhat-linux-gnueabi-gcc myprogram.c -g

When I  print the dwarf information with
                                            readelf --debug-dump  a.out
I got the following debugging information about the typedef "type27"  :
 <1><147>: Abbrev Number: 6 (DW_TAG_typedef)
 <148>     DW_AT_name        : type27
     <14f>     DW_AT_decl_file   : 1
      <150>     DW_AT_decl_line   : 6
     <151>     DW_AT_type        : <126>



But when I compiled the same(myprogram.c) as
                           armv5tel-redhat-linux-gnueabi-g++ myprogram.c -g
I could not get any debugging information for "type27"

Why so????

In this link
http://examples.oreilly.com/palmprog/CDROM/Linux/gcc/gcc-2.7.2.2/README.DWARF
I foundout the following statements:
"DWARF generation for the GNU g++ compiler is still not operable.  This is
due primarily to the many remaining cases where the g++ front end does not
conform to the conventions used in the GNU C front end for representing
various kinds of declarations in the TREE data structure.  It is not clear
at this time how these problems will be addressed."

Is my problem is because of "g++ front end does not
conform to the conventions used in the GNU C front end for representing
various kinds of declarations in the TREE data structure"????
If so can anyone tell me what are these  g++ front end issues?? and
why are these causing problems??


Thanks in advance.



More information about the Dwarf-Discuss mailing list