From: Ross Morley <ross@tensilica.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: GDB List <gdb@sources.redhat.com>
Subject: Re: Source info in discontiguous hand asm files
Date: Thu, 04 May 2006 18:26:00 -0000 [thread overview]
Message-ID: <445A4765.8010707@tensilica.com> (raw)
In-Reply-To: <20060504124531.GA29440@nevyn.them.org>
Daniel Jacobowitz wrote:
>On Thu, May 04, 2006 at 02:06:08AM -0700, Ross Morley wrote:
>
>
>>Yes, it is correct, though not as extensive as it could be.
>>In the case where there are multiple ranges of text in a compilation
>>unit, DA_AT_{low,high}_pc is omitted from the CU per DWARF spec.
>>Where there is only one range of text, those are present and correct.
>>The assembler doesn't add function-specific info.
>>There is info in the aranges table to associate the ranges with the
>>compilation unit, so a scan of that table could provide it.
>>
>>
>
>The section .debug_info contains:
>
> Compilation Unit @ offset 0x0:
> Length: 52
> Version: 2
> Abbrev Offset: 0
> Pointer Size: 8
> <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
> DW_AT_stmt_list : 0
> DW_AT_name : text.S
> DW_AT_comp_dir : /home/drow/text
> DW_AT_producer : GNU AS 2.16.91
> DW_AT_language : 32769 (MIPS assembler)
>
>>From the DWARF standard:
>
>Compilation unit entries may have the following attributes:
>
>1. Either a DW_AT_low_pc and DW_AT_high_pc pair of attributes or a
> DW_AT_ranges attribute whose values encode the contiguous or
> non-contiguous address ranges, respectively, of the machine
> instructions generated for the compilation unit (see Section 2.16).
>
> A DW_AT_low_pc attribute may also be specified in combination with
> DW_AT_ranges to specify the default base address for use in location
> lists (see Section 2.5.4) and range lists (see Section 2.16.3).
>
>
Ah, DW_AT_ranges is in DWARF3, not DWARF2, so it's relatively new.
>Now, there's a "may" there, so the compilation unit clearly isn't
>required to have either. But GDB definitely expects a compilation unit
>to have one or the other. It does not implement .debug_aranges
>support.
>
>
That I knew. And now it seems there's a better way.
>So, your options are to use .debug_aranges to look up textlow/texthigh
>for compilation units that don't have a PC range, or to modify gas to
>emit DW_AT_ranges. The latter is likely to be easier.
>
>
>
Agreed.
Thanks for your help.
Ross
prev parent reply other threads:[~2006-05-04 18:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-04 1:23 Ross Morley
2006-05-04 1:59 ` Daniel Jacobowitz
2006-05-04 9:07 ` Ross Morley
2006-05-04 12:45 ` Daniel Jacobowitz
2006-05-04 18:26 ` Ross Morley [this message]
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=445A4765.8010707@tensilica.com \
--to=ross@tensilica.com \
--cc=drow@false.org \
--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