aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-27 17:19:58 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-27 17:19:58 +0000
commit315fd1e9b272189a546bfd6669c7a83f337ca066 (patch)
treeef9e39b7f5a74956742d69f28df52668fb84bce4
parenteb972c7f421f4b37e4f2f10890f2d0dee8a41244 (diff)
downloadgdb-315fd1e9b272189a546bfd6669c7a83f337ca066.zip
gdb-315fd1e9b272189a546bfd6669c7a83f337ca066.tar.gz
gdb-315fd1e9b272189a546bfd6669c7a83f337ca066.tar.bz2
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.
-rw-r--r--gdb/ChangeLog23
-rw-r--r--gdb/config/pa/tm-hppa.h25
-rw-r--r--gdb/config/pa/tm-hppa64.h47
-rw-r--r--gdb/hppa-hpux-tdep.c1
-rw-r--r--gdb/hppa-tdep.c83
-rw-r--r--gdb/infcall.c4
6 files changed, 130 insertions, 53 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6cc3712..921b15e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,26 @@
+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.
+
2003-07-26 Andrew Cagney <cagney@redhat.com>
* m68hc11-tdep.c (m68hc11_gdbarch_init): Set non-deprecated
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 1ec91d4..7729518 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -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 */
@@ -54,28 +57,6 @@ const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr);
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,
and correspond to the general registers of the machine,
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index a8d414e..8d19a45 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -22,6 +22,7 @@ along with this program; if not, write to the Free Software
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 @@ struct frame_info;
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 @@ extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
#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 @@ extern CORE_ADDR hppa_target_read_fp (void);
/* 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 @@ extern CORE_ADDR hppa_target_read_fp (void);
/* 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 @@ call_dummy
#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 @@ call_dummy
{ \
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) \
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index 0fb7c8f..5d26c7c 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "osabi.h"
#include "gdb_string.h"
+#include "frame.h"
/* Forward declarations. */
extern void _initialize_hppa_hpux_tdep (void);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 37aa44b..fed6cb1 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -678,6 +678,88 @@ hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
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 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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);
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 123fba0..477fc0f 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -274,8 +274,8 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
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 ())
{