Provide a generic nbsd_skip_solib_resolver and use it in alpha and arm.

Others should follow suit.

I even tested it.
This commit is contained in:
skrll 2016-11-18 09:52:33 +00:00
parent 5644a41214
commit 3a5e17dcb9
5 changed files with 22 additions and 33 deletions

View File

@ -22,7 +22,6 @@
#include "defs.h"
#include "frame.h"
#include "gdbcore.h"
#include "objfiles.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
@ -37,19 +36,6 @@
#include "tramp-frame.h"
#include "target.h"
/* from obsd-tdep.c with symbol name adjusted to ours */
static CORE_ADDR
alphanbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
else
return find_solib_trampoline_target (get_current_frame (), pc);
}
/* Core file support. */
/* Even though NetBSD/alpha used ELF since day one, it used the
@ -347,7 +333,7 @@ alphanbsd_init_abi (struct gdbarch_info info,
/* NetBSD/alpha has SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets);
set_gdbarch_skip_solib_resolver (gdbarch, alphanbsd_skip_solib_resolver);
set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
#ifdef notyet
tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;

View File

@ -19,10 +19,10 @@
#include "defs.h"
#include "osabi.h"
#include "objfiles.h"
#include "arch/arm.h"
#include "arm-tdep.h"
#include "nbsd-tdep.h"
#include "solib-svr4.h"
/* Description of the longjmp buffer. */
@ -36,19 +36,6 @@ static const gdb_byte arm_nbsd_arm_be_breakpoint[] = {0xe6, 0x00, 0x00, 0x11};
static const gdb_byte arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde};
static const gdb_byte arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe};
/* from obsd-tdep.c with symbol name adjusted to ours */
static CORE_ADDR
armnbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_rtld_bind", NULL, NULL);
if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
else
return find_solib_trampoline_target (get_current_frame (), pc);
}
static void
arm_netbsd_init_abi_common (struct gdbarch_info info,
struct gdbarch *gdbarch)
@ -114,7 +101,7 @@ arm_netbsd_elf_init_abi (struct gdbarch_info info,
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
/* for single stepping; see PR/50773 */
set_gdbarch_skip_solib_resolver (gdbarch, armnbsd_skip_solib_resolver);
set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
}
static enum gdb_osabi

View File

@ -109,7 +109,7 @@ arm*-*-linux*)
arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
# Target: NetBSD/arm
gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armbsd-tdep.o \
armnbsd-tdep.o solib-svr4.o"
armnbsd-tdep.o nbsd-tdep.o solib-svr4.o"
;;
arm*-*-openbsd*)
# Target: OpenBSD/arm

View File

@ -3,9 +3,9 @@
Copyright (C) 2002-2016 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@ -20,6 +20,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "objfiles.h"
#include "solib-svr4.h"
#include "nbsd-tdep.h"
@ -47,3 +48,16 @@ nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
return (func_name != NULL
&& startswith (func_name, "__sigtramp"));
}
CORE_ADDR
nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{
struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
else
return find_solib_trampoline_target (get_current_frame (), pc);
}

View File

@ -25,4 +25,6 @@ struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
CORE_ADDR nbsd_skip_solib_resolver (struct gdbarch *gdbarch,
CORE_ADDR pc);
#endif /* NBSD_TDEP_H */