This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit, 6.0] Sync HP/UX with mainline
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 27 Jul 2003 13:21:19 -0400
- Subject: [commit, 6.0] Sync HP/UX with mainline
Hello,
This patch imports my recent HP/UX tweaks (including one I've not yet
posted ...) into the 6.0 branch. It fixes HP/UX 10.20 and 11.00 builds
(don't know if it works :-/).
committed to 6.0,
Andrew
2003-07-27 Andrew Cagney <cagney@redhat.com>
Sync HP/UX with mainline:
* config/pa/tm-hppa.h (init_frame_pc_default): Declare.
* infcall.c (legacy_push_dummy_code) [GDB_TARGET_IS_HPPA]: Update
REAL_PC and not the pointer.
* hppa-hpux-tdep.c: Include frame.h
* config/pa/tm-hppa64.h (GDB_MULTI_ARCH): Set to
GDB_MULTI_ACH_PARTIAL.
* config/pa/tm-hppa64.h (FRAME_SAVED_PC_IN_SIGTRAMP): Use
get_frame_base.
(FRAME_BASE_BEFORE_SIGTRAMP): Ditto.
(FRAME_FIND_SAVED_REGS_IN_SIGTRAMP): Ditto.
(struct value): Add opaque declaration.
(DEPRECATED_FRAME_ARGS_ADDRESS): Delete.
* config/pa/tm-hppa64.h (REGISTER_NAMES): Delete macro.
(REGISTER_NAME): Define.
(hppa64_register_name): Declare.
* config/pa/tm-hppa.h (REGISTER_NAMES): Delete macro.
* hppa-tdep.c (hppa_gdbarch_init): Set hppa_register_name.
(hppa64_register_name): New function.
(hppa_register_name): New function.
Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.7
diff -u -r1.7 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c 6 Jun 2003 00:21:42 -0000 1.7
+++ hppa-hpux-tdep.c 27 Jul 2003 17:17:55 -0000
@@ -23,6 +23,7 @@
#include "gdbcore.h"
#include "osabi.h"
#include "gdb_string.h"
+#include "frame.h"
/* Forward declarations. */
extern void _initialize_hppa_hpux_tdep (void);
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.85
diff -u -r1.85 hppa-tdep.c
--- hppa-tdep.c 19 Jun 2003 15:04:56 -0000 1.85
+++ hppa-tdep.c 27 Jul 2003 17:18:07 -0000
@@ -678,6 +678,88 @@
return breakpoint;
}
+/* Return the name of a register. */
+
+const char *
+hppa_register_name (int i)
+{
+ static char *names[] = {
+ "flags", "r1", "rp", "r3",
+ "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11",
+ "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19",
+ "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "dp",
+ "ret0", "ret1", "sp", "r31",
+ "sar", "pcoqh", "pcsqh", "pcoqt",
+ "pcsqt", "eiem", "iir", "isr",
+ "ior", "ipsw", "goto", "sr4",
+ "sr0", "sr1", "sr2", "sr3",
+ "sr5", "sr6", "sr7", "cr0",
+ "cr8", "cr9", "ccr", "cr12",
+ "cr13", "cr24", "cr25", "cr26",
+ "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",
+ "fpsr", "fpe1", "fpe2", "fpe3",
+ "fpe4", "fpe5", "fpe6", "fpe7",
+ "fr4", "fr4R", "fr5", "fr5R",
+ "fr6", "fr6R", "fr7", "fr7R",
+ "fr8", "fr8R", "fr9", "fr9R",
+ "fr10", "fr10R", "fr11", "fr11R",
+ "fr12", "fr12R", "fr13", "fr13R",
+ "fr14", "fr14R", "fr15", "fr15R",
+ "fr16", "fr16R", "fr17", "fr17R",
+ "fr18", "fr18R", "fr19", "fr19R",
+ "fr20", "fr20R", "fr21", "fr21R",
+ "fr22", "fr22R", "fr23", "fr23R",
+ "fr24", "fr24R", "fr25", "fr25R",
+ "fr26", "fr26R", "fr27", "fr27R",
+ "fr28", "fr28R", "fr29", "fr29R",
+ "fr30", "fr30R", "fr31", "fr31R"
+ };
+ if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
+ return NULL;
+ else
+ return names[i];
+}
+
+const char *
+hppa64_register_name (int i)
+{
+ static char *names[] = {
+ "flags", "r1", "rp", "r3",
+ "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11",
+ "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19",
+ "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "dp",
+ "ret0", "ret1", "sp", "r31",
+ "sar", "pcoqh", "pcsqh", "pcoqt",
+ "pcsqt", "eiem", "iir", "isr",
+ "ior", "ipsw", "goto", "sr4",
+ "sr0", "sr1", "sr2", "sr3",
+ "sr5", "sr6", "sr7", "cr0",
+ "cr8", "cr9", "ccr", "cr12",
+ "cr13", "cr24", "cr25", "cr26",
+ "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",
+ "fpsr", "fpe1", "fpe2", "fpe3",
+ "fr4", "fr5", "fr6", "fr7",
+ "fr8", "fr9", "fr10", "fr11",
+ "fr12", "fr13", "fr14", "fr15",
+ "fr16", "fr17", "fr18", "fr19",
+ "fr20", "fr21", "fr22", "fr23",
+ "fr24", "fr25", "fr26", "fr27",
+ "fr28", "fr29", "fr30", "fr31"
+ };
+ if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
+ return NULL;
+ else
+ return names[i];
+}
+
+
+
/* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c.
@@ -4943,6 +5025,7 @@
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_deprecated_register_virtual_type (gdbarch, hppa_register_virtual_type);
+ set_gdbarch_register_name (gdbarch, hppa_register_name);
set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch,
hppa_extract_return_value);
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.17
diff -u -r1.17 infcall.c
--- infcall.c 16 Jun 2003 16:47:42 -0000 1.17
+++ infcall.c 27 Jul 2003 17:18:08 -0000
@@ -274,8 +274,8 @@
with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement
(PUSH_DUMMY_BREAKPOINT?) should just do everything. */
#ifdef GDB_TARGET_IS_HPPA
- real_pc = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
+ (*real_pc) = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs,
+ args, value_type, using_gcc);
#else
if (DEPRECATED_FIX_CALL_DUMMY_P ())
{
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.53
diff -u -r1.53 tm-hppa.h
--- config/pa/tm-hppa.h 7 Jun 2003 22:38:56 -0000 1.53
+++ config/pa/tm-hppa.h 27 Jul 2003 17:18:08 -0000
@@ -35,6 +35,9 @@
#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0
#define CALL_DUMMY_LOCATION ON_STACK
#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address)
+/* Hack, get around problem with including "arch-utils.h". */
+struct frame_info;
+extern CORE_ADDR init_frame_pc_default (int fromleaf, struct frame_info *prev);
#define DEPRECATED_INIT_FRAME_PC(l,f) (init_frame_pc_default (l, f))
/* Forward declarations of some types we use in prototypes */
@@ -53,28 +56,6 @@
extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer.
- They are in rows of eight entries */
-
-#define REGISTER_NAMES \
- {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
- "r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
- "sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
- "ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
- "sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
- "cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
- "fpsr", "fpe1", "fpe2", "fpe3", "fpe4", "fpe5", "fpe6", "fpe7", \
- "fr4", "fr4R", "fr5", "fr5R", "fr6", "fr6R", "fr7", "fr7R", \
- "fr8", "fr8R", "fr9", "fr9R", "fr10", "fr10R", "fr11", "fr11R", \
- "fr12", "fr12R", "fr13", "fr13R", "fr14", "fr14R", "fr15", "fr15R", \
- "fr16", "fr16R", "fr17", "fr17R", "fr18", "fr18R", "fr19", "fr19R", \
- "fr20", "fr20R", "fr21", "fr21R", "fr22", "fr22R", "fr23", "fr23R", \
- "fr24", "fr24R", "fr25", "fr25R", "fr26", "fr26R", "fr27", "fr27R", \
- "fr28", "fr28R", "fr29", "fr29R", "fr30", "fr30R", "fr31", "fr31R"}
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
Index: config/pa/tm-hppa64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa64.h,v
retrieving revision 1.21
diff -u -r1.21 tm-hppa64.h
--- config/pa/tm-hppa64.h 9 Jun 2003 17:35:59 -0000 1.21
+++ config/pa/tm-hppa64.h 27 Jul 2003 17:18:08 -0000
@@ -22,6 +22,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
struct type;
+struct value;
struct frame_info;
/* PA 64-bit specific definitions. Override those which are in
@@ -31,9 +32,14 @@
gotten working yet. */
#define GDB_TARGET_IS_HPPA_20W
-/* FIXME: brobecker 2003-04-21: Although 32bit hppa is partially multiarched,
- the conversion for hppa64 hasn't been completed yet. */
-#define GDB_MULTI_ARCH 0
+/* NOTE: cagney/2003-07-27: Using CC='cc +DA2.0W -Ae' configure
+ hppa64-hp-hpux11.00; GDB managed to build / start / break main /
+ run with multi-arch enabled. Not sure about much else as there
+ appears to be an unrelated problem in the SOM symbol table reader
+ causing GDB to loose line number information. Since prior to this
+ switch and a other recent tweaks, 64 bit PA hadn't been building
+ for some months, this is probably the lesser of several evils. */
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
/* FIXME: brobecker 2003-05-22: All the definition from this point until
the include of pa/tm-hppah.h are extracted from tm-hppa.h and tm-hppah.h.
@@ -282,13 +288,8 @@
#endif
#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
-#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
-#endif
-
-#if !GDB_MULTI_ARCH
extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
-#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
#endif
#if !GDB_MULTI_ARCH
@@ -398,20 +399,8 @@
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer.
They are in rows of eight entries */
-#undef REGISTER_NAMES
-#define REGISTER_NAMES \
- {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
- "r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
- "sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
- "ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
- "sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
- "cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
- "fpsr", "fpe1", "fpe2", "fpe3", "fr4", "fr5", "fr6", "fr7", \
- "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \
- "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \
- "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"}
+extern const char *hppa64_register_name (int i);
+#define REGISTER_NAME hppa64_register_name
#undef FP0_REGNUM
#undef FP4_REGNUM
@@ -445,8 +434,8 @@
/* We access locals from SP. This may not work for frames which call
alloca; for those, we may need to consult unwind tables.
jimb: FIXME. */
-#undef FRAME_LOCALS_ADDRESS
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#undef DEPRECATED_FRAME_LOCALS_ADDRESS
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
/* For a number of horrible reasons we may have to adjust the location
of variables on the stack. Ugh. jimb: why? */
@@ -613,13 +602,13 @@
#undef FRAME_SAVED_PC_IN_SIGTRAMP
#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
{ \
- *(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (33 * 8), 8); \
+ *(TMP) = read_memory_integer (get_frame_base (FRAME) + (24 * 4) + 640 + (33 * 8), 8); \
}
#undef FRAME_BASE_BEFORE_SIGTRAMP
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
{ \
- *(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (30 * 8), 8); \
+ *(TMP) = read_memory_integer (get_frame_base (FRAME) + (24 * 4) + 640 + (30 * 8), 8); \
}
#undef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
@@ -627,8 +616,8 @@
{ \
int i; \
CORE_ADDR TMP1, TMP2; \
- TMP1 = (FRAME)->frame + (24 * 4) + 640; \
- TMP2 = (FRAME)->frame + (24 * 4) + 256; \
+ TMP1 = get_frame_base (FRAME) + (24 * 4) + 640; \
+ TMP2 = get_frame_base (FRAME) + (24 * 4) + 256; \
for (i = 0; i < NUM_REGS; i++) \
{ \
if (i == SP_REGNUM) \