aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-18 19:59:27 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-18 19:59:27 +0000
commit1ce5d6dda58437d73491c1dda90dbdd48e37e142 (patch)
tree34ec5060141ed87db077cbabca0f7accfc9857a3 /gdb
parente6e5e94cb843195fef8afb195338f22dddc4d796 (diff)
downloadgdb-1ce5d6dda58437d73491c1dda90dbdd48e37e142.zip
gdb-1ce5d6dda58437d73491c1dda90dbdd48e37e142.tar.gz
gdb-1ce5d6dda58437d73491c1dda90dbdd48e37e142.tar.bz2
2003-07-18 Andrew Cagney <cagney@redhat.com>
* dwarf2-frame.c (dwarf2_frame_sniffer): Use frame_unwind_address_in_block, instead of frame_pc_unwind. (dwarf2_frame_cache): Ditto.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/dwarf2-frame.c29
2 files changed, 17 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eeb0b7a..5724574 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2003-07-18 Andrew Cagney <cagney@redhat.com>
+ * dwarf2-frame.c (dwarf2_frame_sniffer): Use
+ frame_unwind_address_in_block, instead of frame_pc_unwind.
+ (dwarf2_frame_cache): Ditto.
+
+2003-07-18 Andrew Cagney <cagney@redhat.com>
+
* user-regs.h (struct gdbarch): Declare opaque.
* ui-out.h (struct ui_file): Declare opaque.
* dwarf2-frame.h (struct frame_info): Declare opaque.
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 1ddf914..6a40df5 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -491,15 +491,12 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
done for "normal" frames and not for resume-type frames (signal
handlers, sentinel frames, dummy frames).
- We don't do what GCC's does here (yet). It's not clear how
- reliable the method is. There's also a problem with finding the
- right FDE; see the comment in dwarf_frame_p. If dwarf_frame_p
- selected this frame unwinder because it found the FDE for the
- next function, using the adjusted return address might not yield
- a FDE at all. The problem isn't specific to DWARF CFI; other
- unwinders loose in similar ways. Therefore it's probably
- acceptable to leave things slightly broken for now. */
- fs->pc = frame_pc_unwind (next_frame);
+ frame_unwind_address_in_block does just this.
+
+ It's not clear how reliable the method is though - there is the
+ potential for the register state pre-call being different to that
+ on return. */
+ fs->pc = frame_unwind_address_in_block (next_frame);
/* Find the correct FDE. */
fde = dwarf2_frame_find_fde (&fs->pc);
@@ -710,15 +707,11 @@ static const struct frame_unwind dwarf2_frame_unwind =
const struct frame_unwind *
dwarf2_frame_sniffer (struct frame_info *next_frame)
{
- CORE_ADDR pc = frame_pc_unwind (next_frame);
- /* The way GDB works, this function can be called with PC just after
- the last instruction of the function we're supposed to return the
- unwind methods for. In that case we won't find the correct FDE;
- instead we find the FDE for the next function, or we won't find
- an FDE at all. There is a possible solution (see the comment in
- dwarf2_frame_cache), GDB doesn't pass us enough information to
- implement it. */
- if (dwarf2_frame_find_fde (&pc))
+ /* Grab an address that is guarenteed to reside somewhere within the
+ function. frame_pc_unwind(), for a no-return next function, can
+ end up returning something past the end of this function's body. */
+ CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame);
+ if (dwarf2_frame_find_fde (&block_addr))
return &dwarf2_frame_unwind;
return NULL;