The following reply was made to PR backtrace/2024; it has been noted by GNATS.
From: James E Wilson <wilson@xxxxxxxxxxxxx>
To: Daniel Jacobowitz <drow@xxxxxxxxx>
Cc: gdb-gnats@xxxxxxxxxxxxxxxxxx
Subject: Re: backtrace/2024: backtrace fails when function ends with call
to abort
Date: 01 Nov 2005 16:39:59 -0800
--=-6RT2XoIijifY7DF76Wjw
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Tue, 2005-11-01 at 15:32, Daniel Jacobowitz wrote:
> GDB already has a concept of "frame unwind address". This is probably
> as simple as changing get_frame_pc to get_frame_address_in_block in
> dwarf2loc.c, right before that error message is produced. Want to try
> that?
Yes, that appears to be exactly what I am looking for. There are two
uses of get_frame_pc in dwarf2loc.c. Only the first one needs to be
fixed to make this testcase work, but they both should be fixed. With
this patch, the testcase works. On an x86_64 linux system, I am now
getting
(gdb) bt
#0 0x0000002a9569b9a0 in abort () from /lib64/tls/libc.so.6
#1 0x00000000004004dc in main (argc=1, argv=0x7fbfffeeb8) at tmp.c:4
which is much better. It is still printing the return address (4004dc)
which is past the end of the function, but I suppose that is OK if it is
understood that this is supposed to be a return address, in which case
it is correct. In any case, the arguments are now printed which is the
important part.
I haven't run the gdb testsuite yet. My machine is currently busy doing
a gcc bootstrap to test a gcc patch. I will run the gdb testsuite when
that is done.
--=-6RT2XoIijifY7DF76Wjw
Content-Disposition: attachment; filename=patch.frame.address
Content-Type: text/plain; name=patch.frame.address; charset=utf-8
Content-Transfer-Encoding: 7bit
2005-11-01 James E Wilson <wilson@xxxxxxxxxxxx>
* dwarf2loc.c (dwarf_expr_frame_base): Use get_frame_address_in_block
instead of get_frame_pc.
(loclist_read_variable): Likewise.
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.29
diff -p -p -r1.29 dwarf2loc.c
*** dwarf2loc.c 12 Jul 2005 13:06:54 -0000 1.29
--- dwarf2loc.c 2 Nov 2005 00:13:36 -0000
*************** dwarf_expr_frame_base (void *baton, gdb_
*** 165,172 ****
{
struct dwarf2_loclist_baton *symbaton;
symbaton = SYMBOL_LOCATION_BATON (framefunc);
! *start = find_location_expression (symbaton, length,
! get_frame_pc (debaton->frame));
}
else
{
--- 165,173 ----
{
struct dwarf2_loclist_baton *symbaton;
symbaton = SYMBOL_LOCATION_BATON (framefunc);
! *start
! = find_location_expression (symbaton, length,
! get_frame_address_in_block
(debaton->frame));
}
else
{
*************** loclist_read_variable (struct symbol *sy
*** 580,586 ****
size_t size;
data = find_location_expression (dlbaton, &size,
! frame ? get_frame_pc (frame) : 0);
if (data == NULL)
{
val = allocate_value (SYMBOL_TYPE (symbol));
--- 581,588 ----
size_t size;
data = find_location_expression (dlbaton, &size,
! frame ? get_frame_address_in_block (frame)
! : 0);
if (data == NULL)
{
val = allocate_value (SYMBOL_TYPE (symbol));
--=-6RT2XoIijifY7DF76Wjw--
|