summaryrefslogtreecommitdiff
path: root/gdb/i386-dicos-tdep.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-07-07 22:05:45 +0000
committerPedro Alves <pedro@codesourcery.com>2008-07-07 22:05:45 +0000
commitff44b1c0b0895dc98b6d44ecf28e327117451fee (patch)
tree423f4992047ebcb46b7d6c85d42a4dabc7dc5131 /gdb/i386-dicos-tdep.c
parent2c69665ba741175ee18c9041c4fc938419488774 (diff)
downloadgdb-ff44b1c0b0895dc98b6d44ecf28e327117451fee.tar.gz
* i386-dicos-tdep.c: Include "inferior.h".
(i386_dicos_frame_align): New. (i386_dicos_init_abi): Register i386_dicos_frame_align. Set call dummy location ON_STACK. * Makefile.in (i386-dicos-tdep.o): Depend on $(inferior_h).
Diffstat (limited to 'gdb/i386-dicos-tdep.c')
-rw-r--r--gdb/i386-dicos-tdep.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index e92313ad562..5fdaaba0b28 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -22,6 +22,18 @@
#include "gdb_string.h"
#include "solib.h"
#include "solib-target.h"
+#include "inferior.h"
+
+static CORE_ADDR
+i386_dicos_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ /* Having a call dummy on the stack requires a gdbarch_frame_align
+ method to align the breakpoint instruction in the stack.
+ Strictly speaking, we could just return SP pristine on x86. But,
+ as long as we're providing a frame align method, might as well
+ align for efficiency. */
+ return sp & -(CORE_ADDR)16;
+}
static void
i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
@@ -29,6 +41,12 @@ i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
set_solib_ops (gdbarch, &solib_target_so_ops);
+
+ /* There's no (standard definition of) entry point or a guaranteed
+ text location we could find with a symbol where to place the call
+ dummy, so we put it on the stack. */
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_frame_align (gdbarch, i386_dicos_frame_align);
}
/* Look in the elf symbol table of ABFD for a symbol named WANTED.