[PATCH/RFA] buildsym.c: extend parent block bounds if child block exceed limit
David Lecomber
david@streamline-computing.com
Fri Aug 6 21:10:00 GMT 2004
All,
f90 compiled with nested subroutines using Intel's compiler is handled
badly by GDB. Line numbers are not found by backtrace.
Although GDB is capable of reading out all the dwarf2 line information
inside this routine correctly, it can't look up an address to get a line
number when inside a block. The cause is that the containing function's
block does not contain the contained function's address.
> (gdb) b nest.f90:14
> Breakpoint 1 at 0x8049e04: file nest.f90, line 14.
> (gdb) r
> Starting program: /home/david/a.out
> [Thread debugging using libthread_db enabled]
> [New Thread 1024 (LWP 27093)]
> [Switching to Thread 1024 (LWP 27093)]
>
> Breakpoint 1, 0x08049e04 in nest_.second_ ()
> (gdb) bt
> #0 0x08049e04 in nest_.second_ ()
> #1 0x08049dee in nest () at nest.f90:9
> #2 0x08049da8 in main ()
where nest.f90 is attached and line 14 is in the middle of nested
function second.
With the attached patch applied the result is:
> (gdb) bt
> #0 second () at nest.f90:14
> #1 0x08049dee in nest () at nest.f90:9
> #2 0x08049da8 in main ()
I'd like to propose the attached patch. Presently if a child block extends
beyond the parent, the child is shrunk to the parent's bounds. This reverses that.
I wouldn't like to guess the possible consequences of this change...
2004-08-06 David Lecomber <dsl@sources.redhat.com>
* buildsym.c (finish_block): Extend parent block bounds when child
block exceeds current known bounds.
Can someone check this and approve/reject?
d.
-------------- next part --------------
PROGRAM Nest
INTEGER j
INTEGER i
DO i=1, 100
j = i
END DO
time = Second()
CONTAINS
REAL FUNCTION Second()
Second = REAL(10)
END FUNCTION Second
END PROGRAM Nest
-------------- next part --------------
A non-text attachment was scrubbed...
Name: block.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20040806/9aa2f14e/attachment.bin>
More information about the Gdb-patches
mailing list