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

RE: Compiler emitting .debug_line versus binutils


> On 29 June 2007 15:35, Will Newton wrote:
> 
> >  Hi all,  I have a binutils 2.17 port and a gcc 2.95.3 port for an 
> > embedded DSP type chip. The compiler spits out a 
> .debug_line section in the
> > assembler code like this:          .section        
> .debug_line        
> > .4byte  0xab         .2byte  0x2         .4byte  0x1b       
>   .byte   0x4  
> > .byte   0x1         .byte   -10         .byte   245         
> .byte   10     
> > ...  This seems to be done by dwarf2out_finish() in 
> dwarf2out.c inside gcc.
> > I assemble the result with gas, which then outputs another 
> .debug_line 
> > section in dwarf2_finish() in dwarf2dbg.c.  This results in 
> a rather 
> > strabge looking .debug_line section in the final executable.
> 
>   What's strange-looking about it?  That's exactly what 
> they're supposed to look like.

What is strange (to me at least) is that I get two chunks of debug_line
data output, so if I do readelf --debug-dump=line I get some valid debug
data followed by an empty chunk of debug_line data. Is that expected?

e.g.

Dump of debug contents of section .debug_line:

  Length:                      171
  DWARF Version:               2
  Prologue Length:             27
  Minimum Instruction Length:  4
  Initial value of 'is_stmt':  1
  Line Base:                   -10
  Line Range:                  245
  Opcode Base:                 10
 
(debug line data...)

  Length:                      25
  DWARF Version:               2
  Prologue Length:             19
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 args

 The Directory Table is empty.

 The File Name Table is empty.

 Line Number Statements:
-
This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
-


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