This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Update PC and FRAME hacks.


Hello,

Came across more situtations where the target's frame code is directly
writing to the PC and/or FRAME (see avr-tdep.c and alpha-tdep.c) fields
of the frame object.

These functions are to wrap those calls.

For infrun.c, I've also updated things to use one of these newer functions.

committed,
Andrew

2002-12-18 Andrew Cagney <ac131313@redhat.com>

* frame.c (deprecated_update_current_frame_pc_hack): Replace
deprecated_update_current_frame_pc_hack.
(deprecated_update_frame_base_hack): New function.
* frame.h (deprecated_update_frame_pc_hack): Replace
(deprecated_update_frame_base_hack): Declare.
* infrun.c (normal_stop): Update.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.47
diff -u -r1.47 frame.c
--- frame.c 13 Dec 2002 23:18:56 -0000 1.47
+++ frame.c 18 Dec 2002 17:55:39 -0000
@@ -1297,14 +1297,17 @@
}

void
-deprecated_update_current_frame_pc_hack (CORE_ADDR pc)
+deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc)
{
- /* FIXME: cagney/2002-12-06: Has the PC in the current frame
- changed? "infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change
- the PC after the initial frame create. This puts things back in
- sync. */
- if (current_frame != NULL)
- current_frame->pc = pc;
+ /* See comment in "frame.h". */
+ frame->pc = pc;
+}
+
+void
+deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base)
+{
+ /* See comment in "frame.h". */
+ frame->frame = base;
}

void
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.52
diff -u -r1.52 frame.h
--- frame.h 13 Dec 2002 23:18:56 -0000 1.52
+++ frame.h 18 Dec 2002 17:55:39 -0000
@@ -663,6 +663,15 @@
/* FIXME: cagney/2002-12-06: Has the PC in the current frame changed?
"infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after
the initial frame create. This puts things back in sync. */
-extern void deprecated_update_current_frame_pc_hack (CORE_ADDR pc);
+extern void deprecated_update_frame_pc_hack (struct frame_info *frame,
+ CORE_ADDR pc);
+
+/* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be
+ more exact, whas that initial guess at the frame's base as returned
+ by read_fp() wrong. If it was, fix it. This shouldn't be
+ necessary since the code should be getting the frame's base correct
+ from the outset. */
+extern void deprecated_update_frame_base_hack (struct frame_info *frame,
+ CORE_ADDR base);

#endif /* !defined (FRAME_H) */
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.91
diff -u -r1.91 infrun.c
--- infrun.c 15 Dec 2002 20:38:52 -0000 1.91
+++ infrun.c 18 Dec 2002 17:55:39 -0000
@@ -2985,7 +2985,7 @@
DECR_PC_AFTER_BREAK, the program counter can change. Ask the
frame code to check for this and sort out any resultant mess.
DECR_PC_AFTER_BREAK needs to just go away. */
- deprecated_update_current_frame_pc_hack (read_pc ());
+ deprecated_update_frame_pc_hack (get_current_frame (), read_pc ());

if (target_has_execution && breakpoints_inserted)
{



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]