aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
committerStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
commit7a292a7adf506b866905b06b3024c0fd411c4583 (patch)
tree5b208bb48269b8a82d5c3a5f19c87b45a62a22f4 /gdb/rs6000-tdep.c
parent1996fae84682e8ddd146215dd2959ad1ec924c09 (diff)
downloadgdb-7a292a7adf506b866905b06b3024c0fd411c4583.zip
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.gz
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.bz2
import gdb-19990422 snapshot
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c126
1 files changed, 59 insertions, 67 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 57f1df1..b45f62ee 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -80,7 +80,7 @@ rs6000_init_extra_frame_info (fromleaf, fi)
fi->extra_info->initial_sp = 0;
if (fi->next != (CORE_ADDR) 0
&& fi->pc < TEXT_SEGMENT_BASE)
- /* We're in get_prev_frame_info */
+ /* We're in get_prev_frame */
/* and this is a special signal frame. */
/* (fi->pc will be some low address in the kernel, */
/* to which the signal handler returns). */
@@ -684,15 +684,18 @@ pop_frame ()
if (stop_stack_dummy)
{
-#ifdef USE_GENERIC_DUMMY_FRAMES
- generic_pop_dummy_frame ();
- flush_cached_frames ();
- return;
-#else
- if (dummy_frame_count)
- pop_dummy_frame ();
- return;
-#endif
+ if (USE_GENERIC_DUMMY_FRAMES)
+ {
+ generic_pop_dummy_frame ();
+ flush_cached_frames ();
+ return;
+ }
+ else
+ {
+ if (dummy_frame_count)
+ pop_dummy_frame ();
+ return;
+ }
}
/* Make sure that all registers are valid. */
@@ -818,10 +821,11 @@ push_arguments (nargs, args, sp, struct_return, struct_addr)
CORE_ADDR saved_sp;
-#ifndef USE_GENERIC_DUMMY_FRAMES
- if ( dummy_frame_count <= 0)
- printf_unfiltered ("FATAL ERROR -push_arguments()! frame not found!!\n");
-#endif /* GENERIC_DUMMY_FRAMES */
+ if (!USE_GENERIC_DUMMY_FRAMES)
+ {
+ if (dummy_frame_count <= 0)
+ printf_unfiltered ("FATAL ERROR -push_arguments()! frame not found!!\n");
+ }
/* The first eight words of ther arguments are passed in registers. Copy
them appropriately.
@@ -899,15 +903,19 @@ both:
ran_out_of_registers_for_arguments:
-#ifdef USE_GENERIC_DUMMY_FRAMES
- saved_sp = read_sp ();
-#else
- /* location for 8 parameters are always reserved. */
- sp -= 4 * 8;
+ if (USE_GENERIC_DUMMY_FRAMES)
+ {
+ saved_sp = read_sp ();
+ }
+ else
+ {
+ /* location for 8 parameters are always reserved. */
+ sp -= 4 * 8;
+
+ /* another six words for back chain, TOC register, link register, etc. */
+ sp -= 24;
+ }
- /* another six words for back chain, TOC register, link register, etc. */
- sp -= 24;
-#endif /* GENERIC_DUMMY_FRAMES */
/* if there are more arguments, allocate space for them in
the stack, then push them starting from the ninth one. */
@@ -977,14 +985,15 @@ ran_out_of_registers_for_arguments:
/* Secure stack areas first, before doing anything else. */
write_register (SP_REGNUM, sp);
-#ifndef USE_GENERIC_DUMMY_FRAMES
-/* we want to copy 24 bytes of target's frame to dummy's frame,
- then set back chain to point to new frame. */
-
- saved_sp = dummy_frame_addr [dummy_frame_count - 1];
- read_memory (saved_sp, tmp_buffer, 24);
- write_memory (sp, tmp_buffer, 24);
-#endif /* GENERIC_DUMMY_FRAMES */
+ if (!USE_GENERIC_DUMMY_FRAMES)
+ {
+ /* we want to copy 24 bytes of target's frame to dummy's frame,
+ then set back chain to point to new frame. */
+
+ saved_sp = dummy_frame_addr [dummy_frame_count - 1];
+ read_memory (saved_sp, tmp_buffer, 24);
+ write_memory (sp, tmp_buffer, 24);
+ }
/* set back chain properly */
store_address (tmp_buffer, 4, saved_sp);
@@ -1146,10 +1155,11 @@ frame_saved_pc (fi)
if (fi->signal_handler_caller)
return read_memory_integer (fi->frame + SIG_FRAME_PC_OFFSET, 4);
-#ifdef USE_GENERIC_DUMMY_FRAMES
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy(fi->pc, fi->frame, PC_REGNUM);
-#endif /* GENERIC_DUMMY_FRAMES */
+ if (USE_GENERIC_DUMMY_FRAMES)
+ {
+ if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ return generic_read_register_dummy(fi->pc, fi->frame, PC_REGNUM);
+ }
func_start = get_pc_function_start (fi->pc);
@@ -1328,10 +1338,11 @@ rs6000_frame_chain (thisframe)
{
CORE_ADDR fp;
-#ifdef USE_GENERIC_DUMMY_FRAMES
- if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
- return thisframe->frame; /* dummy frame same as caller's frame */
-#endif /* GENERIC_DUMMY_FRAMES */
+ if (USE_GENERIC_DUMMY_FRAMES)
+ {
+ if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
+ return thisframe->frame; /* dummy frame same as caller's frame */
+ }
if (inside_entry_file (thisframe->pc) ||
thisframe->pc == entry_point_address ())
@@ -1348,17 +1359,17 @@ rs6000_frame_chain (thisframe)
else
fp = read_memory_integer ((thisframe)->frame, 4);
-#ifdef USE_GENERIC_DUMMY_FRAMES
- {
- CORE_ADDR fpp, lr;
+ if (USE_GENERIC_DUMMY_FRAMES)
+ {
+ CORE_ADDR fpp, lr;
+
+ lr = read_register (LR_REGNUM);
+ if (lr == entry_point_address ())
+ if (fp != 0 && (fpp = read_memory_integer (fp, 4)) != 0)
+ if (PC_IN_CALL_DUMMY (lr, fpp, fpp))
+ return fpp;
+ }
- lr = read_register (LR_REGNUM);
- if (lr == entry_point_address ())
- if (fp != 0 && (fpp = read_memory_integer (fp, 4)) != 0)
- if (PC_IN_CALL_DUMMY (lr, fpp, fpp))
- return fpp;
- }
-#endif /* GENERIC_DUMMY_FRAMES */
return fp;
}
@@ -1391,25 +1402,6 @@ gdb_print_insn_powerpc (memaddr, info)
}
#endif
-/* Function: get_saved_register
- Just call the generic_get_saved_register function. */
-
-#ifdef USE_GENERIC_DUMMY_FRAMES
-void
-get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
- char *raw_buffer;
- int *optimized;
- CORE_ADDR *addrp;
- struct frame_info *frame;
- int regnum;
- enum lval_type *lval;
-{
- generic_get_saved_register (raw_buffer, optimized, addrp,
- frame, regnum, lval);
-}
-#endif
-
-
/* Handling the various PowerPC/RS6000 variants. */