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.
This commit is contained in:
Andrew Cagney 2002-12-09 01:40:25 +00:00
parent aeeccc89ca
commit 8b36eed86d
8 changed files with 57 additions and 36 deletions

View file

@ -1,3 +1,10 @@
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.

View file

@ -701,7 +701,8 @@ generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *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_entry_file (frame_pc_unwind (fi)));
}
@ -713,7 +714,8 @@ generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *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));
}

View file

@ -1704,7 +1704,7 @@ deprecated_frame_in_dummy (struct frame_info *frame)
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
@ -2728,7 +2728,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
}
if (b->frame &&
b->frame != (get_current_frame ())->frame)
b->frame != get_frame_base (get_current_frame ()))
bs->stop = 0;
else
{
@ -4318,7 +4318,7 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame)
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);
@ -4379,7 +4379,7 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame,
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
@ -5427,7 +5427,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
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);

View file

@ -106,7 +106,7 @@ struct dummy_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);
}
@ -207,7 +207,7 @@ void
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

View file

@ -74,7 +74,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
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 =
@ -98,7 +98,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *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 =
@ -132,7 +132,7 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_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 =
@ -161,7 +161,7 @@ f77_get_dynamic_upperbound (struct type *type, int *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 =

View file

@ -261,7 +261,7 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
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);
}
}
@ -958,7 +958,9 @@ rs6000_pop_frame (void)
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 ();
@ -1513,10 +1515,14 @@ rs6000_frame_saved_pc (struct frame_info *fi)
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);
@ -1530,8 +1536,8 @@ rs6000_frame_saved_pc (struct frame_info *fi)
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
@ -1708,7 +1714,7 @@ frame_initial_stack_address (struct frame_info *fi)
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;
}
@ -1726,7 +1732,7 @@ frame_initial_stack_address (struct frame_info *fi)
/* 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;
}
@ -1746,17 +1752,19 @@ rs6000_frame_chain (struct frame_info *thisframe)
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,
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)
@ -1765,7 +1773,7 @@ rs6000_frame_chain (struct frame_info *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;
}

View file

@ -688,13 +688,13 @@ parse_frame_specification (char *frame_exp)
(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
@ -797,13 +797,13 @@ frame_info (char *addr_exp, int from_tty)
{
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));
@ -835,7 +835,8 @@ frame_info (char *addr_exp, int from_tty)
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 (",");
@ -843,7 +844,8 @@ frame_info (char *addr_exp, int from_tty)
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");
@ -1750,7 +1752,7 @@ return_command (char *retval_exp, int from_tty)
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;

View file

@ -64,7 +64,8 @@ value_of_builtin_frame_reg (struct frame_info *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;
@ -83,7 +84,8 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame)
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;
}
}