* [commit] Don't directly modify frame->frame
@ 2003-01-07 16:30 Andrew Cagney
2003-01-07 16:39 ` Andrew Cagney
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2003-01-07 16:30 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
Hello,
The attached replaces several more cases of `frame->frame = ...' with
the method deprecated_update_frame_base_hack().
There are two cases where this occures:
- code that failed to correcctly compute frame_chain() (and is fixing it
up after the event (via init frame extra info)).
- code that is using a scratch frame (rather than refactor the code to
use methods that apply to the frame's sub fields).
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 5682 bytes --]
2003-01-07 Andrew Cagney <cagney@redhat.com>
* arm-tdep.c (arm_init_extra_frame_info): Use
deprecated_update_frame_base_hack.
* xstormy16-tdep.c (xstormy16_scan_prologue): Ditto.
* mn10300-tdep.c (analyze_dummy_frame): Ditto.
(fix_frame_pointer): Ditto.
(mn10300_analyze_prologue): Ditto.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.92
diff -u -r1.92 arm-tdep.c
--- arm-tdep.c 7 Jan 2003 14:51:10 -0000 1.92
+++ arm-tdep.c 7 Jan 2003 16:19:58 -0000
@@ -1131,9 +1131,7 @@
/* FIXME: What about thumb mode? */
fi->extra_info->framereg = ARM_SP_REGNUM;
- fi->frame =
- read_memory_integer (get_frame_saved_regs (fi)[fi->extra_info->framereg],
- REGISTER_RAW_SIZE (fi->extra_info->framereg));
+ deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (fi)[fi->extra_info->framereg], REGISTER_RAW_SIZE (fi->extra_info->framereg)));
fi->extra_info->framesize = 0;
fi->extra_info->frameoffset = 0;
@@ -1144,23 +1142,22 @@
if (!fi->next)
/* This is the innermost frame? */
- fi->frame = read_register (fi->extra_info->framereg);
+ deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg));
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
/* Next inner most frame is a dummy, just grab its frame.
Dummy frames always have the same FP as their caller. */
- fi->frame = fi->next->frame;
+ deprecated_update_frame_base_hack (fi, fi->next->frame);
else if (fi->extra_info->framereg == ARM_FP_REGNUM
|| fi->extra_info->framereg == THUMB_FP_REGNUM)
{
/* not the innermost frame */
/* If we have an FP, the callee saved it. */
if (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg] != 0)
- fi->frame =
- read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg], 4);
+ deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg], 4));
else if (fromleaf)
/* If we were called by a frameless fn. then our frame is
still in the frame pointer register on the board... */
- fi->frame = read_fp ();
+ deprecated_update_frame_base_hack (fi, read_fp ());
}
/* Calculate actual addresses of saved registers using offsets
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.51
diff -u -r1.51 frame.c
--- frame.c 6 Jan 2003 21:50:25 -0000 1.51
+++ frame.c 7 Jan 2003 16:19:59 -0000
@@ -1,3 +1,4 @@
+#define FRAME_C
/* Cache and manage frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.46
diff -u -r1.46 mn10300-tdep.c
--- mn10300-tdep.c 7 Jan 2003 14:51:10 -0000 1.46
+++ mn10300-tdep.c 7 Jan 2003 16:19:59 -0000
@@ -162,7 +162,7 @@
dummy->next = NULL;
dummy->prev = NULL;
deprecated_update_frame_pc_hack (dummy, pc);
- dummy->frame = frame;
+ deprecated_update_frame_base_hack (dummy, frame);
dummy->extra_info->status = 0;
dummy->extra_info->stack_size = 0;
memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
@@ -210,9 +210,9 @@
if (fi && fi->next == NULL)
{
if (fi->extra_info->status & MY_FRAME_IN_SP)
- fi->frame = read_sp () - stack_size;
+ deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
else if (fi->extra_info->status & MY_FRAME_IN_FP)
- fi->frame = read_register (A3_REGNUM);
+ deprecated_update_frame_base_hack (fi, read_register (A3_REGNUM));
}
}
@@ -437,7 +437,7 @@
if (fi && buf[0] == 0xf0 && buf[1] == 0xfc)
{
if (fi->next == NULL)
- fi->frame = read_sp ();
+ deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
@@ -446,7 +446,7 @@
if (fi && get_frame_pc (fi) == func_addr)
{
if (fi->next == NULL)
- fi->frame = read_sp ();
+ deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
@@ -495,7 +495,7 @@
{
/* Fix fi->frame since it's bogus at this point. */
if (fi && fi->next == NULL)
- fi->frame = read_sp ();
+ deprecated_update_frame_base_hack (fi, read_sp ());
/* Note if/where callee saved registers were saved. */
set_movm_offsets (fi, movm_args);
@@ -508,7 +508,7 @@
{
/* Fix fi->frame since it's bogus at this point. */
if (fi && fi->next == NULL)
- fi->frame = read_sp ();
+ deprecated_update_frame_base_hack (fi, read_sp ());
/* Note if/where callee saved registers were saved. */
set_movm_offsets (fi, movm_args);
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.19
diff -u -r1.19 xstormy16-tdep.c
--- xstormy16-tdep.c 7 Jan 2003 14:51:11 -0000 1.19
+++ xstormy16-tdep.c 7 Jan 2003 16:20:00 -0000
@@ -594,12 +594,12 @@
if (fi->extra_info->frameless_p)
{
get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - fi->extra_info->framesize;
- fi->frame = sp;
+ deprecated_update_frame_base_hack (fi, sp);
}
else
{
get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - fi->extra_info->framesize;
- fi->frame = fp;
+ deprecated_update_frame_base_hack (fi, fp);
}
/* So far only offsets to the beginning of the frame are
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [commit] Don't directly modify frame->frame
2003-01-07 16:30 [commit] Don't directly modify frame->frame Andrew Cagney
@ 2003-01-07 16:39 ` Andrew Cagney
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-01-07 16:39 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Oops,
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.51
diff -u -r1.51 frame.c
--- frame.c 6 Jan 2003 21:50:25 -0000 1.51
+++ frame.c 7 Jan 2003 16:19:59 -0000
@@ -1,3 +1,4 @@
+#define FRAME_C
/* Cache and manage frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
Lets just pretend no one saw this bit, m'kay ;-)
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-07 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 16:30 [commit] Don't directly modify frame->frame Andrew Cagney
2003-01-07 16:39 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox