This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: debugging something with multiple text sections in one compilation unit
- From: Daniel Jacobowitz <drow at false dot org>
- To: Robin Getz <rgetz at blackfin dot uclinux dot org>
- Cc: gdb at sourceware dot org
- Date: Fri, 3 Aug 2007 07:37:43 -0400
- Subject: Re: debugging something with multiple text sections in one compilation unit
- References: <200708030009.46899.rgetz@blackfin.uclinux.org>
On Fri, Aug 03, 2007 at 12:09:46AM -0400, Robin Getz wrote:
> As far as we can tell - there seems to be a limitation in DWARF spec (or DWARF
> implementation of gcc/gdb) - there seems to be only only one single base
> address. All other addresses are an offset to that base in the same
> compilation unit.
>
> When we use l1_text attribute, we have two code segments in one compilation
> unit and the offset between them is determined only when it's loaded. So one
> segment cannot get symbol addresses computed correctly - and we can not set
> breakpoints in functions that are in L1, and debugging applications is pretty
> difficult.
There is no requirement to use a single base address in DWARF, or in
GDB's implementation of it; just use .debug_aranges. GCC does the
right thing if you use __attribute__((section)).
You're supposed to tell GDB the section offsets, so that it can adjust
debug info appropriately. See add-symbol-file in the manual. There's
no way yet to do this automatically for a single section, though; only
by hand.
--
Daniel Jacobowitz
CodeSourcery