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]

avr-gcc, .debug_frame and bitfields


I have configured avr-gcc like this:

bash-2.05$ avr-gcc -v
Reading specs from /usr/local/bin/../lib/gcc/avr/3.4.0/specs
Configured with: ./configure --prefix=/usr/local/ --enable-languages=c,c++ --enable-version-specific-runtime-libs --target=avr --with-dwarf2
Thread model: single
gcc version 3.4.0


When building objects, I am unable to make gcc output the .debug_frame section.
This is how I build my objects:

>avr-gcc -mmcu=atmega169 -gdwarf-2 -o test.elf test.c

Why does not gcc produce an .debug_frame section for the avr target?

Also, It seems to have a problem with bitfield debug information:

DW_AT_member_location seems to consequently equal -1 (ff ff ff ff) for the first member of a bitfield.

This bitfield:

typedef struct
{
  int   j:5;
  int   k:6;
  int   m:5;
  int   n:8;
} bitfield2_t;

result in the following debug information :

<1><20f>: Abbrev Number: 4 (DW_TAG_structure_type)
DW_AT_sibling : <258>
DW_AT_byte_size : 3
DW_AT_decl_file : 3
DW_AT_decl_line : 52
<2><217>: Abbrev Number: 9 (DW_TAG_member)
DW_AT_name : j
DW_AT_decl_file : 3
DW_AT_decl_line : 48
DW_AT_type : <67>
DW_AT_byte_size : 2
DW_AT_bit_size : 5
DW_AT_bit_offset : 3
DW_AT_data_member_location: 6 byte block: 23 ff ff ff ff f (DW_OP_plus_uconst: 4294967295)
<2><22a>: Abbrev Number: 9 (DW_TAG_member)
DW_AT_name : k
DW_AT_decl_file : 3
DW_AT_decl_line : 49
DW_AT_type : <67>
DW_AT_byte_size : 2
DW_AT_bit_size : 6
DW_AT_bit_offset : 5
DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0)
<2><239>: Abbrev Number: 9 (DW_TAG_member)
DW_AT_name : m
DW_AT_decl_file : 3
DW_AT_decl_line : 50
DW_AT_type : <67>
DW_AT_byte_size : 2
DW_AT_bit_size : 5
DW_AT_bit_offset : 0
DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0)
<2><248>: Abbrev Number: 9 (DW_TAG_member)
DW_AT_name : n
DW_AT_decl_file : 3
DW_AT_decl_line : 51
DW_AT_type : <67>
DW_AT_byte_size : 2
DW_AT_bit_size : 8
DW_AT_bit_offset : 0
DW_AT_data_member_location: 2 byte block: 23 1 (DW_OP_plus_uconst: 1)


Are these problems specific for the AVR target?
How would I go about to fix these problems?

Regards,
Torleif Sandnes


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