Re: Patch for gdb build on hppa hp-ux

Daniel Jacobowitz
2007-04-09T02:13:53Z

On Fri, Apr 06, 2007 at 02:53:09PM -0700, Steve Ellcey wrote:
> This patch fixes a build problem on hppa hp-ux. This is the first of
> two patches I have that allow me to build gdb on hppa hp-ux. The build
> has been broken (for me at least) for some time. This is the only HP
> specific change that was needed. Tested by building gdb on hppa hp-ux.

Since you can build on HP/UX, could you test this patch for me? It
removes support for HP aCC, both the custom C++ ABI (which has fingers
in a lot of other places too, but this is a start) and the custom
debug format. It should not affect the testsuite when using gcc with
SOM.

Thanks in advance!

--
Daniel Jacobowitz
CodeSourcery

2007-04-08 Daniel Jacobowitz <dan@codesourcery.com>

* Makefile.in (SFILES): Remove hpacc-abi.c.
(COMMON_OBS): Remove hpacc-abi.o.
(ALLDEPFILES): Remove hpread.c and $(HPREAD_SOURCE).
(hpacc-abi.o, hpread.o): Delete rules.
* somread.c: Delete extern declarations from hpread.c.
(som_symfile_read): Do not call do_pxdb or hpread_build_psymtabs.
(som_symfile_finish): Do not call hpread_symfile_finish.
(som_symfile_init): Do not call hpread_symfile_init.
* config/pa/hppa64.mt (TDEPFILES): Remove hpread.o.
* config/pa/hppahpux.mt (TDEPFILES): Likewise.
* hpacc-abi.c, hpread.c: Deleted.

* gdbint.texinfo (SOM): Correct location of the SOM reader.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.890
diff -u -p -r1.890 Makefile.in
--- Makefile.in 30 Mar 2007 22:50:32 -0000 1.890
+++ Makefile.in 9 Apr 2007 02:09:23 -0000
@@ -538,7 +538,6 @@ SFILES = ada-exp.y ada-lang.c ada-typepr
frame-base.c \
frame-unwind.c \
gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
- hpacc-abi.c \
inf-loop.c \
infcall.c \
infcmd.c inflow.c infrun.c \
@@ -971,7 +970,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $
user-regs.o \
frame.o frame-unwind.o doublest.o \
frame-base.o \
- gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
+ gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o \
cp-namespace.o \
reggroups.o regset.o \
trad-frame.o \
@@ -1456,7 +1455,6 @@ ALLDEPFILES = \
hppa-tdep.c hppa-hpux-tdep.c hppa-hpux-nat.c \
hppa-linux-tdep.c hppa-linux-nat.c \
hppabsd-nat.c hppabsd-tdep.c \
- hpread.c \
i386-tdep.c i386-linux-nat.c \
i386v4-nat.c i386-cygwin-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \
@@ -1485,7 +1483,7 @@ ALLDEPFILES = \
mips64obsd-nat.c mips64obsd-tdep.c \
nbsd-nat.c nbsd-tdep.c obsd-tdep.c \
solib-osf.c \
- somread.c solib-som.c $(HPREAD_SOURCE) \
+ somread.c solib-som.c \
posix-hdep.c \
ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
ppcnbsd-nat.c ppcnbsd-tdep.c \
@@ -2067,8 +2065,6 @@ go32-nat.o: go32-nat.c $(defs_h) $(infer
h8300-tdep.o: h8300-tdep.c $(defs_h) $(value_h) $(arch_utils_h) $(regcache_h) \
$(gdbcore_h) $(objfiles_h) $(gdb_assert_h) $(dis_asm_h) \
$(dwarf2_frame_h) $(frame_base_h) $(frame_unwind_h)
-hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
- $(gdbtypes_h) $(gdbcore_h) $(cp_abi_h) $(gnu_v2_abi_h)
hppabsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(target_h) $(hppa_tdep_h) $(inf_ptrace_h)
hppabsd-tdep.o: hppabsd-tdep.c $(defs_h) $(arch_utils_h) $(symtab_h) \
@@ -2095,10 +2091,6 @@ hppa-tdep.o: hppa-tdep.c $(defs_h) $(bfd
$(symtab_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \
$(frame_base_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) \
$(hppa_tdep_h) $(gdbtypes_h)
-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) \
- $(solib_som_h) $(gdb_assert_h) $(hppa_tdep_h) $(gdb_string_h)
hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) \
$(hppa_tdep_h)
Index: somread.c
===================================================================
RCS file: /cvs/src/src/gdb/somread.c,v
retrieving revision 1.32
diff -u -p -r1.32 somread.c
--- somread.c 9 Jan 2007 17:58:58 -0000 1.32
+++ somread.c 9 Apr 2007 02:09:23 -0000
@@ -40,16 +40,6 @@
/* Prototypes for local functions. */
static int init_import_symbols (struct objfile *objfile);

-/* FIXME: These should really be in a common header somewhere */
-
-extern void hpread_build_psymtabs (struct objfile *, int);
-
-extern void hpread_symfile_finish (struct objfile *);
-
-extern void hpread_symfile_init (struct objfile *);
-
-extern void do_pxdb (bfd *);
-
/*

LOCAL FUNCTION
@@ -327,8 +317,6 @@ som_symfile_read (struct objfile *objfil
bfd *abfd = objfile->obfd;
struct cleanup *back_to;

- do_pxdb (symfile_bfd_open (objfile->name));
-
init_minimal_symbol_collection ();
back_to = make_cleanup_discard_minimal_symbols ();

@@ -363,12 +351,6 @@ som_symfile_read (struct objfile *objfil
This is emitted by gcc. */
stabsect_build_psymtabs (objfile, mainline,
"$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
-
- /* Now read the native debug information.
- This builds the psymtab. This used to be done via a scan of
- the DNTT, but is now done via the PXDB-built quick-lookup tables
- together with a scan of the GNTT. See hp-psymtab-read.c. */
- hpread_build_psymtabs (objfile, mainline);
}

/* Initialize anything that needs initializing when a completely new symbol
@@ -396,7 +378,6 @@ som_symfile_finish (struct objfile *objf
{
xfree (objfile->deprecated_sym_stab_info);
}
- hpread_symfile_finish (objfile);
}

/* SOM specific initialization routine for reading symbols. */
@@ -408,7 +389,6 @@ som_symfile_init (struct objfile *objfil
find this causes a significant slowdown in gdb then we could
set it in the debug symbol readers only when necessary. */
objfile->flags |= OBJF_REORDERED;
- hpread_symfile_init (objfile);
}

/* SOM specific parsing routine for section offsets.
Index: config/pa/hppa64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppa64.mt,v
retrieving revision 1.8
diff -u -p -r1.8 hppa64.mt
--- config/pa/hppa64.mt 26 Mar 2006 08:18:17 -0000 1.8
+++ config/pa/hppa64.mt 9 Apr 2007 02:09:23 -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 solib-som.o solib-pa64.o somread.o hpread.o solib.o
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o solib-som.o solib-pa64.o somread.o solib.o
DEPRECATED_TM_FILE= tm-hppah.h
Index: config/pa/hppahpux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppahpux.mt,v
retrieving revision 1.7
diff -u -p -r1.7 hppahpux.mt
--- config/pa/hppahpux.mt 13 Dec 2004 04:06:16 -0000 1.7
+++ config/pa/hppahpux.mt 9 Apr 2007 02:09:23 -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 solib-som.o solib-pa64.o solib.o
+TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o corelow.o somread.o solib-som.o solib-pa64.o solib.o
DEPRECATED_TM_FILE= tm-hppah.h
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.257
diff -u -p -r1.257 gdbint.texinfo
--- doc/gdbint.texinfo 30 Mar 2007 17:21:48 -0000 1.257
+++ doc/gdbint.texinfo 9 Apr 2007 02:09:24 -0000
@@ -2112,7 +2112,7 @@ The basic ELF reader is in @file{elfread
SOM is HP's object file and debug format (not to be confused with IBM's
SOM, which is a cross-language ABI).

-The SOM reader is in @file{hpread.c}.
+The SOM reader is in @file{somread.c}.

@section Debugging File Formats