This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[5/8] solib handler rework: solib-target
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 19 Oct 2007 23:33:17 +0200 (CEST)
- Subject: [5/8] solib handler rework: solib-target
Hello,
this converts the solib-target handler, used by arm-wince and
i386-cygwin targets, to the cross-platform form.
Bye,
Ulrich
ChangeLog:
* arm-wince-tdep.c: Include "solib.h" and "solib-target.h".
(arm_wince_init_abi): Call set_solib_ops.
* i386-cygwin-tdep.c: Include "solib.h" and "solib-target.h".
(i386_cygwin_init_abi): Call set_solib_ops.
* solib-target.c: Include "solib-target.h".
(solib_target_so_ops): Make global.
(_initialize_solib_target): Do not set current_target_so_ops.
* solib-target.h: New file.
* Makefile.in: Update dependencies.
diff -urNp gdb-orig/gdb/Makefile.in gdb-head/gdb/Makefile.in
--- gdb-orig/gdb/Makefile.in 2007-10-16 00:54:39.000000000 +0200
+++ gdb-head/gdb/Makefile.in 2007-10-16 00:54:51.000000000 +0200
@@ -806,6 +806,7 @@ solib_irix_h = solib-irix.h
solib_pa64_h = solib-pa64.h
solib_som_h = solib-som.h
solib_svr4_h = solib-svr4.h
+solib_target_h = solib-target.h
solist_h = solist.h $(symtab_h)
source_h = source.h
sparc64_tdep_h = sparc64-tdep.h $(sparc_tdep_h)
@@ -1846,7 +1847,8 @@ arm-tdep.o: arm-tdep.c $(defs_h) $(frame
$(dwarf2_frame_h) $(gdbtypes_h) $(prologue_value_h) \
$(target_descriptions_h) $(user_regs_h)
arm-wince-tdep.o: arm-wince-tdep.c $(defs_h) $(osabi_h) \
- $(gdbcore_h) $(target_h) $(gdb_string_h) $(arm_tdep_h)
+ $(gdbcore_h) $(target_h) $(solib_h) $(solib_target_h) \
+ $(gdb_string_h) $(arm_tdep_h)
auxv.o: auxv.c $(defs_h) $(target_h) $(gdbtypes_h) $(command_h) \
$(inferior_h) $(valprint_h) $(gdb_assert_h) $(auxv_h) \
$(elf_common_h)
@@ -2126,7 +2128,7 @@ i386bsd-tdep.o: i386bsd-tdep.c $(defs_h)
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) $(i386_tdep_h)
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) $(i386_cygwin_tdep_h)
+ $(gdbcore_h) $(solib_h) $(solib_target_h) $(i386_cygwin_tdep_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)
@@ -2654,7 +2656,7 @@ solib-svr4.o: solib-svr4.c $(defs_h) $(e
$(exec_h) $(auxv_h)
solib-target.o: solib-target.c $(defs_h) $(objfiles_h) $(solist_h) \
$(symtab_h) $(symfile_h) $(target_h) $(vec_h) $(xml_support_h) \
- $(gdb_string_h)
+ $(solib_target_h) $(gdb_string_h)
sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
$(inferior_h) $(gdb_stat_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h) \
$(solib_h) $(symfile_h) $(observer_h) $(gdb_string_h) $(gregset_h)
diff -urNp gdb-orig/gdb/arm-wince-tdep.c gdb-head/gdb/arm-wince-tdep.c
--- gdb-orig/gdb/arm-wince-tdep.c 2007-10-15 23:33:41.000000000 +0200
+++ gdb-head/gdb/arm-wince-tdep.c 2007-10-16 00:54:51.000000000 +0200
@@ -22,6 +22,8 @@
#include "osabi.h"
#include "gdbcore.h"
#include "target.h"
+#include "solib.h"
+#include "solib-target.h"
#include "gdb_string.h"
@@ -92,6 +94,7 @@ arm_wince_init_abi (struct gdbarch_info
set_gdbarch_char_signed (gdbarch, 1);
/* Shared library handling. */
+ set_solib_ops (gdbarch, &solib_target_so_ops);
set_gdbarch_skip_trampoline_code (gdbarch, arm_pe_skip_trampoline_code);
/* Single stepping. */
diff -urNp gdb-orig/gdb/i386-cygwin-tdep.c gdb-head/gdb/i386-cygwin-tdep.c
--- gdb-orig/gdb/i386-cygwin-tdep.c 2007-10-15 23:33:41.000000000 +0200
+++ gdb-head/gdb/i386-cygwin-tdep.c 2007-10-16 00:54:51.000000000 +0200
@@ -26,6 +26,8 @@
#include "gdb_obstack.h"
#include "xml-support.h"
#include "gdbcore.h"
+#include "solib.h"
+#include "solib-target.h"
/* Core file support. */
@@ -231,6 +233,8 @@ i386_cygwin_init_abi (struct gdbarch_inf
tdep->gregset_num_regs = ARRAY_SIZE (i386_win32_gregset_reg_offset);
tdep->sizeof_gregset = I386_WIN32_SIZEOF_GREGSET;
+ set_solib_ops (gdbarch, &solib_target_so_ops);
+
/* Core file support. */
set_gdbarch_regset_from_core_section
(gdbarch, i386_win32_regset_from_core_section);
diff -urNp gdb-orig/gdb/solib-target.c gdb-head/gdb/solib-target.c
--- gdb-orig/gdb/solib-target.c 2007-10-15 23:33:41.000000000 +0200
+++ gdb-head/gdb/solib-target.c 2007-10-16 00:54:51.000000000 +0200
@@ -25,6 +25,7 @@
#include "symfile.h"
#include "target.h"
#include "vec.h"
+#include "solib-target.h"
#include "gdb_string.h"
@@ -359,7 +360,7 @@ solib_target_in_dynsym_resolve_code (COR
return in_plt_section (pc, NULL);
}
-static struct target_so_ops solib_target_so_ops;
+struct target_so_ops solib_target_so_ops;
extern initialize_file_ftype _initialize_solib_target; /* -Wmissing-prototypes */
@@ -379,6 +380,4 @@ _initialize_solib_target (void)
= solib_target_open_symbol_file_object;
solib_target_so_ops.in_dynsym_resolve_code
= solib_target_in_dynsym_resolve_code;
-
- current_target_so_ops = &solib_target_so_ops;
}
diff -urNp gdb-orig/gdb/solib-target.h gdb-head/gdb/solib-target.h
--- gdb-orig/gdb/solib-target.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-head/gdb/solib-target.h 2007-10-16 00:54:51.000000000 +0200
@@ -0,0 +1,26 @@
+/* Handle shared libraries for GDB, the GNU Debugger.
+
+ Copyright (C) 2007 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef SOLIB_TARGET_H
+#define SOLIB_TARGET_H
+
+struct target_so_ops;
+extern struct target_so_ops solib_target_so_ops;
+
+#endif /* solib-target.h */
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com