From b87efeee0c8edb62a6877ed9b78198b7b66d8c04 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 13 Dec 2002 21:57:40 +0000 Subject: [PATCH] 2002-12-13 Andrew Cagney * frame.c (deprecated_update_current_frame_pc_hack): New function. * frame.h (deprecated_update_current_frame_pc_hack): Declare. * infrun.c (normal_stop): Use said function instead of directly modifying the frame's PC. --- gdb/ChangeLog | 8 ++++++++ gdb/frame.c | 11 +++++++++++ gdb/frame.h | 5 +++++ gdb/infrun.c | 8 ++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b19b238ae5..9a81acc419 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2002-12-13 Andrew Cagney + + * frame.c (deprecated_update_current_frame_pc_hack): New + function. + * frame.h (deprecated_update_current_frame_pc_hack): Declare. + * infrun.c (normal_stop): Use said function instead of directly + modifying the frame's PC. + 2002-12-13 Alexandre Oliva * frame.h (frame_id_unwind_ftype): Fix typo in return type. diff --git a/gdb/frame.c b/gdb/frame.c index b23d5175da..44e08115f1 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1290,6 +1290,17 @@ frame_extra_info_zalloc (struct frame_info *fi, long size) return fi->extra_info; } +void +deprecated_update_current_frame_pc_hack (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; +} + void _initialize_frame (void) { diff --git a/gdb/frame.h b/gdb/frame.h index 39539492c2..f54f185ac9 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -654,4 +654,9 @@ extern struct frame_extra_info *frame_extra_info_zalloc (struct frame_info *fi, long size); extern struct frame_extra_info *get_frame_extra_info (struct frame_info *fi); +/* 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); + #endif /* !defined (FRAME_H) */ diff --git a/gdb/infrun.c b/gdb/infrun.c index b1db8cbe91..664351ef77 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3066,8 +3066,12 @@ normal_stop (void) /* Make sure that the current_frame's pc is correct. This is a correction for setting up the frame info before doing DECR_PC_AFTER_BREAK */ - if (target_has_execution && get_current_frame ()) - (get_current_frame ())->pc = read_pc (); + if (target_has_execution) + /* FIXME: cagney/2002-12-06: Has the PC changed? Thanks to + 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 ()); if (target_has_execution && breakpoints_inserted) {