[commit] OpenBSD skip_solib_resolver implementation

Mark Kettenis mark.kettenis@xs4all.nl
Tue Dec 27 15:41:00 GMT 2005


This avoids some single-stepping through the nasty innards of ld.so.

Committed.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* obsd-tdep.c: New file.
	* obsd-tdep.h: New file.
	* Makefile.in (obsd_tdep_h): New variable.
	(ALLDEPFILES): Add obsd-tdep.c.
	(obsd-tdep.o): New target.

Index: obsd-tdep.c
===================================================================
RCS file: obsd-tdep.c
diff -N obsd-tdep.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ obsd-tdep.c 26 Dec 2005 19:11:01 -0000
@@ -0,0 +1,38 @@
+/* Target-dependent code for OpenBSD.
+
+   Copyright (C) 2005 Free Software Foundation, 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 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include "defs.h"
+#include "frame.h"
+#include "symtab.h"
+
+#include "obsd-tdep.h"
+
+CORE_ADDR
+obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  struct minimal_symbol *msym;
+
+  msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
+  if (msym && SYMBOL_VALUE_ADDRESS (msym) == pc)
+    return frame_pc_unwind (get_current_frame ());
+  else
+    return find_solib_trampoline_target (pc);
+}
Index: obsd-tdep.h
===================================================================
RCS file: obsd-tdep.h
diff -N obsd-tdep.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ obsd-tdep.h 26 Dec 2005 19:11:01 -0000
@@ -0,0 +1,29 @@
+/* Target-dependent code for OpenBSD.
+
+   Copyright (C) 2005 Free Software Foundation, 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 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef OBSD_TDEP_H
+#define OBSD_TDEP_H 1
+
+struct gdbarch;
+
+CORE_ADDR obsd_skip_solib_resolver (struct gdbarch *, CORE_ADDR);
+
+#endif /* obsd-tdep.h */
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.766
diff -u -p -r1.766 Makefile.in
--- Makefile.in 22 Dec 2005 17:06:24 -0000 1.766
+++ Makefile.in 26 Dec 2005 19:11:03 -0000
@@ -743,6 +743,7 @@ nbsd_tdep_h = nbsd-tdep.h
 nto_tdep_h = nto-tdep.h $(defs_h) $(solist_h) $(osabi_h) $(regset_h)
 objc_lang_h = objc-lang.h
 objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h)
+obsd_tdep_h = obsd-tdep.h
 ocd_h = ocd.h
 osabi_h = osabi.h
 parser_defs_h = parser-defs.h $(doublest_h)
@@ -1425,7 +1426,7 @@ ALLDEPFILES = \
 	mips-tdep.c mipsv4-nat.c \
 	mipsnbsd-nat.c mipsnbsd-tdep.c \
 	mips64obsd-nat.c mips64obsd-tdep.c \
-	nbsd-tdep.c \
+	nbsd-tdep.c obsd-tdep.c \
 	solib-osf.c \
 	somread.c solib-som.c $(HPREAD_SOURCE) \
 	ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
@@ -2338,6 +2339,7 @@ nto-procfs.o: nto-procfs.c $(defs_h) $(g
 nto-tdep.o: nto-tdep.c $(gdb_stat_h) $(gdb_string_h) $(nto_tdep_h) $(top_h) \
 	$(cli_decode_h) $(cli_cmds_h) $(inferior_h) $(gdbarch_h) $(bfd_h) \
 	$(elf_bfd_h) $(solib_svr4_h) $(gdbcore_h)
+obsd-tdep.o: obsd-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(obsd_tdep_h)
 objc-exp.o: objc-exp.c $(defs_h) $(gdb_string_h) $(expression_h) \
 	$(objc_lang_h) $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) \
 	$(bfd_h) $(symfile_h) $(objfiles_h) $(top_h) $(completer_h) \



More information about the Gdb-patches mailing list