-
Devang
> _______________________________________________
> LLVM Developers mailing list
> LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
--
-
Devang
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Thanks for brining this up.
-
Devang
What errors exactly you are seeing ?
> The problem is that you put difference between two labels
> .Lset7 = .Lsection_line_begin-.Lsection_line ## DW_AT_stmt_list
> and that will be evaluated by assembler to a constant. It has to be a label,
> not a constant, because it is the linker who knows the correct offset.
How will linker translate a label into correct offset ?
-
Devang
> On Wed, Jun 30, 2010 at 1:57 AM, Artur Pietrek <piet...@gmail.com>
> wrote:
>> The problem is that you put difference between two labels
>> .Lset7 = .Lsection_line_begin-.Lsection_line ## DW_AT_stmt_list
>> and that will be evaluated by assembler to a constant. It has to be
>> a label,
>> not a constant, because it is the linker who knows the correct
>> offset.
>
> How will linker translate a label into correct offset ?
Sorry for reviving an old thread (I'm going through my 10000 message
backlog from llvmdev), but it seems this hasn't been changed yet in
the the mean time.
On ELF platforms (at least Linux and FreeBSD) and on Windows, both of
the following are labels (i.e., absolute addresses to be relocated by
the linker) as opposed to offsets relative to the relevant section's
start, even though the DWARF standard says they are offsets:
* address of the abbreviation table
* DW_AT_stmt_list
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.
Jonas
On ELF platforms (at least Linux and FreeBSD) and on Windows, both of
the following are labels (i.e., absolute addresses to be relocated by
the linker) as opposed to offsets relative to the relevant section's
start, even though the DWARF standard says they are offsets:
* address of the abbreviation table
* DW_AT_stmt_list
4. A DW_AT_stmt_list attribute whose value is a section offset to the line number information for this compilation unit.
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.
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.