aboutsummaryrefslogtreecommitdiff
path: root/gdb/tm-rs6000.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1992-11-17 21:46:17 +0000
committerIan Lance Taylor <ian@airs.com>1992-11-17 21:46:17 +0000
commitcdb1cc92142acf359b07ba3e3302d51da162af31 (patch)
treedb10a169ae362c1a730dbde7b3c09a1c7ebec6be /gdb/tm-rs6000.h
parent070ee184f7990efe6cc7e34f283458b093911ba1 (diff)
downloadgdb-cdb1cc92142acf359b07ba3e3302d51da162af31.zip
gdb-cdb1cc92142acf359b07ba3e3302d51da162af31.tar.gz
gdb-cdb1cc92142acf359b07ba3e3302d51da162af31.tar.bz2
Tue Nov 17 11:17:06 1992 Ian Lance Taylor (ian@cygnus.com)
* tm-rs6000.h (BELIEVE_PCC_PROMOTION): Define, since AIX cc gets it right. (aix_framedata): added nosavedpc field. (SAVED_PC_AFTER_CALL): Don't try to optimize; just call read_register. (FRAMELESS_FUNCTION_INVOCATION): Pass second argument of 0. (FRAME_SAVED_PC): If PC not saved, use SAVED_PC_AFTER_CALL. * rs6000-tdep.c (skip_prologue): Handle gcc generated stfd instructions as function_frame_info does. Expand special case of st r31,-4(r1) to be st r31,NUM(r1), since gcc can generate offsets other than -4. (pop_frame): Add 4 rather than sizeof (int) to avoid host dependence. (function_frame_info): Set frameless if the function has no frame, and set nosavedpc if the PC was not saved. Handle gcc generated stfd 31,-4(31); st 31, -12(31) correctly. (frameless_function_invocation): New second argument pcsaved; if 0 return whether the function has a frame, if 1 return whether the function saved PC. (frame_initial_stack_address): Correct typo: cache registers for callee_fi, not for fi, (avoids reading garbage memory locations).
Diffstat (limited to 'gdb/tm-rs6000.h')
-rw-r--r--gdb/tm-rs6000.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/gdb/tm-rs6000.h b/gdb/tm-rs6000.h
index 1b0ffde..5dff65c 100644
--- a/gdb/tm-rs6000.h
+++ b/gdb/tm-rs6000.h
@@ -36,6 +36,9 @@ extern int symtab_relocated;
#define PC_LOAD_SEGMENT(PC) pc_load_segment_name(PC)
+/* AIX cc seems to get this right. */
+
+#define BELIEVE_PCC_PROMOTION 1
/* Conversion between a register number in stab string to actual register num. */
@@ -82,6 +85,7 @@ struct aix_framedata {
int saved_fpr; /* smallest # of saved fpr */
int alloca_reg; /* alloca register number (frame ptr) */
char frameless; /* true if frameless functions. */
+ char nosavedpc; /* true if pc not saved. */
};
void
@@ -174,13 +178,7 @@ extern int loadinfotextindex;
the new frame is not set up until the new function executes
some instructions. */
-#define SAVED_PC_AFTER_CALL(frame) \
- (register_valid [LR_REGNUM] ? \
- (*(int*)&registers[REGISTER_BYTE (LR_REGNUM)]) : \
- read_register (LR_REGNUM))
-
-/*#define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call(frame) */
-
+#define SAVED_PC_AFTER_CALL(frame) read_register (LR_REGNUM)
/* Address of end of stack space. */
@@ -423,7 +421,7 @@ extern unsigned int rs6000_struct_return_address;
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- FRAMELESS = frameless_function_invocation (FI)
+ FRAMELESS = frameless_function_invocation (FI, 0)
/* Functions calling alloca() change the value of the stack pointer. We
need to use initial stack pointer (which is saved in r31 by gcc) in
@@ -436,17 +434,19 @@ extern unsigned int rs6000_struct_return_address;
CORE_ADDR initial_sp; /* initial stack pointer. */ \
struct frame_saved_regs *cache_fsr; /* saved registers */
-/* Frameless function invocation in IBM RS/6000 is half-done. It perfectly
- sets up a new frame, e.g. a new frame (in fact stack) pointer, etc, but it
- doesn't save the %pc. In the following, even though it is considered a
- frameless invocation, we still need to walk one frame up. */
+/* Frameless function invocation in IBM RS/6000 is sometimes
+ half-done. It perfectly sets up a new frame, e.g. a new frame (in
+ fact stack) pointer, etc, but it doesn't save the %pc. We call
+ frameless_function_invocation to tell us how to get the %pc. */
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
fi->initial_sp = 0; \
fi->cache_fsr = 0;
-#define FRAME_SAVED_PC(FRAME) \
- read_memory_integer (read_memory_integer ((FRAME)->frame, 4)+8, 4)
+#define FRAME_SAVED_PC(FRAME) \
+ (frameless_function_invocation (FRAME, 1) \
+ ? SAVED_PC_AFTER_CALL (FRAME) \
+ : read_memory_integer (read_memory_integer ((FRAME)->frame, 4)+8, 4))
#define FRAME_ARGS_ADDRESS(FI) \
(((struct frame_info*)(FI))->initial_sp ? \