[RFA/commit] Add new file hppa-hpux-tdep.c

Joel Brobecker
2002-12-13T17:59:05Z

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

I am adding a new file, were all the hpux-specific stuff should go.

I am treating this as a semi-RFA, despite the multiarch rule, because:
- Despite Andrew's recommendation to name the files pa-* to follow
the name of the directory where the config files are stored, I
kept hppa because it's what is used in the configuration triplet.
If I had to change anything, I'd prefer to change the name of the
directory...
- There is also this fnchange.lst file, which I don't understand
completely. The documentation says I should add a new line for
each file that does not respect the 8.3 format. But it does not
say what should be there. I thought it should be @V.../longname
followed by @V.../8+3name. But I saw many exceptions, and many
entries missing. So I'm not sure what I should do for this patch.
Eli?

I am not sure if I'll be able to put all the code for pa & pa64 hpux
in the same file. At the present time, I know I won't, because it
would not compile. But I think this can be achieved by doing a bit
or rewriting (don't know how yet, though). So I'm simply adding this
one tdep file for now.

2002-12-12 Joel Brobecker <brobecker@gnat.com>

* hppa-hpux-tdep.c: New file.
* hppa-tdep.c (hppa_gdbarch_init): call the registered osabi-
specific initialization routines.
* Makefile.in (ALLDEPFILES): Add hppa-hpux-tdep.c.
(hppa-hpux-tdep.o): Add rule.
* config/pa/hppahpux.mt (TDEPFILES): Add hppa-hpux-tdep.o.
* config/pa/hppa64.mt (TDEPFILES): Likewise.

Comments are more than welcome. I will commit this on monday if I
receive no objections.

--
Joel

(BTW: I haven't been doing much work on this for a while, because I am
currently traveling, but it should be better by the end of next week,
will stay put for at least 6 weeks :).

[-- Attachment #2: hppa-hpux-tdep.c --]
[-- Type: text/plain, Size: 1470 bytes --]

/* Target-dependent code for HPUX running on PA-RISC, for GDB.
Copyright 2002 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 2 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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

#include "defs.h"
#include "arch-utils.h"
#include "osabi.h"

/* Forward declarations. */
extern void _initialize_hppa_hpux_tdep (void);
extern initialize_file_ftype _initialize_hppa_hpux_tdep;

static void
hppa_hpux_som_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
}

static void
hppa_hpux_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
}

void
_initialize_hppa_hpux_tdep (void)
{
gdbarch_register_osabi (bfd_arch_hppa, GDB_OSABI_HPUX_SOM,
hppa_hpux_som_init_abi);
gdbarch_register_osabi (bfd_arch_hppa, GDB_OSABI_HPUX_ELF,
hppa_hpux_elf_init_abi);
}

[-- Attachment #3: hppa-hpux-tdep.diff --]
[-- Type: text/plain, Size: 3442 bytes --]

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.40
diff -c -3 -p -r1.40 hppa-tdep.c
*** hppa-tdep.c 13 Dec 2002 14:37:41 -0000 1.40
--- hppa-tdep.c 13 Dec 2002 15:39:55 -0000
*************** hppa_gdbarch_init (struct gdbarch_info i
*** 4920,4925 ****
--- 4920,4928 ----
/* If none found, then allocate and initialize one. */
gdbarch = gdbarch_alloc (&info, NULL);

+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch, osabi);
+
return gdbarch;
}

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.294
diff -c -3 -p -r1.294 Makefile.in
*** Makefile.in 9 Dec 2002 01:28:10 -0000 1.294
--- Makefile.in 13 Dec 2002 15:39:24 -0000
*************** ALLDEPFILES = a68v-nat.c \
*** 1377,1383 ****
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \
go32-nat.c h8300-tdep.c h8500-tdep.c \
! hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c hpread.c \
i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \
i386v4-nat.c i386ly-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \
--- 1377,1384 ----
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \
go32-nat.c h8300-tdep.c h8500-tdep.c \
! hp300ux-nat.c hppa-tdep.c hppa-hpux-tdep.c \
! hppab-nat.c hppah-nat.c hpread.c \
i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \
i386v4-nat.c i386ly-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \
*************** hppa-tdep.o: hppa-tdep.c $(defs_h) $(fra
*** 1759,1764 ****
--- 1760,1766 ----
$(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \
$(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \
$(symfile_h) $(objfiles_h) $(language_h) $(osabi_h)
+ hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h)
hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(gdb_wait_h) $(regcache_h)
Index: config/pa/hppa64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppa64.mt,v
retrieving revision 1.1.1.2
diff -c -3 -p -r1.1.1.2 hppa64.mt
*** config/pa/hppa64.mt 23 Aug 1999 22:37:06 -0000 1.1.1.2
--- config/pa/hppa64.mt 13 Dec 2002 15:40:42 -0000
***************
*** 1,4 ****
# Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
! TDEPFILES= hppa-tdep.o
TM_FILE= tm-hppa64.h
TM_CLIBS=
--- 1,4 ----
# Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
! TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o
TM_FILE= tm-hppa64.h
TM_CLIBS=
Index: config/pa/hppahpux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hppahpux.mt,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 hppahpux.mt
*** config/pa/hppahpux.mt 16 Apr 1999 01:34:24 -0000 1.1.1.1
--- config/pa/hppahpux.mt 13 Dec 2002 15:40:42 -0000
***************
*** 1,3 ****
# Target: HP PA-RISC running hpux
! TDEPFILES= hppa-tdep.o
TM_FILE= tm-hppah.h
--- 1,3 ----
# Target: HP PA-RISC running hpux
! TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o
TM_FILE= tm-hppah.h