[LLVMdev] [patch] DwarfDebug problem with line section

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Aug 23 22:43:26 PDT 2010


On 24 Aug 2010, at 02:36, Devang Patel wrote:

> On Tue, Aug 17, 2010 at 7:09 AM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:
> 
>> At least that's what I learned when I looked at what GCC and GNU AS
>> generated, and changing them into offsets (I tried that in our
>> compiler) results in GDB not understanding the debug information.
> 
> AFAICT, GCC in darwin uses offset here.

Indeed.

> Using absolute address breaks
> debugger on darwin.

Yes, I know. Our compiler has a target flag indicating whether a target requires offsets or absolute addresses for the address of the abbreviation table and the DW_AT_stmt_list. It's actually more complex than I wrote in my previous mail:

* Darwin uses a precomputed offset via the construct
.section __DWARF,__debug_info,regular,debug
        .long   L$set$2
        .set L$set$2,Ldebug_abbrev0-Ldebug_abbrevsection0
       ...
        .long   L$set$3
        .set L$set$3,Ldebug_line0-Ldebug_linesection0

* Windows uses a secrel32 symbol (so it's also relative):
.section .debug_info
      ...
        .secrel32       .Ldebug_abbrev0 
      ...
        .secrel32       .Ldebug_line0

* Linux and FreeBSD use an absolute address:
.section .debug_info
      ...
        .long   .Ldebug_abbrev0
      ...
        .long   .Ldebug_line0

I don't know about other OSes.


Jonas



More information about the llvm-dev mailing list