From: Pedro Alves Date: Mon, 7 Jul 2008 22:05:45 +0000 (+0000) Subject: * i386-dicos-tdep.c: Include "inferior.h". X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42f0bc8eaf33eb991a9cbe9a42a0738d948fc65e;p=binutils-gdb.git * 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). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ba05c7b4ea1..09421654122 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2008-07-07 Pedro Alves + + * 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). + 2008-07-07 Joel Brobecker * gstdint.h: New file. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 36186a90f78..055a7594376 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2236,7 +2236,7 @@ i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \ $(i386_tdep_h) $(regset_h) $(gdb_obstack_h) $(xml_support_h) \ $(gdbcore_h) $(solib_h) $(solib_target_h) $(i386_cygwin_tdep_h) i386-dicos-tdep.o: i386-dicos-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \ - $(solib_h) $(solib_target_h) + $(solib_h) $(solib_target_h) $(inferior_h) i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(target_h) $(fbsd_nat_h) $(i386_tdep_h) $(i386bsd_nat_h) \ $(bsd_kvm_h) 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.