bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

debug info problem with mn10300-elf-gas


From: Bart Veer
Subject: debug info problem with mn10300-elf-gas
Date: Wed, 12 Mar 2003 16:23:12 +0000 (GMT)

There seem to be problems with mn10300 debug info handling, using
either anoncvs or the binutils 2.13.1 release. A suitable test case is
a simple C++ program built using e.g. gcc 3.2.1:

    extern "C" void
    cyg_start( void )
    {
    }

compiled using "mn10300-elf-g++ -c -g -O2 bin_sem0.cxx"

"mn10300-elf-objdump -g" on the resulting object file fails with
"no recognized debugging information"

"mn10300-read-elf --debug-dump=info bin_sem0.o" gives a bit more
information:

  The section .debug_info contains:

  readelf: Warning: Skipping unexpected symbol type 0
    Compilation Unit @ 0:
     Length:        65
     Version:       2
     Abbrev Offset: 0
     Pointer Size:  4
   <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
       DW_AT_stmt_list   : 0    
       DW_AT_high_pc     : 0 0  
       DW_AT_low_pc      : 0 0  
       DW_AT_name        : (indirect string, offset: 0x0): GNU C++ 3.2.1
       DW_AT_comp_dir    : (indirect string, offset: 0x0): GNU C++ 3.2.1
       DW_AT_producer    : (indirect string, offset: 0x0): GNU C++ 3.2.1
       DW_AT_language    : 4    (C++)
  ...

It appears that all string offsets in the debug info have been set to
0. Using "mn10300-elf-objdump -s" confirms this:

 ...
 Contents of section .debug_info:
  0000 41000000 02000000 00000401 00000000  A...............
  0010 00000000 00000000 00000000 00000000  ................
  0020 00000000 04020100 00000001 03000000  ................
  0030 00000000 00015903 00000000 01040000  ......Y.........
  0040 00000102 00
 ...

The .debug_str section does contain all the strings I would expect.

If I generate an intermediate .s file using mn10300-elf-g++ -S that
contains:
        ...
        .section        .debug_info
        .4byte  0x41
        .2byte  0x2
        .4byte  .Ldebug_abbrev0
        .byte   0x4
        .uleb128 0x1
        .4byte  .Ldebug_line0
        .4byte  .Letext0
        .4byte  .Ltext0
        .4byte  .LC0
        .4byte  .LC1
        .4byte  .LC2
        ...
        .section        .debug_str,"MS",@progbits,1
.LC2:
        .string "GNU C++ 3.2.1"
.LC3:
        .string "cyg_start"
        ...

So the .debug_info source matches the objdump -s output, but the
directives ".4byte .LC0" etc. have not been resolved. I have tried
putting some debugging into gas and there are definitely a number of
calls to resolve_symbol_value() for .LC0 etc. I don't know my way
around the gas sources yet so tracking this down further may take a
while, but it seemed worthwhile sharing my findings to date.

The resulting .o files can be linked to give a functional executable
but the final debug info is bogus: mn10300-elf-gdb reports
".DW_FORM_strp pointing outside of .debug_str section".

Bart




reply via email to

[Prev in Thread] Current Thread [Next in Thread]