* frame-base.h (frame_base_p_ftype): Delete definition.
(frame_base_append_predicate): Delete declaration.
* frame-unwind.h (frame_unwind_p_ftype): Delete definition.
(frame_unwind_append_predicate): Delete declaration.
* frame-unwind.c (struct frame_unwind_table): Delete field "p".
(append_predicate): Delete parameter "p".
(frame_unwind_append_predicate): Delete function.
(frame_unwind_append_sniffer): Update call to append_predicate.
(frame_unwind_free): Delete function.
(_initialize_frame_unwind): Pass NULL as "free" to
register_gdbarch_data.
(frame_unwind_init): Append the dummy_frame_sniffer.
(frame_unwind_find_by_frame): Simplify.
* frame-base.c (struct frame_base_table): Delete field "p".
(append_predicate): Delete parameter "p".
(frame_base_append_predicate): Delete function.
(frame_base_append_sniffer): Update call to append_predicate.
(frame_base_free): Delete function.
(frame_base_find_by_frame): Simplify.
(_initialize_frame_base): Pass NULL as "free" to
register_gdbarch_data.
* x86-64-tdep.c (x86_64_frame_sniffer): Replace "x86_64_frame_p".
(x86_64_sigtramp_frame_sniffer): Replace
"x86_64_sigtramp_frame_p".
(x86_64_init_abi): Set the frame unwind sniffers.
* m68k-tdep.c (m68k_frame_sniffer): Replace "m68k_frame_p".
(m68k_sigtramp_frame_sniffer): Replace "m68k_sigtramp_frame_p"
(m68k_gdbarch_init): Set the frame unwind sniffers.
* i386-tdep.c (i386_sigtramp_frame_sniffer): Replace
"i386_sigtramp_frame_p".
(i386_frame_sniffer): Replace "i386_frame_p".
(i386_gdbarch_init): Set the frame unwind sniffers.
* avr-tdep.c (avr_frame_sniffer): Replace "avr_frame_sniffer".
(avr_gdbarch_init): Set the frame unwind sniffers.
* alpha-tdep.c (alpha_sigtramp_frame_sniffer): Replace
"alpha_sigtramp_frame_p"
(alpha_heuristic_frame_sniffer): Replace
"alpha_heuristic_frame_p".
(alpha_gdbarch_init): Set the frame unwind sniffers.
(alpha_dwarf2_init_abi): Ditto.
* alpha-mdebug-tdep.c (alpha_mdebug_frame_sniffer): Replace
"alpha_debug_frame_p".
(alpha_mdebug_frame_base_sniffer): Replace
"alpha_mdebug_frame_base_p".
(alpha_mdebug_init_abi): Set the frame unwind sniffers.
* d10v-tdep.c (d10v_frame_sniffer): Replace "d10v_frame_p".
(d10v_gdbarch_init): Set the frame unwind sniffer.
* dwarf2-frame.c (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
(dwarf2_frame_base_sniffer): Replace "dwarf2_frame_base_p".
* dwarf2-frame.h (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
(dwarf2_frame_base_sniffer): Replace "dwarf2_frame_base_p".
* dummy-frame.c (dummy_frame_sniffer): Replace "dummy_frame_p".
* dummy-frame.h (dummy_frame_sniffer): Replace "dummy_frame_p".
+2003-07-16 Andrew Cagney <cagney@redhat.com>
+
+ * frame-base.h (frame_base_p_ftype): Delete definition.
+ (frame_base_append_predicate): Delete declaration.
+ * frame-unwind.h (frame_unwind_p_ftype): Delete definition.
+ (frame_unwind_append_predicate): Delete declaration.
+ * frame-unwind.c (struct frame_unwind_table): Delete field "p".
+ (append_predicate): Delete parameter "p".
+ (frame_unwind_append_predicate): Delete function.
+ (frame_unwind_append_sniffer): Update call to append_predicate.
+ (frame_unwind_free): Delete function.
+ (_initialize_frame_unwind): Pass NULL as "free" to
+ register_gdbarch_data.
+ (frame_unwind_init): Append the dummy_frame_sniffer.
+ (frame_unwind_find_by_frame): Simplify.
+ * frame-base.c (struct frame_base_table): Delete field "p".
+ (append_predicate): Delete parameter "p".
+ (frame_base_append_predicate): Delete function.
+ (frame_base_append_sniffer): Update call to append_predicate.
+ (frame_base_free): Delete function.
+ (frame_base_find_by_frame): Simplify.
+ (_initialize_frame_base): Pass NULL as "free" to
+ register_gdbarch_data.
+ * x86-64-tdep.c (x86_64_frame_sniffer): Replace "x86_64_frame_p".
+ (x86_64_sigtramp_frame_sniffer): Replace
+ "x86_64_sigtramp_frame_p".
+ (x86_64_init_abi): Set the frame unwind sniffers.
+ * m68k-tdep.c (m68k_frame_sniffer): Replace "m68k_frame_p".
+ (m68k_sigtramp_frame_sniffer): Replace "m68k_sigtramp_frame_p"
+ (m68k_gdbarch_init): Set the frame unwind sniffers.
+ * i386-tdep.c (i386_sigtramp_frame_sniffer): Replace
+ "i386_sigtramp_frame_p".
+ (i386_frame_sniffer): Replace "i386_frame_p".
+ (i386_gdbarch_init): Set the frame unwind sniffers.
+ * avr-tdep.c (avr_frame_sniffer): Replace "avr_frame_sniffer".
+ (avr_gdbarch_init): Set the frame unwind sniffers.
+ * alpha-tdep.c (alpha_sigtramp_frame_sniffer): Replace
+ "alpha_sigtramp_frame_p"
+ (alpha_heuristic_frame_sniffer): Replace
+ "alpha_heuristic_frame_p".
+ (alpha_gdbarch_init): Set the frame unwind sniffers.
+ (alpha_dwarf2_init_abi): Ditto.
+ * alpha-mdebug-tdep.c (alpha_mdebug_frame_sniffer): Replace
+ "alpha_debug_frame_p".
+ (alpha_mdebug_frame_base_sniffer): Replace
+ "alpha_mdebug_frame_base_p".
+ (alpha_mdebug_init_abi): Set the frame unwind sniffers.
+ * d10v-tdep.c (d10v_frame_sniffer): Replace "d10v_frame_p".
+ (d10v_gdbarch_init): Set the frame unwind sniffer.
+ * dwarf2-frame.c (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
+ (dwarf2_frame_base_sniffer): Replace "dwarf2_frame_base_p".
+ * dwarf2-frame.h (dwarf2_frame_sniffer): Replace "dwarf2_frame_p".
+ (dwarf2_frame_base_sniffer): Replace "dwarf2_frame_base_p".
+ * dummy-frame.c (dummy_frame_sniffer): Replace "dummy_frame_p".
+ * dummy-frame.h (dummy_frame_sniffer): Replace "dummy_frame_p".
+
2003-07-16 Michael Snyder <msnyder@redhat.com>
* sh-tdep.c (sh_gdbarch_init): Fetch_registers for the sh3-dsp
};
const struct frame_unwind *
-alpha_mdebug_frame_p (CORE_ADDR pc)
+alpha_mdebug_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
alpha_extra_func_info_t proc_desc;
/* If this PC does not map to a PDR, then clearly this isn't an
};
static const struct frame_base *
-alpha_mdebug_frame_base_p (CORE_ADDR pc)
+alpha_mdebug_frame_base_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
alpha_extra_func_info_t proc_desc;
/* If this PC does not map to a PDR, then clearly this isn't an
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- frame_unwind_append_predicate (gdbarch, alpha_mdebug_frame_p);
- frame_base_append_predicate (gdbarch, alpha_mdebug_frame_base_p);
+ frame_unwind_append_sniffer (gdbarch, alpha_mdebug_frame_sniffer);
+ frame_base_append_sniffer (gdbarch, alpha_mdebug_frame_base_sniffer);
}
};
static const struct frame_unwind *
-alpha_sigtramp_frame_p (CORE_ADDR pc)
+alpha_sigtramp_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
char *name;
/* We shouldn't even bother to try if the OSABI didn't register
};
static const struct frame_unwind *
-alpha_heuristic_frame_p (CORE_ADDR pc)
+alpha_heuristic_frame_sniffer (struct frame_info *next_frame)
{
return &alpha_heuristic_frame_unwind;
}
if (tdep->jb_pc >= 0)
set_gdbarch_get_longjmp_target (gdbarch, alpha_get_longjmp_target);
- frame_unwind_append_predicate (gdbarch, alpha_sigtramp_frame_p);
- frame_unwind_append_predicate (gdbarch, alpha_heuristic_frame_p);
+ frame_unwind_append_sniffer (gdbarch, alpha_sigtramp_frame_sniffer);
+ frame_unwind_append_sniffer (gdbarch, alpha_heuristic_frame_sniffer);
frame_base_set_default (gdbarch, &alpha_heuristic_frame_base);
void
alpha_dwarf2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- frame_unwind_append_predicate (gdbarch, dwarf2_frame_p);
- frame_base_append_predicate (gdbarch, dwarf2_frame_base_p);
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+ frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
}
};
const struct frame_unwind *
-avr_frame_p (CORE_ADDR pc)
+avr_frame_sniffer (struct frame_info *next_frame)
{
return &avr_frame_unwind;
}
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
- frame_unwind_append_predicate (gdbarch, avr_frame_p);
+ frame_unwind_append_sniffer (gdbarch, avr_frame_sniffer);
frame_base_set_default (gdbarch, &avr_frame_base);
set_gdbarch_unwind_dummy_id (gdbarch, avr_unwind_dummy_id);
};
static const struct frame_unwind *
-d10v_frame_p (CORE_ADDR pc)
+d10v_frame_sniffer (struct frame_info *next_frame)
{
return &d10v_frame_unwind;
}
set_gdbarch_print_registers_info (gdbarch, d10v_print_registers_info);
- frame_unwind_append_predicate (gdbarch, d10v_frame_p);
+ frame_unwind_append_sniffer (gdbarch, d10v_frame_sniffer);
frame_base_set_default (gdbarch, &d10v_frame_base);
/* Methods for saving / extracting a dummy frame's ID. The ID's
};
const struct frame_unwind *
-dummy_frame_p (CORE_ADDR pc)
+dummy_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
if (DEPRECATED_PC_IN_CALL_DUMMY_P ()
? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)
: pc_in_dummy_frame (pc))
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */
-extern const struct frame_unwind *dummy_frame_p (CORE_ADDR pc);
+extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
/* Does the PC fall in a dummy frame?
};
const struct frame_unwind *
-dwarf2_frame_p (CORE_ADDR pc)
+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;
};
const struct frame_base *
-dwarf2_frame_base_p (CORE_ADDR pc)
+dwarf2_frame_base_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
if (dwarf2_frame_find_fde (&pc))
return &dwarf2_frame_base;
/* 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. */
-const struct frame_base *dwarf2_frame_base_p (CORE_ADDR pc);
+const struct frame_base *dwarf2_frame_base_sniffer (struct frame_info *next_frame);
/* Register the DWARF CFI for OBJFILE. */
struct frame_base_table
{
- frame_base_p_ftype **p;
frame_base_sniffer_ftype **sniffer;
const struct frame_base *default_base;
int nr;
return table;
}
-static void
-frame_base_free (struct gdbarch *gdbarch, void *data)
-{
- struct frame_base_table *table =
- gdbarch_data (gdbarch, frame_base_data);
- xfree (table->p);
- xfree (table->sniffer);
- xfree (table);
-}
-
static struct frame_base_table *
frame_base_table (struct gdbarch *gdbarch)
{
/* Append a predicate to the end of the table. */
static void
-append_predicate (struct frame_base_table *table, frame_base_p_ftype *p,
+append_predicate (struct frame_base_table *table,
frame_base_sniffer_ftype *sniffer)
{
- table->p = xrealloc (table->p, ((table->nr + 1)
- * sizeof (frame_base_p_ftype *)));
table->sniffer = xrealloc (table->sniffer,
((table->nr + 1)
* sizeof (frame_base_sniffer_ftype *)));
- table->p[table->nr] = p;
table->sniffer[table->nr] = sniffer;
table->nr++;
}
-void
-frame_base_append_predicate (struct gdbarch *gdbarch,
- frame_base_p_ftype *p)
-{
- struct frame_base_table *table = frame_base_table (gdbarch);
- append_predicate (table, p, NULL);
-}
-
void
frame_base_append_sniffer (struct gdbarch *gdbarch,
frame_base_sniffer_ftype *sniffer)
{
struct frame_base_table *table = frame_base_table (gdbarch);
- append_predicate (table, NULL, sniffer);
+ append_predicate (table, sniffer);
}
void
for (i = 0; i < table->nr; i++)
{
const struct frame_base *desc = NULL;
- if (table->p[i] != NULL)
- desc = table->p[i] (frame_pc_unwind (next_frame));
- else if (table->sniffer[i] != NULL)
- desc = table->sniffer[i] (next_frame);
+ desc = table->sniffer[i] (next_frame);
if (desc != NULL)
return desc;
}
void
_initialize_frame_base (void)
{
- frame_base_data = register_gdbarch_data (frame_base_init,
- frame_base_free);
+ frame_base_data = register_gdbarch_data (frame_base_init, NULL);
}
struct gdbarch;
struct regcache;
-/* For compatibility. */
-
-typedef const struct frame_base *(frame_base_p_ftype) (CORE_ADDR pc);
-extern void frame_base_append_predicate (struct gdbarch *gdbarch,
- frame_base_p_ftype *p);
-
/* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
and that this is a `normal frame'; use the NEXT frame, and its
register unwind method, to determine the address of THIS frame's
struct frame_unwind_table
{
- frame_unwind_p_ftype **p;
frame_unwind_sniffer_ftype **sniffer;
int nr;
};
/* Append a predicate to the end of the table. */
static void
-append_predicate (struct frame_unwind_table *table, frame_unwind_p_ftype *p,
+append_predicate (struct frame_unwind_table *table,
frame_unwind_sniffer_ftype *sniffer)
{
- table->p = xrealloc (table->p, ((table->nr + 1)
- * sizeof (frame_unwind_p_ftype *)));
table->sniffer = xrealloc (table->sniffer, ((table->nr + 1)
* sizeof (frame_unwind_sniffer_ftype *)));
- table->p[table->nr] = p;
table->sniffer[table->nr] = sniffer;
table->nr++;
}
frame_unwind_init (struct gdbarch *gdbarch)
{
struct frame_unwind_table *table = XCALLOC (1, struct frame_unwind_table);
- append_predicate (table, dummy_frame_p, NULL);
+ append_predicate (table, dummy_frame_sniffer);
return table;
}
-static void
-frame_unwind_free (struct gdbarch *gdbarch, void *data)
-{
- struct frame_unwind_table *table =
- gdbarch_data (gdbarch, frame_unwind_data);
- xfree (table->p);
- xfree (table->sniffer);
- xfree (table);
-}
-
-void
-frame_unwind_append_predicate (struct gdbarch *gdbarch,
- frame_unwind_p_ftype *p)
-{
- struct frame_unwind_table *table =
- gdbarch_data (gdbarch, frame_unwind_data);
- if (table == NULL)
- {
- /* ULGH, called during architecture initialization. Patch
- things up. */
- table = frame_unwind_init (gdbarch);
- set_gdbarch_data (gdbarch, frame_unwind_data, table);
- }
- append_predicate (table, p, NULL);
-}
-
void
frame_unwind_append_sniffer (struct gdbarch *gdbarch,
frame_unwind_sniffer_ftype *sniffer)
table = frame_unwind_init (gdbarch);
set_gdbarch_data (gdbarch, frame_unwind_data, table);
}
- append_predicate (table, NULL, sniffer);
+ append_predicate (table, sniffer);
}
const struct frame_unwind *
for (i = 0; i < table->nr; i++)
{
const struct frame_unwind *desc;
- if (table->p[i] != NULL)
- desc = table->p[i] (frame_pc_unwind (next_frame));
- else if (table->sniffer[i] != NULL)
- desc = table->sniffer[i] (next_frame);
- else
- internal_error (__FILE__, __LINE__, "Missing sniffer?");
+ desc = table->sniffer[i] (next_frame);
if (desc != NULL)
return desc;
}
void
_initialize_frame_unwind (void)
{
- frame_unwind_data = register_gdbarch_data (frame_unwind_init,
- frame_unwind_free);
+ frame_unwind_data = register_gdbarch_data (frame_unwind_init, NULL);
}
#include "frame.h" /* For enum frame_type. */
-/* For compatibility with the old frame code. See end of header for
- new methods. */
-typedef const struct frame_unwind *(frame_unwind_p_ftype) (CORE_ADDR pc);
-extern void frame_unwind_append_predicate (struct gdbarch *gdbarch,
- frame_unwind_p_ftype *p);
-
/* The following unwind functions assume a chain of frames forming the
sequence: (outer) prev <-> this <-> next (inner). All the
functions are called with called with the next frame's `struct
};
static const struct frame_unwind *
-i386_frame_p (CORE_ADDR pc)
+i386_frame_sniffer (struct frame_info *next_frame)
{
return &i386_frame_unwind;
}
};
static const struct frame_unwind *
-i386_sigtramp_frame_p (CORE_ADDR pc)
+i386_sigtramp_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
char *name;
/* We shouldn't even bother to try if the OSABI didn't register
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);
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
- frame_unwind_append_predicate (gdbarch, i386_sigtramp_frame_p);
- frame_unwind_append_predicate (gdbarch, i386_frame_p);
+ frame_unwind_append_sniffer (gdbarch, i386_sigtramp_frame_sniffer);
+ frame_unwind_append_sniffer (gdbarch, i386_frame_sniffer);
return gdbarch;
}
};
static const struct frame_unwind *
-m68k_frame_p (CORE_ADDR pc)
+m68k_frame_sniffer (struct frame_info *next_frame)
{
return &m68k_frame_unwind;
}
};
static const struct frame_unwind *
-m68k_sigtramp_frame_p (CORE_ADDR pc)
+m68k_sigtramp_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
char *name;
/* We shouldn't even bother to try if the OSABI didn't register
if (tdep->jb_pc >= 0)
set_gdbarch_get_longjmp_target (gdbarch, m68k_get_longjmp_target);
- frame_unwind_append_predicate (gdbarch, m68k_sigtramp_frame_p);
- frame_unwind_append_predicate (gdbarch, m68k_frame_p);
+ frame_unwind_append_sniffer (gdbarch, m68k_sigtramp_frame_sniffer);
+ frame_unwind_append_sniffer (gdbarch, m68k_frame_sniffer);
return gdbarch;
}
};
static const struct frame_unwind *
-x86_64_frame_p (CORE_ADDR pc)
+x86_64_frame_sniffer (struct frame_info *next_frame)
{
return &x86_64_frame_unwind;
}
};
static const struct frame_unwind *
-x86_64_sigtramp_frame_p (CORE_ADDR pc)
+x86_64_sigtramp_frame_sniffer (struct frame_info *next_frame)
{
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
char *name;
find_pc_partial_function (pc, &name, NULL, NULL);
in the future. */
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
- frame_unwind_append_predicate (gdbarch, x86_64_sigtramp_frame_p);
- frame_unwind_append_predicate (gdbarch, x86_64_frame_p);
+ frame_unwind_append_sniffer (gdbarch, x86_64_sigtramp_frame_sniffer);
+ frame_unwind_append_sniffer (gdbarch, x86_64_frame_sniffer);
frame_base_set_default (gdbarch, &x86_64_frame_base);
}
\f