Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Debugging with multiple sections in assembly files.
@ 2007-11-16 13:22 Robert Norton
  2007-11-16 15:33 ` Daniel Jacobowitz
  2007-11-17 12:17 ` Jan Kratochvil
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Norton @ 2007-11-16 13:22 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

Hi,

The attached tar contains source and a Makefile for two test programs.
One program includes an assembly file with two functions in the default
.text section, and the other contains a file with one function in .text
and another in a section 'foo'. With the first program gdb is able to
find the source for the assembly functions, for the other it is not:

(gdb) info line bar
Line 3 of "test_nosections.S" starts at address 0x400490 <bar> and ends
at 0x400491 <bling>.
---
(gdb) info line bar
No line number information available for address 0x400490 <bar>

The problem appears to be that in the case of the multi section asm file
gcc doesn't emit DW_AT_low_pc and DW_AT_high_pc for the assembly file
compile unit (try 'make dwarf.diff') because they don't make much sense
in that case. This means that gdb doesn't load the dwarf symbols for
that file and hence can't find source line information (as shown by
running 'info sources' before and after 'info line bar' -- try 'make
all').

Is this a known issue? Can it be fixed easily?

I tested with fairly recent gdb and gcc, but not latest HEAD versions.

Thanks,

Robert

[-- Attachment #2: asm_gdb.tar.gz --]
[-- Type: application/x-gzip, Size: 618 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Debugging with multiple sections in assembly files.
  2007-11-16 13:22 Debugging with multiple sections in assembly files Robert Norton
@ 2007-11-16 15:33 ` Daniel Jacobowitz
  2007-11-17 12:17 ` Jan Kratochvil
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-11-16 15:33 UTC (permalink / raw)
  To: Robert Norton; +Cc: gdb

On Fri, Nov 16, 2007 at 05:14:54AM -0800, Robert Norton wrote:
> The problem appears to be that in the case of the multi section asm file
> gcc doesn't emit DW_AT_low_pc and DW_AT_high_pc for the assembly file
> compile unit (try 'make dwarf.diff') because they don't make much sense
> in that case. This means that gdb doesn't load the dwarf symbols for
> that file and hence can't find source line information (as shown by
> running 'info sources' before and after 'info line bar' -- try 'make
> all').

s/gcc/gas/.  gas needs to generate DW_AT_ranges, I would imagine.

This looks to me like:

2006-08-08  Sterling Augustine  <sterling@tensilica.com>

        * dwarf2dbg.c (out_debug_info): Add new parameter ranges_seg
        and emit DW_AT_ranges when code in compilation unit is not
        contiguous.
        (out_debug_abbrev): Emit DW_AT_ranges abbreviation if code in
        is not contiguous.
        (dwarf2_finish): Create and pass ranges_seg to out_debug_info.
        (out_debug_ranges): New function to emit .debug_ranges section
        when code is not contiguous.

Is that patch in your assembler?  If not, can you try a newer one?

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Debugging with multiple sections in assembly files.
  2007-11-16 13:22 Debugging with multiple sections in assembly files Robert Norton
  2007-11-16 15:33 ` Daniel Jacobowitz
@ 2007-11-17 12:17 ` Jan Kratochvil
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2007-11-17 12:17 UTC (permalink / raw)
  To: Robert Norton; +Cc: gdb

On Fri, 16 Nov 2007 14:14:54 +0100, Robert Norton wrote:
...
> (gdb) info line bar
> Line 3 of "test_nosections.S" starts at address 0x400490 <bar> and ends
> at 0x400491 <bling>.
> ---
> (gdb) info line bar
> No line number information available for address 0x400490 <bar>

Please apply for GDB:
	http://sources.redhat.com/ml/gdb-patches/2007-10/msg00207.html

$ fedora-gdb ./test_sections
GNU gdb Red Hat Linux (6.6-36.fc8rh)
(gdb) info line bar
Line 3 of "test_sections.S" starts at address 0x400480 <bar> and ends at 0x400481 <bar+1>.
$ upstream-gdb ./test_sections
GNU gdb 6.7.50.20071116-cvs
(gdb) info line bar
No line number information available for address 0x400480 <bar>

Unfortunately I have still TODOlist pending there to finish the testcase for
the upstream GDB.
	http://sources.redhat.com/ml/gdb-patches/2007-10/msg00213.html


Regards,
Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-17 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-16 13:22 Debugging with multiple sections in assembly files Robert Norton
2007-11-16 15:33 ` Daniel Jacobowitz
2007-11-17 12:17 ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox