This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Some get_frame_base() instead of frame->frame
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 08 Dec 2002 20:36:07 -0500
- Subject: [commit] Some get_frame_base() instead of frame->frame
FYI,
This zaps some of the frame->frame references, replacing them with
get_frame_base().
committed,
Andrew
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.
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.57
diff -u -r1.57 blockframe.c
--- blockframe.c 9 Dec 2002 00:32:08 -0000 1.57
+++ blockframe.c 9 Dec 2002 01:29:17 -0000
@@ -701,7 +701,8 @@
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 @@
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));
}
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.100
diff -u -r1.100 breakpoint.c
--- breakpoint.c 4 Dec 2002 04:53:13 -0000 1.100
+++ breakpoint.c 9 Dec 2002 01:29:38 -0000
@@ -1704,7 +1704,7 @@
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 @@
}
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 @@
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 @@
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 @@
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);
Index: dummy-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dummy-frame.c,v
retrieving revision 1.4
diff -u -r1.4 dummy-frame.c
--- dummy-frame.c 24 Nov 2002 15:06:08 -0000 1.4
+++ dummy-frame.c 9 Dec 2002 01:29:38 -0000
@@ -106,7 +106,7 @@
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 @@
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
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.8
diff -u -r1.8 f-valprint.c
--- f-valprint.c 29 Nov 2002 19:15:14 -0000 1.8
+++ f-valprint.c 9 Dec 2002 01:29:40 -0000
@@ -74,7 +74,7 @@
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 @@
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 @@
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 @@
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 =
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.97
diff -u -r1.97 rs6000-tdep.c
--- rs6000-tdep.c 9 Dec 2002 00:32:08 -0000 1.97
+++ rs6000-tdep.c 9 Dec 2002 01:29:49 -0000
@@ -261,7 +261,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
/* 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,18 +1752,20 @@
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))
@@ -1765,7 +1773,7 @@
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;
}
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.56
diff -u -r1.56 stack.c
--- stack.c 9 Dec 2002 00:32:08 -0000 1.56
+++ stack.c 9 Dec 2002 01:29:54 -0000
@@ -688,13 +688,13 @@
(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 @@
{
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 @@
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 @@
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 @@
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;
Index: std-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/std-regs.c,v
retrieving revision 1.2
diff -u -r1.2 std-regs.c
--- std-regs.c 2 Aug 2002 20:51:21 -0000 1.2
+++ std-regs.c 9 Dec 2002 01:29:54 -0000
@@ -64,7 +64,8 @@
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 @@
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;
}
}