Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michal Ludvig <mludvig@suse.cz>
To: Daniel Berlin <dberlin@dberlin.org>
Cc: gdb <gdb@sources.redhat.com>, gcc@sources.redhat.com
Subject: Reference to .debug_loc
Date: Fri, 14 Feb 2003 14:57:00 -0000	[thread overview]
Message-ID: <3E4D03F3.40103@suse.cz> (raw)

Hi again,
when location lists are in use, .debug_info looks like this:

         .section        .debug_info
         .long   0x187   # Length of Compilation Unit Info
         .value  0x2     # DWARF version number
         .long   .Ldebug_abbrev0 # Offset Into Abbrev. Section
         .byte   0x8     # Pointer Size (in bytes)
         .uleb128 0x1    # (DIE (0xb) DW_TAG_compile_unit)
         .long   .Ldebug_line0   # DW_AT_stmt_list
         .quad   .Letext0        # DW_AT_high_pc
         .quad   .Ltext0 # DW_AT_low_pc
         .byte   0x1     # DW_AT_language
          [...]
         .uleb128 0x3    # (DIE (0x50) DW_TAG_formal_parameter)
         .long   .LASF2  # DW_AT_name: "value"
         .byte   0x1     # DW_AT_decl_file
         .byte   0x2     # DW_AT_decl_line
         .long   0x8f    # DW_AT_type
         .long   .LLST0-.Ldebug_loc0     # DW_AT_location

So, the reference to .debug_loc on the last line of the example 
(DW_AT_location) is an offset within that section, ie. it's 0 (NULL) for 
the first entry with a location list. However when I link several .o 
files together, each of them have DW_AT_location entries based at the 
same NULL.

This time I realy can't see a way to find out at what position in the 
resulting (ie. linked from several ones) .debug_loc should I start 
reading for a given compilation unit.

Should there be something more in the CU header? Something similar to
.long   .Ldebug_abbrev0 # Offset Into Abbrev. Section
For example
.long   .Ldebug_loc0 # Offset Into Loclist Section

Or is there another way?

Thanks in advance!

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz


             reply	other threads:[~2003-02-14 14:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-14 14:57 Michal Ludvig [this message]
2003-02-14 15:26 ` Daniel Jacobowitz
2003-02-14 19:24   ` Daniel Berlin
2003-02-14 19:51     ` Daniel Jacobowitz
2003-02-14 20:23       ` Daniel Berlin
2003-02-14 20:35       ` Jakub Jelinek
2003-02-14 20:40         ` Daniel Jacobowitz
2003-02-17 14:55           ` Michal Ludvig
2003-02-14 21:09         ` Daniel Berlin
2003-02-19 10:51           ` Michal Ludvig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E4D03F3.40103@suse.cz \
    --to=mludvig@suse.cz \
    --cc=dberlin@dberlin.org \
    --cc=gcc@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox