From: Daniel Berlin <dan@cgsoftware.com>
To: Jim Blandy <jimb@zwingli.cygnus.com>
Cc: Brian Grant <grant@transmeta.com>, gdb@sources.redhat.com
Subject: Re: support for compilation units with discontiguous address ranges? (.debug_ranges)
Date: Fri, 20 Jul 2001 19:14:00 -0000 [thread overview]
Message-ID: <87hew7do4z.fsf@cgsoftware.com> (raw)
In-Reply-To: <np1ynbthie.fsf@zwingli.cygnus.com>
Jim Blandy <jimb@zwingli.cygnus.com> writes:
> Brian Grant <grant@transmeta.com> writes:
>> Has anyone implemented dwarf2 support in gdb for compilation units with
>> discontiguous ranges of addresses?
>
> No. Patches are welcome!
>
>> gcc 3.x doesn't seem to produce .debug_ranges and gdb 5.0 doesn't
>> read it at all. gdb also seems to ignore .debug_aranges.
>
> That's right.
>
>> What currently happens in gdb is that all functions in .text1
>> and .text2 at addresses between foo() and bar() are attributed
>> the file and line number of the last line of foo(). Their real,
>> accurate line-number info is overshadowed completely.
>
> Right --- GDB misidentifies which compilation unit they belong to, so
> it never looks at the right compilation units' line tables.
>
>> I noticed that gcc doesn't produce DW_AT_low_pc/high_pc fields for
>> foobar.c, as it normally would for a DW_TAG_compilation_unit record,
>> where all functions in the compilation unit were in the same
>> section.
>
> Right, that's as required by the Dwarf 2 spec:
>
> The presence of low and high pc attributes in a compilation
> unit entry imply that the code generated for that compilation
> unit is contiguous and exists totally within the boundaries
> specified by those two attributes. If that is not the case,
> no low and high pc attributes should be produced.
>
> The Dwarf 2.1 spec says something similar.
>
>> Does anyone know of a workaround for this problem?
>
> I can only think of two options:
>
> 1) Don't do that. Put functions that need to go in separate segments
> in separate .c files.
>
> 2) Implement DW_AT_ranges support in GCC and GDB.
I have the first part of this done.
I just haven't submitted the patch yet, because i haven't had time to
update hte new dwarf2 reader to support it.
--
"When I woke up this morning my girlfriend asked me, "Did you
sleep good?" I said, "No, I made a few mistakes."
"-Steven Wright
next prev parent reply other threads:[~2001-07-20 19:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-19 14:56 Brian Grant
2001-07-20 14:30 ` Jim Blandy
2001-07-20 19:14 ` Daniel Berlin [this message]
2001-07-21 8:53 ` Jim Blandy
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=87hew7do4z.fsf@cgsoftware.com \
--to=dan@cgsoftware.com \
--cc=gdb@sources.redhat.com \
--cc=grant@transmeta.com \
--cc=jimb@zwingli.cygnus.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