aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/config/i386/tm-i386.h26
-rw-r--r--gdb/i386-tdep.c30
3 files changed, 36 insertions, 28 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9cde79c..6d371f5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2002-06-15 Mark Kettenis <kettenis@gnu.org>
+ * config/i386/tm-i386.h (FUNCTION_START_OFFSET, INNER_THAN,
+ BREAKPOINT, DECR_PC_AFTER_BREAK): Removed.
+ * i386-tdep.c (i386_skip_prologue): Adjust function signature to
+ fit into multi-arch framework.
+ (i386_breakpoint_from_pc): New function.
+ (i386_gdbarch_init): Adjust for removal of the macros mentioned
+ above.
+
* config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION,
FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS,
FRAME_ARGS_SKIP, FRAME_INIT_SAVED_REGS): Remove defines.
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h
index 6ac6bc7..572642a 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/i386/tm-i386.h
@@ -32,32 +32,6 @@ struct frame_saved_regs;
struct value;
struct type;
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions to reach some
- "real" code. */
-
-#define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc))
-
-extern int i386_skip_prologue (int);
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xcc}
-
-/* Amount PC must be decremented by after a breakpoint. This is often the
- number of bytes in BREAKPOINT but not always. */
-
-#define DECR_PC_AFTER_BREAK 1
-
-
/* Return the GDB type object for the "standard" data type of data in
register REGNUM. */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 250d1c2..9739015 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -666,8 +666,8 @@ i386_frame_init_saved_regs (struct frame_info *fip)
/* Return PC of first real instruction. */
-int
-i386_skip_prologue (int pc)
+CORE_ADDR
+i386_skip_prologue (CORE_ADDR pc)
{
unsigned char op;
int i;
@@ -749,6 +749,24 @@ i386_skip_prologue (int pc)
return (codestream_tell ());
}
+/* Use the program counter to determine the contents and size of a
+ breakpoint instruction. Return a pointer to a string of bytes that
+ encode a breakpoint instruction, store the length of the string in
+ *LEN and optionally adjust *PC to point to the correct memory
+ location for inserting the breakpoint.
+
+ On the i386 we have a single breakpoint that fits in a single byte
+ and can be inserted anywhere. */
+
+static const unsigned char *
+i386_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static unsigned char break_insn[] = { 0xcc }; /* int 3 */
+
+ *len = sizeof (break_insn);
+ return break_insn;
+}
+
void
i386_push_dummy_frame (void)
{
@@ -1402,6 +1420,14 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_use_struct_convention (gdbarch, i386_use_struct_convention);
set_gdbarch_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs);
+ set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue);
+
+ /* Stack grows downward. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_breakpoint_from_pc (gdbarch, i386_breakpoint_from_pc);
+ set_gdbarch_decr_pc_after_break (gdbarch, 1);
+ set_gdbarch_function_start_offset (gdbarch, 0);
/* The following redefines make backtracing through sigtramp work.
They manufacture a fake sigtramp frame and obtain the saved pc in