diff options
author | Kris Warkentin <kewarken@qnx.com> | 2004-12-10 13:38:23 +0000 |
---|---|---|
committer | Kris Warkentin <kewarken@qnx.com> | 2004-12-10 13:38:23 +0000 |
commit | d737fd7f91e8282171e28b96156adbf8362293b8 (patch) | |
tree | 5ecc3c47500fdfa926bad38be76f3be8c753df73 /gdb/i386-nto-tdep.c | |
parent | 0e2cfdce255a722d3b3d3cdadf227e3110ef64f8 (diff) | |
download | gdb-d737fd7f91e8282171e28b96156adbf8362293b8.zip gdb-d737fd7f91e8282171e28b96156adbf8362293b8.tar.gz gdb-d737fd7f91e8282171e28b96156adbf8362293b8.tar.bz2 |
* nto-tdep.h: Include osabi.h. Prototypes for generic Neutrino
osabi sniffer, signal handling initializer, 'in_dynsym_resolve_code'
function and nto_set_target function.
(struct nto_target_ops): Put comments inline with struct. Add osabi
sniffer hook. Redefine macros to permit testing/assignment. Remove
nto_ prefix from members.
* nto-tdep.c (nto_find_and_open_solib): Allocate all buffers
dynamically to support arbitrary root paths. Check for basename of
lib in search path and then check for absolute.
(nto_in_dynsym_resolve_code): New function.
(nto_core_sniffer): New function.
(regset_core_fns): Register core sniffer.
(nto_initialize_signals): New function.
(_initialize_nto_tdep): Move signal initialization code to above to
avoid initialization race conditions.
(nto_set_target): New function.
* nto-procfs.c: Minor formatting/indenting changes.
(procfs_is_nto_target): New function.
(procfs_open): Set nto_is_nto_target.
(_initialize_procfs): Ditto. Remove notice_signals() call to avoid
initialization race conditions.
(procfs_create_inferior): Resume inferior after creation.
* i386-nto-tdep.c: Declare i386_nto_target.
(init_i386nto_ops): Initialize i386_nto_target instead of
current_nto_target.
(i386nto_init_abi): Initialize signals. Call nto_set_target. Set
TARGET_SO_IN_DYNSYM_RESOLVE_CODE.
(_initialize_i386nto_tdep): Call init_i386nto_ops. Register osabi sniffer.
Diffstat (limited to 'gdb/i386-nto-tdep.c')
-rw-r--r-- | gdb/i386-nto-tdep.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c index 30f6238..d6a6f8a 100644 --- a/gdb/i386-nto-tdep.c +++ b/gdb/i386-nto-tdep.c @@ -59,6 +59,8 @@ static int regmap[] = { (-1 * 4) /* filler */ }; +static struct nto_target_ops i386_nto_target; + /* Given a gdb regno, return the offset into Neutrino's register structure or -1 if register is unknown. */ static int @@ -258,14 +260,14 @@ i386nto_sigcontext_addr (struct frame_info *next_frame) static void init_i386nto_ops (void) { - current_nto_target.nto_regset_id = i386nto_regset_id; - current_nto_target.nto_supply_gregset = i386nto_supply_gregset; - current_nto_target.nto_supply_fpregset = i386nto_supply_fpregset; - current_nto_target.nto_supply_altregset = nto_dummy_supply_regset; - current_nto_target.nto_supply_regset = i386nto_supply_regset; - current_nto_target.nto_register_area = i386nto_register_area; - current_nto_target.nto_regset_fill = i386nto_regset_fill; - current_nto_target.nto_fetch_link_map_offsets = + i386_nto_target.regset_id = i386nto_regset_id; + i386_nto_target.supply_gregset = i386nto_supply_gregset; + i386_nto_target.supply_fpregset = i386nto_supply_fpregset; + i386_nto_target.supply_altregset = nto_dummy_supply_regset; + i386_nto_target.supply_regset = i386nto_supply_regset; + i386_nto_target.register_area = i386nto_register_area; + i386_nto_target.regset_fill = i386nto_regset_fill; + i386_nto_target.fetch_link_map_offsets = i386nto_svr4_fetch_link_map_offsets; } @@ -274,6 +276,9 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + /* Deal with our strange signals. */ + nto_initialize_signals (); + /* NTO uses ELF. */ i386_elf_init_abi (info, gdbarch); @@ -301,12 +306,18 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Supply a nice function to find our solibs. */ TARGET_SO_FIND_AND_OPEN_SOLIB = nto_find_and_open_solib; - init_i386nto_ops (); + /* Our linker code is in libc. */ + TARGET_SO_IN_DYNSYM_RESOLVE_CODE = nto_in_dynsym_resolve_code; + + nto_set_target (&i386_nto_target); } void _initialize_i386nto_tdep (void) { + init_i386nto_ops (); gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_QNXNTO, i386nto_init_abi); + gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, + nto_elf_osabi_sniffer); } |