This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Use get_next_frame() instead of frame->next
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 08 Dec 2002 19:28:38 -0500
- Subject: [commit] Use get_next_frame() instead of frame->next
Hello,
The attached replaces a bunch of frame->next's with get_next_frame().
committing,
Andrew
2002-12-08 Andrew Cagney <ac131313@redhat.com>
* stack.c (frame_info): Use get_prev_frame.
* blockframe.c (frame_address_in_block): Ditto.
* rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto.
(rs6000_frameless_function_invocation): Ditto.
(rs6000_frame_saved_pc): Ditto.
(rs6000_frame_chain): Ditto.
* arch-utils.c (init_frame_pc_default): Ditto.
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.71
diff -u -r1.71 arch-utils.c
--- arch-utils.c 25 Nov 2002 04:47:56 -0000 1.71
+++ arch-utils.c 9 Dec 2002 00:02:04 -0000
@@ -383,9 +383,9 @@
init_frame_pc_default (int fromleaf, struct frame_info *prev)
{
if (fromleaf)
- prev->pc = SAVED_PC_AFTER_CALL (prev->next);
- else if (prev->next != NULL)
- prev->pc = FRAME_SAVED_PC (prev->next);
+ prev->pc = SAVED_PC_AFTER_CALL (get_next_frame (prev));
+ else if (get_next_frame (prev) != NULL)
+ prev->pc = FRAME_SAVED_PC (get_next_frame (prev));
else
prev->pc = read_pc ();
}
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.56
diff -u -r1.56 blockframe.c
--- blockframe.c 1 Dec 2002 19:07:14 -0000 1.56
+++ blockframe.c 9 Dec 2002 00:02:06 -0000
@@ -213,8 +213,8 @@
/* FIXME: cagney/2002-11-10: Should this instead test for
NORMAL_FRAME? A dummy frame (in fact all the abnormal frames)
save the PC value in the block. */
- if (frame->next != 0
- && get_frame_type (frame->next) != SIGTRAMP_FRAME)
+ if (get_next_frame (frame) != 0
+ && get_frame_type (get_next_frame (frame)) != SIGTRAMP_FRAME)
--pc;
return pc;
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.96
diff -u -r1.96 rs6000-tdep.c
--- rs6000-tdep.c 1 Dec 2002 19:07:15 -0000 1.96
+++ rs6000-tdep.c 9 Dec 2002 00:02:17 -0000
@@ -169,7 +169,7 @@
fi->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
fi->extra_info->initial_sp = 0;
- if (fi->next != (CORE_ADDR) 0
+ if (get_next_frame (fi) != (CORE_ADDR) 0
&& fi->pc < TEXT_SEGMENT_BASE)
/* We're in get_prev_frame */
/* and this is a special signal frame. */
@@ -1477,7 +1477,8 @@
/* Don't even think about framelessness except on the innermost frame
or if the function was interrupted by a signal. */
- if (fi->next != NULL && !(get_frame_type (fi->next) == SIGTRAMP_FRAME))
+ if (get_next_frame (fi) != NULL
+ && !(get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME))
return 0;
func_start = get_pc_function_start (fi->pc);
@@ -1526,10 +1527,11 @@
(void) skip_prologue (func_start, fi->pc, &fdata);
- if (fdata.lr_offset == 0 && fi->next != NULL)
+ if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL)
{
- if ((get_frame_type (fi->next) == SIGTRAMP_FRAME))
- return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
+ if ((get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME))
+ return read_memory_addr (get_next_frame (fi)->frame
+ + 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
@@ -1756,8 +1758,8 @@
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET,
wordsize);
- else if (thisframe->next != NULL
- && (get_frame_type (thisframe->next) == SIGTRAMP_FRAME)
+ else if (get_next_frame (thisframe) != NULL
+ && (get_frame_type (get_next_frame (thisframe)) == SIGTRAMP_FRAME)
&& FRAMELESS_FUNCTION_INVOCATION (thisframe))
/* A frameless function interrupted by a signal did not change the
frame pointer. */
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.55
diff -u -r1.55 stack.c
--- stack.c 29 Nov 2002 19:15:15 -0000 1.55
+++ stack.c 9 Dec 2002 00:02:23 -0000
@@ -837,15 +837,15 @@
printf_filtered (" called by frame at ");
print_address_numeric (calling_frame_info->frame, 1, gdb_stdout);
}
- if (fi->next && calling_frame_info)
+ if (get_next_frame (fi) && calling_frame_info)
puts_filtered (",");
wrap_here (" ");
- if (fi->next)
+ if (get_next_frame (fi))
{
printf_filtered (" caller of frame at ");
- print_address_numeric (fi->next->frame, 1, gdb_stdout);
+ print_address_numeric (get_next_frame (fi)->frame, 1, gdb_stdout);
}
- if (fi->next || calling_frame_info)
+ if (get_next_frame (fi) || calling_frame_info)
puts_filtered ("\n");
if (s)
printf_filtered (" source language %s.\n",