This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[4/8] solib handler rework: solib-irix


Hello,

this converts solib-iris to the cross-platform form.  Only the mips-irix
target uses this handler.

Bye,
Ulrich


ChangeLog:

	* mips-irix-tdep.c: Include "gdb_string.h", "solib.h", "solib-irix.h".
	(mips_irix_init_abi): Call set_solib_ops.
	* solib-irix.c: Include "solib.h" and "solib-irix.h".
	(irix_so_ops): Make global.
	(_initialize_irix_solib): Do not set current_target_so_ops.
	* solib-irix.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 01:26:54.000000000 +0200
+++ gdb-head/gdb/Makefile.in	2007-10-16 01:29:02.000000000 +0200
@@ -802,6 +802,7 @@ sh_tdep_h = sh-tdep.h
 sim_regno_h = sim-regno.h
 sol2_tdep_h = sol2-tdep.h
 solib_h = solib.h
+solib_irix_h = solib-irix.h
 solib_pa64_h = solib-pa64.h
 solib_som_h = solib-som.h
 solib_svr4_h = solib-svr4.h
@@ -2377,7 +2378,8 @@ mips64obsd-nat.o: mips64obsd-nat.c $(def
 mips64obsd-tdep.o: mips64obsd-tdep.c $(defs_h) $(osabi_h) $(regcache_h) \
 	$(regset_h) $(trad_frame_h) $(tramp_frame_h) $(gdb_assert_h) \
 	$(gdb_string_h) $(mips_tdep_h) $(solib_svr4_h)
-mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h)
+mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \
+	$(solib_h) $(solib_irix_h) $(elf_bfd_h)
 mips-linux-nat.o: mips-linux-nat.c $(defs_h) $(mips_tdep_h) $(target_h) \
 	$(regcache_h) $(linux_nat_h) $(gdb_proc_service_h) $(gregset_h) \
 	$(mips_linux_tdep_h) $(inferior_h) $(target_descriptions_h) \
@@ -2630,7 +2632,8 @@ solib-frv.o: solib-frv.c $(defs_h) $(gdb
 	$(gdbcore_h) $(solist_h) $(frv_tdep_h) $(objfiles_h) $(symtab_h) \
 	$(language_h) $(command_h) $(gdbcmd_h) $(elf_frv_h) $(solib_h)
 solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
-	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h)
+	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) \
+	$(solib_h) $(solib_irix_h)
 solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
 solib-null.o: solib-null.c $(defs_h) $(solist_h)
 solib-osf.o: solib-osf.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
diff -urNp gdb-orig/gdb/mips-irix-tdep.c gdb-head/gdb/mips-irix-tdep.c
--- gdb-orig/gdb/mips-irix-tdep.c	2007-10-16 01:18:44.000000000 +0200
+++ gdb-head/gdb/mips-irix-tdep.c	2007-10-16 01:29:02.000000000 +0200
@@ -20,6 +20,9 @@
 
 #include "defs.h"
 #include "osabi.h"
+#include "gdb_string.h"
+#include "solib.h"
+#include "solib-irix.h"
 
 #include "elf-bfd.h"
 
@@ -78,6 +81,7 @@ static void
 mips_irix_init_abi (struct gdbarch_info info,
                     struct gdbarch *gdbarch)
 {
+  set_solib_ops (gdbarch, &irix_so_ops);
 }
 
 void
diff -urNp gdb-orig/gdb/solib-irix.c gdb-head/gdb/solib-irix.c
--- gdb-orig/gdb/solib-irix.c	2007-10-16 01:18:44.000000000 +0200
+++ gdb-head/gdb/solib-irix.c	2007-10-16 01:29:02.000000000 +0200
@@ -33,6 +33,9 @@
 #include "inferior.h"
 
 #include "solist.h"
+#include "solib.h"
+#include "solib-irix.h"
+
 
 /* Link map info to include in an allocate so_list entry.  Unlike some
    of the other solib backends, this (Irix) backend chooses to decode
@@ -705,7 +708,7 @@ irix_in_dynsym_resolve_code (CORE_ADDR p
   return 0;
 }
 
-static struct target_so_ops irix_so_ops;
+struct target_so_ops irix_so_ops;
 
 void
 _initialize_irix_solib (void)
@@ -718,7 +721,4 @@ _initialize_irix_solib (void)
   irix_so_ops.current_sos = irix_current_sos;
   irix_so_ops.open_symbol_file_object = irix_open_symbol_file_object;
   irix_so_ops.in_dynsym_resolve_code = irix_in_dynsym_resolve_code;
-
-  /* FIXME: Don't do this here.  *_gdbarch_init() should set so_ops. */
-  current_target_so_ops = &irix_so_ops;
 }
diff -urNp gdb-orig/gdb/solib-irix.h gdb-head/gdb/solib-irix.h
--- gdb-orig/gdb/solib-irix.h	1970-01-01 01:00:00.000000000 +0100
+++ gdb-head/gdb/solib-irix.h	2007-10-16 01:29:02.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_IRIX_H
+#define SOLIB_IRIX_H
+
+struct target_so_ops;
+extern struct target_so_ops irix_so_ops;
+
+#endif /* solib-irix.h */
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]