This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[8/8] solib handler rework: solib-svr4
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 19 Oct 2007 23:34:29 +0200 (CEST)
- Subject: [8/8] solib handler rework: solib-svr4
Hello,
this finally converts the solib-svr4 handler to the cross-platform form.
As this is needed by a large number of platforms, it would have required
changing a significant number of tdep files. However, after the preceding
patch, *every* target that uses solib-svr4 already must have a call to
set_solib_svr4_fetch_link_map_offsets in its gdbarch init routine.
Thus this patch simply installs solib-svr4 operations as part of the
implementation of that routine.
The one additional change is that i386-gnu, unlike every other user of
solib-svr4, added the file only in its native configuration, instead
of via TDEPFILES. This patch fixes that oddity.
Bye,
Ulrich
ChangeLog:
* solib-svr4.c (set_solib_svr4_fetch_link_map_offsets): Call
set_solib_ops to install SVR4 operations.
(_initialize_svr4_solib): Do not set current_target_so_ops.
* config/i386/i386gnu.mh (NATDEPFILES): Move solib.o, solib-svr4.o ...
* config/i386/i386gnu.mt (TDEPFILES): ... to here.
diff -urNp gdb-orig/gdb/config/i386/i386gnu.mh gdb-head/gdb/config/i386/i386gnu.mh
--- gdb-orig/gdb/config/i386/i386gnu.mh 2007-10-15 17:16:46.102996440 +0200
+++ gdb-head/gdb/config/i386/i386gnu.mh 2007-10-15 17:16:54.568973968 +0200
@@ -1,6 +1,5 @@
# Host: Intel 386 running the GNU Hurd
-NATDEPFILES= i386gnu-nat.o gnu-nat.o corelow.o core-regset.o \
- fork-child.o solib.o solib-svr4.o \
+NATDEPFILES= i386gnu-nat.o gnu-nat.o corelow.o core-regset.o fork-child.o \
notify_S.o process_reply_S.o msg_reply_S.o \
msg_U.o exc_request_U.o exc_request_S.o
diff -urNp gdb-orig/gdb/config/i386/i386gnu.mt gdb-head/gdb/config/i386/i386gnu.mt
--- gdb-orig/gdb/config/i386/i386gnu.mt 2004-04-06 03:53:51.000000000 +0200
+++ gdb-head/gdb/config/i386/i386gnu.mt 2007-10-15 17:16:54.572973393 +0200
@@ -1,2 +1,2 @@
# Target: Intel 386 running the GNU Hurd
-TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
+TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o solib.o solib-svr4.o
diff -urNp gdb-orig/gdb/solib-svr4.c gdb-head/gdb/solib-svr4.c
--- gdb-orig/gdb/solib-svr4.c 2007-10-15 17:16:46.190983777 +0200
+++ gdb-head/gdb/solib-svr4.c 2007-10-15 17:16:54.581972098 +0200
@@ -1449,7 +1449,7 @@ solib_svr4_init (struct obstack *obstack
}
/* Set the architecture-specific `struct link_map_offsets' fetcher for
- GDBARCH to FLMO. */
+ GDBARCH to FLMO. Also, install SVR4 solib_ops into GDBARCH. */
void
set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch,
@@ -1458,6 +1458,8 @@ set_solib_svr4_fetch_link_map_offsets (s
struct solib_svr4_ops *ops = gdbarch_data (gdbarch, solib_svr4_data);
ops->fetch_link_map_offsets = flmo;
+
+ set_solib_ops (gdbarch, &svr4_so_ops);
}
/* Fetch a link_map_offsets structure using the architecture-specific
@@ -1583,7 +1585,4 @@ _initialize_svr4_solib (void)
svr4_so_ops.open_symbol_file_object = open_symbol_file_object;
svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
-
- /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
- current_target_so_ops = &svr4_so_ops;
}
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com