+2002-12-08 Andrew Cagney <ac131313@redhat.com>
+
+ * blockframe.c: Use get_frame_base instead of directly accessing
+ the `struct frame_info' member frame.
+ * f-valprint.c, std-regs.c, rs6000-tdep.c: Ditto.
+ * stack.c, dummy-frame.c, breakpoint.c: Ditto.
+
2002-12-08 Elena Zannoni <ezannoni@redhat.com>
* Makefile.in (readline_h): Define.
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
return (fp != 0
- && (INNER_THAN (fi->frame, fp) || fi->frame == fp)
+ && (INNER_THAN (get_frame_base (fi), fp)
+ || get_frame_base (fi) == fp)
&& !inside_entry_file (frame_pc_unwind (fi)));
}
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
return (fp != 0
- && (INNER_THAN (fi->frame, fp) || fi->frame == fp)
+ && (INNER_THAN (get_frame_base (fi), fp)
+ || get_frame_base (fi) == fp)
&& !inside_main_func ((fi)->pc)
&& !inside_entry_func ((fi)->pc));
}
ALL_BREAKPOINTS (b)
{
if (b->type == bp_call_dummy
- && b->frame == frame->frame
+ && b->frame == get_frame_base (frame)
/* We need to check the PC as well as the frame on the sparc,
for signals.exp in the testsuite. */
&& (frame->pc
}
if (b->frame &&
- b->frame != (get_current_frame ())->frame)
+ b->frame != get_frame_base (get_current_frame ()))
bs->stop = 0;
else
{
b->address = pc;
b->enable_state = bp_enabled;
if (frame != NULL)
- b->frame = frame->frame;
+ b->frame = get_frame_base (frame);
else
b->frame = 0;
check_duplicates (b);
b = set_raw_breakpoint (sal, type);
b->enable_state = bp_enabled;
b->disposition = disp_donttouch;
- b->frame = (frame ? frame->frame : 0);
+ b->frame = (frame ? get_frame_base (frame) : 0);
/* If we're debugging a multi-threaded program, then we
want momentary breakpoints to be active in only a
scope_breakpoint->disposition = disp_del;
/* Only break in the proper frame (help with recursion). */
- scope_breakpoint->frame = prev_frame->frame;
+ scope_breakpoint->frame = get_frame_base (prev_frame);
/* Set the address at which we will stop. */
scope_breakpoint->address = get_frame_pc (prev_frame);
cached_find_dummy_frame (struct frame_info *frame, void **cache)
{
if ((*cache) == NULL)
- (*cache) = find_dummy_frame (frame->pc, frame->frame);
+ (*cache) = find_dummy_frame (frame->pc, get_frame_base (frame));
return (*cache);
}
generic_push_dummy_frame (void)
{
struct dummy_frame *dummy_frame;
- CORE_ADDR fp = (get_current_frame ())->frame;
+ CORE_ADDR fp = get_frame_base (get_current_frame ());
/* check to see if there are stale dummy frames,
perhaps left over from when a longjump took us out of a
switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
{
case BOUND_BY_VALUE_ON_STACK:
- current_frame_addr = deprecated_selected_frame->frame;
+ current_frame_addr = get_frame_base (deprecated_selected_frame);
if (current_frame_addr > 0)
{
*lower_bound =
break;
case BOUND_BY_REF_ON_STACK:
- current_frame_addr = deprecated_selected_frame->frame;
+ current_frame_addr = get_frame_base (deprecated_selected_frame);
if (current_frame_addr > 0)
{
ptr_to_lower_bound =
switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
{
case BOUND_BY_VALUE_ON_STACK:
- current_frame_addr = deprecated_selected_frame->frame;
+ current_frame_addr = get_frame_base (deprecated_selected_frame);
if (current_frame_addr > 0)
{
*upper_bound =
break;
case BOUND_BY_REF_ON_STACK:
- current_frame_addr = deprecated_selected_frame->frame;
+ current_frame_addr = get_frame_base (deprecated_selected_frame);
if (current_frame_addr > 0)
{
ptr_to_upper_bound =
fi = get_current_frame ();
if (fi != NULL)
- dest = read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET,
+ dest = read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET,
gdbarch_tdep (current_gdbarch)->wordsize);
}
}
pc = read_pc ();
sp = get_frame_base (frame);
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc,
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
int wordsize = tdep->wordsize;
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
- return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
+ return read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET,
+ wordsize);
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc,
+ get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (fi->pc,
+ get_frame_base (fi), PC_REGNUM);
func_start = get_pc_function_start (fi->pc);
if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL)
{
if ((get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME))
- return read_memory_addr (get_next_frame (fi)->frame
- + SIG_FRAME_LR_OFFSET,
+ return read_memory_addr ((get_frame_base (get_next_frame (fi))
+ + SIG_FRAME_LR_OFFSET),
wordsize);
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
/* The link register wasn't saved by this frame and the next
if (fdata.alloca_reg < 0)
{
- fi->extra_info->initial_sp = fi->frame;
+ fi->extra_info->initial_sp = get_frame_base (fi);
return fi->extra_info->initial_sp;
}
/* NOTE: cagney/2002-04-17: At present the only time
frame_register_read will fail is when the register isn't
available. If that does happen, use the frame. */
- fi->extra_info->initial_sp = fi->frame;
+ fi->extra_info->initial_sp = get_frame_base (fi);
}
return fi->extra_info->initial_sp;
}
CORE_ADDR fp, fpp, lr;
int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
- if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc,
+ get_frame_base (thisframe),
+ get_frame_base (thisframe)))
/* A dummy frame always correctly chains back to the previous
frame. */
- return read_memory_addr ((thisframe)->frame, wordsize);
+ return read_memory_addr (get_frame_base (thisframe), wordsize);
if (inside_entry_file (thisframe->pc) ||
thisframe->pc == entry_point_address ())
return 0;
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
- fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET,
- wordsize);
+ fp = read_memory_addr (get_frame_base (thisframe) + SIG_FRAME_FP_OFFSET,
+ wordsize);
else if (get_next_frame (thisframe) != NULL
&& (get_frame_type (get_next_frame (thisframe)) == SIGTRAMP_FRAME)
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
frame pointer. */
fp = get_frame_base (thisframe);
else
- fp = read_memory_addr ((thisframe)->frame, wordsize);
+ fp = read_memory_addr (get_frame_base (thisframe), wordsize);
return fp;
}
(s)he gets. Still, give the highest one that matches. */
for (fid = get_current_frame ();
- fid && fid->frame != args[0];
+ fid && get_frame_base (fid) != args[0];
fid = get_prev_frame (fid))
;
if (fid)
while ((tfid = get_prev_frame (fid)) &&
- (tfid->frame == args[0]))
+ (get_frame_base (tfid) == args[0]))
fid = tfid;
/* We couldn't identify the frame as an existing frame, but
{
printf_filtered ("Stack level %d, frame at ",
frame_relative_level (deprecated_selected_frame));
- print_address_numeric (fi->frame, 1, gdb_stdout);
+ print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
printf_filtered (":\n");
}
else
{
printf_filtered ("Stack frame at ");
- print_address_numeric (fi->frame, 1, gdb_stdout);
+ print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
printf_filtered (":\n");
}
printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM));
if (calling_frame_info)
{
printf_filtered (" called by frame at ");
- print_address_numeric (calling_frame_info->frame, 1, gdb_stdout);
+ print_address_numeric (get_frame_base (calling_frame_info),
+ 1, gdb_stdout);
}
if (get_next_frame (fi) && calling_frame_info)
puts_filtered (",");
if (get_next_frame (fi))
{
printf_filtered (" caller of frame at ");
- print_address_numeric (get_next_frame (fi)->frame, 1, gdb_stdout);
+ print_address_numeric (get_frame_base (get_next_frame (fi)), 1,
+ gdb_stdout);
}
if (get_next_frame (fi) || calling_frame_info)
puts_filtered ("\n");
a POP_FRAME. The pc comparison makes this work even if the
selected frame shares its fp with another frame. */
- while (selected_frame_addr != (frame = get_current_frame ())->frame
+ while (selected_frame_addr != get_frame_base (frame = get_current_frame ())
|| selected_frame_pc != frame->pc)
POP_FRAME;
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
/* frame.base. */
if (frame != NULL)
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+ get_frame_base (frame));
buf += TYPE_LENGTH (builtin_type_void_data_ptr);
/* frame.XXX. */
return val;
if (frame == NULL)
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+ get_frame_base (frame));
return val;
}
}