This is the mail archive of the gdb-patches@sources.redhat.com 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]

[COMMIT] Enable new solib interface for HPUX


This somewhat large patch adds in the hooks and Makefile changes needed
to use the new solib interface. Testsuite results are similar to what we
used to see with the old solib code (i tested hppa2.0w-hp-hpux11.11 and
hppa64-hp-hpux11.11).

Committed, please let me know if you notice any problems :)

randolph

2004-12-13  Randolph Chung  <tausq@debian.org>

	* Makefile.in (pa64solib_h, somsolib_h): Delete.
	(solib_pa64_h, solib_som_h): New.
	(HFILES_NO_SRCDIR, ALLDEPFILES): Replace somsolib.h with solib-som.h.
	(hppa-hpux-tdep.o, hpread.o): Update dependencies.
	(pa64solib.o, somsolib.o): Delete.
	(solib-pa64.o, solib-som.o): New.
	* hppa-hpux-tdep.c: Include new solib interfaces.
	(hppa_hpux_som_init_abi): Attach to SOM solib interface.
	(hppa_hpux_elf_init_abi): Attach to PA64 ELF solib interface.
	* hppa-tdep.c (internalize_unwinds): If solib_get_text_base method
	is available, use it to determine the base of unwind records.
	* hppa-tdep.h (gdbarch_tdep): Add new solib methods.
	* hpread.c: Replace somsolib.h with solib-som.h.
	(hpread_process_one_debug_symbol): Use target vector to get thread 
	start address.
	* config/pa/hppa64.mt (TDEPFILES): Use new solib interface.
	* config/pa/hppahpux.mt (TDEPFILES): Likewise.
	* config/pa/hpux.mh (NATDEPFILES): Delete references to target objects.
	* config/pa/tm-hppah.h: Use new solib interface.


Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.677
diff -u -p -r1.677 Makefile.in
--- Makefile.in	10 Dec 2004 09:42:09 -0000	1.677
+++ Makefile.in	13 Dec 2004 03:53:41 -0000
@@ -741,7 +741,7 @@ objc_lang_h = objc-lang.h
 objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h)
 ocd_h = ocd.h
 osabi_h = osabi.h
-pa64solib_h = pa64solib.h
+solib_pa64_h = solib-pa64.h
 parser_defs_h = parser-defs.h $(doublest_h)
 p_lang_h = p-lang.h
 ppcnbsd_tdep_h = ppcnbsd-tdep.h
@@ -766,7 +766,7 @@ sim_regno_h = sim-regno.h
 solib_h = solib.h
 solib_svr4_h = solib-svr4.h
 solist_h = solist.h
-somsolib_h = somsolib.h
+solib_som_h = solib-som.h
 source_h = source.h
 sparc64_tdep_h = sparc64-tdep.h $(sparc_tdep_h)
 sparc_nat_h = sparc-nat.h
@@ -856,7 +856,7 @@ HFILES_NO_SRCDIR = bcache.h buildsym.h c
 	m2-lang.h  p-lang.h \
 	complaints.h valprint.h \
 	gdbthread.h \
-	dcache.h remote-utils.h top.h somsolib.h
+	dcache.h remote-utils.h top.h solib-som.h
 
 # Header files that already have srcdir in them, or which are in objdir.
 
@@ -1402,7 +1402,7 @@ ALLDEPFILES = \
 	mips64obsd-nat.c mips64obsd-tdep.c \
 	nbsd-tdep.c \
 	ns32k-tdep.c solib-osf.c \
-	somread.c somsolib.c $(HPREAD_SOURCE) \
+	somread.c solib-som.c $(HPREAD_SOURCE) \
 	ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
 	ppcnbsd-nat.c ppcnbsd-tdep.c \
 	ppcobsd-nat.c ppcobsd-tdep.c \
@@ -1975,9 +1975,10 @@ hppa-hpux-nat.o: hppa-hpux-nat.c $(defs_
 	$(target_h) $(gdb_assert_h) $(hppa_tdep_h) $(inf_ptrace_h) \
 	$(inf_ttrace_h)
 hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
-	$(osabi_h) $(frame_h) $(frame_unwind_h) $(trad_frame_h) $(symtab_h) \
-	$(objfiles_h) $(inferior_h) $(infcall_h) $(observer_h) $(regset_h) \
-	$(gdb_string_h) $(hppa_tdep_h)
+	$(osabi_h) $(gdb_string_h) $(frame_h) $(frame_unwind_h) \
+	$(trad_frame_h) $(tramp_frame_h) $(symtab_h) $(objfiles_h) \
+	$(inferior_h) $(infcall_h) $(observer_h) $(hppa_tdep_h) $(solib_som_h) \
+	$(solib_pa64_h) $(regset_h)
 hppa-linux-nat.o: hppa-linux-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
 	$(gdb_string_h) $(inferior_h) $(hppa_tdep_h) $(gregset_h)
 hppa-linux-tdep.o: hppa-linux-tdep.c $(defs_h) $(gdbcore_h) $(osabi_h) \
@@ -1992,7 +1993,7 @@ hppa-tdep.o: hppa-tdep.c $(defs_h) $(bfd
 hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \
 	$(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
 	$(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \
-	$(somsolib_h) $(gdb_assert_h) $(hppa_tdep_h) $(gdb_string_h)
+	$(solib_som_h) $(gdb_assert_h) $(hppa_tdep_h)
 hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
 	$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h)
 i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
@@ -2313,10 +2314,9 @@ ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gd
 	$(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
 osabi.o: osabi.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(osabi_h) \
 	$(arch_utils_h) $(gdbcmd_h) $(command_h) $(elf_bfd_h)
-pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \
-	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
-	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h) $(exec_h) $(hppa_tdep_h)
+solib-pa64.o: solib-pa64.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
+	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(hppa_tdep_h) \
+	$(solist_h) $(solib_pa64_h)
 parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \
 	$(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \
@@ -2516,10 +2516,9 @@ sol-thread.o: sol-thread.c $(defs_h) $(g
 somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
 	$(objfiles_h) $(buildsym_h) $(stabsread_h) $(gdb_stabs_h) \
 	$(complaints_h) $(gdb_string_h) $(demangle_h) $(som_h) $(libhppa_h)
-somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \
-	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
-	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h) $(gdb_assert_h) $(exec_h) $(hppa_tdep_h)
+solib-som.o: solib-som.c $(defs_h) $(som_h) $(symtab_h) $(bfd_h) $(symfile_h) \
+	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(hppa_tdep_h) \
+	$(solist_h)
 source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
 	$(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \
 	$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.32
diff -u -p -r1.32 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c	10 Dec 2004 15:48:21 -0000	1.32
+++ hppa-hpux-tdep.c	13 Dec 2004 03:53:41 -0000
@@ -31,6 +31,9 @@
 #include "inferior.h"
 #include "infcall.h"
 #include "observer.h"
+#include "hppa-tdep.h"
+#include "solib-som.h"
+#include "solib-pa64.h"
 #include "regset.h"
 
 #include "gdb_string.h"
@@ -38,8 +41,6 @@
 #include <dl.h>
 #include <machine/save_state.h>
 
-#include "hppa-tdep.h"
-
 #ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
 #endif
@@ -1690,6 +1691,7 @@ hppa_hpux_som_init_abi (struct gdbarch_i
 
   tdep->find_global_pointer = hppa_hpux_som_find_global_pointer;
   hppa_hpux_init_abi (info, gdbarch);
+  som_solib_select (tdep);
 }
 
 static void
@@ -1699,6 +1701,7 @@ hppa_hpux_elf_init_abi (struct gdbarch_i
 
   tdep->is_elf = 1;
   hppa_hpux_init_abi (info, gdbarch);
+  pa64_solib_select (tdep);
 }
 
 static enum gdb_osabi
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.190
diff -u -p -r1.190 hppa-tdep.c
--- hppa-tdep.c	12 Dec 2004 16:26:17 -0000	1.190
+++ hppa-tdep.c	13 Dec 2004 03:53:41 -0000
@@ -338,6 +338,10 @@ internalize_unwinds (struct objfile *obj
 
 	  text_offset = low_text_segment_address;
 	}
+      else if (gdbarch_tdep (current_gdbarch)->solib_get_text_base)
+        {
+	  text_offset = gdbarch_tdep (current_gdbarch)->solib_get_text_base (objfile);
+	}
 
       bfd_get_section_contents (objfile->obfd, section, buf, 0, size);
 
Index: hppa-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.h,v
retrieving revision 1.16
diff -u -p -r1.16 hppa-tdep.h
--- hppa-tdep.h	8 Dec 2004 01:48:03 -0000	1.16
+++ hppa-tdep.h	13 Dec 2004 03:53:41 -0000
@@ -22,6 +22,8 @@
 #define HPPA_TDEP_H
 
 struct trad_frame_saved_reg;
+struct objfile;
+struct so_list;
 
 /* Register numbers of various important registers.
    Note that some of these values are "real" register numbers,
@@ -97,6 +99,12 @@ struct gdbarch_tdep
   void (*unwind_adjust_stub) (struct frame_info *next_frame, CORE_ADDR base,
   			      struct trad_frame_saved_reg *saved_regs);
 
+  /* These are solib-dependent methods.  They are really HPUX only, but
+     we don't have a HPUX-specific tdep vector at the moment.  */
+  CORE_ADDR (*solib_thread_start_addr) (struct so_list *so);
+  CORE_ADDR (*solib_get_got_by_pc) (CORE_ADDR addr);
+  CORE_ADDR (*solib_get_solib_by_pc) (CORE_ADDR addr);
+  CORE_ADDR (*solib_get_text_base) (struct objfile *objfile);
 };
 
 /*
Index: hpread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpread.c,v
retrieving revision 1.54
diff -u -p -r1.54 hpread.c
--- hpread.c	13 Nov 2004 02:19:03 -0000	1.54
+++ hpread.c	13 Dec 2004 03:53:42 -0000
@@ -35,7 +35,7 @@
 #include "gdb-stabs.h"
 #include "gdbtypes.h"
 #include "demangle.h"
-#include "somsolib.h"
+#include "solib-som.h"
 #include "gdb_assert.h"
 #include "hppa-tdep.h"
 
@@ -5779,14 +5779,8 @@ hpread_process_one_debug_symbol (union d
 	       * where to look for this variable, using a call-back
 	       * to interpret the private shared-library data.
 	       */
-	      if (bfd_get_flavour(objfile->obfd) == bfd_target_som_flavour)
-	        SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
-		  som_solib_thread_start_addr (so);
-#ifndef PA_SOM_ONLY
-	      else
-	        SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
-		  pa64_solib_thread_start_addr (so);
-#endif
+	      SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
+	        gdbarch_tdep (current_gdbarch)->solib_thread_start_addr (so);
 	    }
 	}
       break;
Index: config/pa/hppa64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppa64.mt,v
retrieving revision 1.5
diff -u -p -r1.5 hppa64.mt
--- config/pa/hppa64.mt	13 Nov 2004 02:19:03 -0000	1.5
+++ config/pa/hppa64.mt	13 Dec 2004 03:53:42 -0000
@@ -1,3 +1,3 @@
 # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
-TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o pa64solib.o somsolib.o somread.o hpread.o solib.o
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o solib-som.o solib-pa64.o somread.o hpread.o solib.o
 DEPRECATED_TM_FILE= tm-hppa64.h
Index: config/pa/hppahpux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppahpux.mt,v
retrieving revision 1.6
diff -u -p -r1.6 hppahpux.mt
--- config/pa/hppahpux.mt	10 Dec 2004 09:42:10 -0000	1.6
+++ config/pa/hppahpux.mt	13 Dec 2004 03:53:42 -0000
@@ -1,4 +1,4 @@
 # Target: HP PA-RISC running hpux
 MT_CFLAGS = -DPA_SOM_ONLY=1
-TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o corelow.o somread.o hpread.o somsolib.o
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o corelow.o somread.o hpread.o solib-som.o solib-pa64.o solib.o
 DEPRECATED_TM_FILE= tm-hppah.h
Index: config/pa/hpux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux.mh,v
retrieving revision 1.2
diff -u -p -r1.2 hpux.mh
--- config/pa/hpux.mh	23 Nov 2004 21:14:33 -0000	1.2
+++ config/pa/hpux.mh	13 Dec 2004 03:53:42 -0000
@@ -1,3 +1,3 @@
 # Host: PA-RISC HP-UX
 NATDEPFILES= fork-child.o inf-ptrace.o inf-ttrace.o \
-	hppa-hpux-nat.o hpread.o somread.o somsolib.o
+	hppa-hpux-nat.o
Index: config/pa/tm-hppah.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppah.h,v
retrieving revision 1.14
diff -u -p -r1.14 tm-hppah.h
--- config/pa/tm-hppah.h	12 Nov 2004 18:38:34 -0000	1.14
+++ config/pa/tm-hppah.h	13 Dec 2004 03:53:42 -0000
@@ -24,17 +24,7 @@
 
 struct frame_info;
 
-/* The solib hooks are not really designed to have a list of hook
-   and handler routines.  So until we clean up those interfaces you
-   either get SOM shared libraries or HP's unusual PA64 ELF shared
-   libraries, but not both.  */
-#ifdef GDB_TARGET_IS_HPPA_20W
-#include "pa64solib.h"
-#endif
-
-#ifndef GDB_TARGET_IS_HPPA_20W
-#include "somsolib.h"
-#endif
+#include "solib.h"		/* Support for shared libraries. */
 
 /* For HP-UX on PA-RISC we have an implementation
    for the exception handling target op (in hppa-tdep.c) */
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


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