On Wed, Jun 30, 2010 at 1:57 AM, Artur Pietrek <pietreka at gmail.com> wrote:> Hi Devang, > Thanks for working on that. Unfortunately after your change it still doesn't > work (I've tried x86 and our backend under Linux).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 30 Jun 2010, at 18:40, Devang Patel wrote:> On Wed, Jun 30, 2010 at 1:57 AM, Artur Pietrek <pietreka at 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 Tue, Aug 17, 2010 at 7:09 AM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:> > 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 > >As you say, dwarf standard says it is an offset. 4. A DW_AT_stmt_list attribute whose value is a section offset to the line number information for this compilation unit. This information is placed in a separate object file section from the debugging information entries themselves. The value of the statement list attribute is the offset in the .debug_line section of the first byte of the line number information for this compilation unit (see Section 6.2).> 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. Using absolute address breaks debugger on darwin. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100823/b2e4b369/attachment.html>
Seemingly Similar Threads
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [cfe-dev] Debug information on multiple files
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [cfe-dev] Debug information on multiple files