+Fri Apr 28 16:22:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (frameless_look_for_prologue): Use
+ PROLOG_FRAMELESS_P instead of SKIP_PROLOGUE_FRAMELESS_P.
+ * gdbarch.sh (PROLOG_FRAMELESS_P): Define.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * arch-utils.h, arch-utils.c (generic_prologue_frameless_p): New
+ function.
+
Fri Apr 28 15:31:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
From "Serge Nikulin" <nikulin@actsw.amat.com>:
*rem_len = gdb_len;
}
+int
+generic_prologue_frameless_p (CORE_ADDR ip)
+{
+#ifdef SKIP_PROLOGUE_FRAMELESS_P
+ return ip == SKIP_PROLOGUE_FRAMELESS_P (ip);
+#else
+ return ip == SKIP_PROLOGUE (ip);
+#endif
+}
+
+
/* */
extern initialize_file_ftype __initialize_gdbarch_utils;
/* Typical remote_translate_xfer_address */
extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address;
+/* Generic implementation of prologue_frameless_p. Just calls
+ SKIP_PROLOG and checks the return value to see if it actually
+ changed. */
+extern gdbarch_prologue_frameless_p_ftype generic_prologue_frameless_p;
+
#endif
if (func_start)
{
func_start += FUNCTION_START_OFFSET;
- after_prologue = func_start;
-#ifdef SKIP_PROLOGUE_FRAMELESS_P
/* This is faster, since only care whether there *is* a
prologue, not how long it is. */
- after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
-#else
- after_prologue = SKIP_PROLOGUE (after_prologue);
-#endif
- return after_prologue == func_start;
+ return PROLOGUE_FRAMELESS_P (func_start);
}
else if (frame->pc == 0)
/* A frame with a zero PC is usually created by dereferencing a
gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
gdbarch_skip_prologue_ftype *skip_prologue;
+ gdbarch_prologue_frameless_p_ftype *prologue_frameless_p;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
gdbarch->pointer_to_address = generic_pointer_to_address;
gdbarch->address_to_pointer = generic_address_to_pointer;
gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+ gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->skip_prologue == 0))
internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
+ /* Skip verify of prologue_frameless_p, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->inner_than == 0))
internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
"gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
(long) current_gdbarch->skip_prologue
/*SKIP_PROLOGUE ()*/);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
+ (long) current_gdbarch->prologue_frameless_p
+ /*PROLOGUE_FRAMELESS_P ()*/);
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: INNER_THAN = 0x%08lx\n",
(long) current_gdbarch->inner_than
gdbarch->skip_prologue = skip_prologue;
}
+int
+gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
+{
+ if (GDB_MULTI_ARCH == 0)
+ return generic_prologue_frameless_p (ip);
+ if (gdbarch->prologue_frameless_p == 0)
+ internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
+ return gdbarch->prologue_frameless_p (ip);
+}
+
+void
+set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
+ gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
+{
+ gdbarch->prologue_frameless_p = prologue_frameless_p;
+}
+
int
gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
{
#endif
#endif
+typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
+extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
+#if (GDB_MULTI_ARCH > 1) || !defined (PROLOGUE_FRAMELESS_P)
+#define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
+#endif
+
typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
f:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
#
f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
+f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p:0
f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc:0
f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint:0