aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-07-30 17:01:26 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-07-30 17:01:26 +0000
commitd3862cae596482cb87caafc0b9e6e1086b69146f (patch)
treeec5870b7734db0ebb961672881e6b266da924fca /gdb
parent775d4a40960b52a877f2dc6bc5ce181872b4a06c (diff)
downloadgdb-d3862cae596482cb87caafc0b9e6e1086b69146f.zip
gdb-d3862cae596482cb87caafc0b9e6e1086b69146f.tar.gz
gdb-d3862cae596482cb87caafc0b9e6e1086b69146f.tar.bz2
From J. Law:
* infcmd.c (read_pc): Remove PA specific code. * tm-hppa.h (TARGET_READ_PC): Define. * hppa-tdep.c (target_read_pc): New function.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/config/pa/tm-hppa.h31
-rw-r--r--gdb/hppa-tdep.c12
3 files changed, 34 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4d457a4..a8dd15f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
Fri Jul 30 08:58:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ From J. Law:
+ * infcmd.c (read_pc): Remove PA specific code.
+ * tm-hppa.h (TARGET_READ_PC): Define.
+ * hppa-tdep.c (target_read_pc): New function.
+
* symtab.c (gdb_mangle_name): Deal with it if type lacks a name.
Fri Jul 30 07:36:53 1993 Fred Fish (fnf@deneb.cygnus.com)
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index deec76d..855154c 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -44,11 +44,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* When passing a structure to a function, GCC passes the address
in a register, not the structure itself. */
-#define REG_STRUCT_HAS_ADDR(gcc_p) (1)
-
-/* Groan */
+/* FIXME: I believe this is wrong. I believe passing the address
+ depends only on the size of the argument being > 8, not on its type
+ (which is a much more sane way than the REG_STRUCT_HAS_ADDR way,
+ IMHO). Also, as far as I know it is not dependent on it being
+ passed in a register. This should be verified before changing
+ anything (in fact, printing structure arguments of
+ 2,4,6,8,12,16,and 20 bytes should all be in the test suite). */
-#define ARGS_GROW_DOWN
+#define REG_STRUCT_HAS_ADDR(gcc_p) (1)
/* Offset from address of function to start of its code.
Zero on most machines. */
@@ -77,11 +81,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
the new frame is not set up until the new function executes
some instructions. */
-#define SAVED_PC_AFTER_CALL(frame) (read_register (RP_REGNUM) & ~3)
-
-/* Address of end of stack space. Who knows. */
-
-#define STACK_END_ADDR 0x80000000
+#undef SAVED_PC_AFTER_CALL
+#define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call (frame)
/* Stack grows upward */
@@ -139,10 +140,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
"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", \
- "fp4", "fp5", "fp6", "fp7", "fp8", \
- "fp9", "fp10", "fp11", "fp12", "fp13", "fp14", "fp15", \
- "fp16", "fp17", "fp18", "fp19", "fp20", "fp21", "fp22", "fp23", \
- "fp24", "fp25", "fp26", "fp27", "fp28", "fp29", "fp30", "fp31"}
+ "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"}
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
@@ -313,7 +314,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
+ (FRAMELESS) = frameless_function_invocation(FI)
#define FRAME_SAVED_PC(FRAME) frame_saved_pc (FRAME)
@@ -563,3 +564,5 @@ struct obj_unwind_info {
};
#define OBJ_UNWIND_INFO(obj) ((struct obj_unwind_info *)obj->obj_private)
+
+#define TARGET_READ_PC() target_read_pc ()
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 3bae845..24701b1 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -840,6 +840,18 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
return dyncall_addr;
}
+/* Get the PC from %r31 if currently in a syscall. Also mask out privilege
+ bits. */
+CORE_ADDR
+target_read_pc ()
+{
+ int flags = read_register (FLAGS_REGNUM);
+
+ if (flags & 2)
+ return read_register (31) & ~0x3;
+ return read_register (PC_REGNUM) & ~0x3;
+}
+
/* return the alignment of a type in bytes. Structures have the maximum
alignment required by their fields. */