This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB not able to debug files(dwarf2.0) loaded using add-symbol-file
On Thu, Jan 04, 2007 at 12:26:51PM +0530, Sandeep Joshi wrote:
> Here the pc to be looked is is '34148' . It starts with first object
> file i.e vmlinux and checks all the psymtabs for their code range. Now
> for the above psymtab, Code range is 'textlow = 288, texthigh =
> 1076066628' and our PC lies in this. So this is set as best_pst and
> function returns without checking the second objfile, which has the
> perfect match for this PC. That is why gdb is not able to show the
> sources correct.
Aha. OK, this is actually a different bug - the range should be set
that way. Unfortunately, this is a very hard bug to fix in GDB. I
recently patched GNU ld to prevent this from happening in new releases;
the patch is here:
http://sourceware.org/ml/binutils/2006-11/msg00019.html
If you can apply that to your linker, I believe it will fix up the
problem, which comes from /DISCARD/ { *(.text.exit) } in the kernel's
linker scripts.
If you can't change your linker, it should be possible to detect the
problem in GDB. Where we currently check for has_section_at_zero,
in dwarf2read.c, check instead that the address is in some section in
the file.
--
Daniel Jacobowitz
CodeSourcery