aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-21 14:28:28 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-21 14:28:28 +0000
commit1d9bed00a44ea23ef5b590fd1fbdcf471a459fb1 (patch)
tree49dc8c11b5b3df7651c49666b27f08c95be8b0b5
parentd2cbcde066b24ce41b9c58ea94d49bfaadb7b4d6 (diff)
downloadgdb-1d9bed00a44ea23ef5b590fd1fbdcf471a459fb1.zip
gdb-1d9bed00a44ea23ef5b590fd1fbdcf471a459fb1.tar.gz
gdb-1d9bed00a44ea23ef5b590fd1fbdcf471a459fb1.tar.bz2
2003-07-21 Andrew Cagney <cagney@redhat.com>
* dwarf2-frame.h (dwarf2_frame_sniffer): Replace "dwarf2_frame_p". * dwarf2-frame.c (dwarf2_frame_sniffer): Replace "dwarf2_frame_p". (dwarf2_frame_cache): Use frame_unwind_address_in_block, instead of frame_pc_unwind. * i386-tdep.c (i386_gdbarch_init): Update. * alpha-tdep.c (alpha_dwarf2_init_abi): Update.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/alpha-tdep.c2
-rw-r--r--gdb/dwarf2-frame.c30
-rw-r--r--gdb/dwarf2-frame.h2
-rw-r--r--gdb/i386-tdep.c2
5 files changed, 24 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ed69c23..286d679 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2003-07-21 Andrew Cagney <cagney@redhat.com>
+
+ * dwarf2-frame.h (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
+ * dwarf2-frame.c (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
+ (dwarf2_frame_cache): Use frame_unwind_address_in_block, instead
+ of frame_pc_unwind.
+ * i386-tdep.c (i386_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_dwarf2_init_abi): Update.
+
2003-07-20 Stephane Carrez <stcarrez@nerim.fr>
* m68hc11-tdep.c (m68hc11_pseudo_register_read): Use
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index fb2ca18..e8b941a 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1583,7 +1583,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void
alpha_dwarf2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- frame_unwind_append_predicate (gdbarch, dwarf2_frame_p);
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
frame_base_append_predicate (gdbarch, dwarf2_frame_base_p);
set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
}
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index e0b1a05..2dea90d 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);
@@ -708,16 +705,13 @@ static const struct frame_unwind dwarf2_frame_unwind =
};
const struct frame_unwind *
-dwarf2_frame_p (CORE_ADDR pc)
+dwarf2_frame_sniffer (struct frame_info *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;
diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h
index 4b4c1a5..1d47422 100644
--- a/gdb/dwarf2-frame.h
+++ b/gdb/dwarf2-frame.h
@@ -29,7 +29,7 @@ struct objfile;
/* Return the frame unwind methods for the function that contains PC,
or NULL if it can't be handled by DWARF CFI frame unwinder. */
-const struct frame_unwind *dwarf2_frame_p (CORE_ADDR pc);
+const struct frame_unwind *dwarf2_frame_sniffer (struct frame_info *next_frame);
/* Return the frame base methods for the function that contains PC, or
NULL if it can't be handled by the DWARF CFI frame unwinder. */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 3b98180..1a3d072 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1811,7 +1811,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_fetch_pointer_argument (gdbarch, i386_fetch_pointer_argument);
/* Hook in the DWARF CFI frame unwinder. */
- frame_unwind_append_predicate (gdbarch, dwarf2_frame_p);
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
frame_base_set_default (gdbarch, &i386_frame_base);