diff options
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/target.c | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1dc6356..f259763 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-02-27 Philippe Waroquiers <philippe.waroquiers@skynet.be> + + * target.c (target_detach): Clear the regcache and the + frame cache. + 2019-02-27 Pedro Alves <palves@redhat.com> * utils.c (set_screen_size): When we cap the height/width sizes, @@ -35,7 +40,7 @@ Python 2.4 workaround. 2019-02-27 Kevin Buettner <kevinb@redhat.com> - + * NEWS: Note minimum Python version. 2019-02-27 Kevin Buettner <kevinb@redhat.com> diff --git a/gdb/target.c b/gdb/target.c index 116510e..d5ff932 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2029,6 +2029,17 @@ target_detach (inferior *inf, int from_tty) prepare_for_detach (); current_top_target ()->detach (inf, from_tty); + + /* After we have detached, clear the register cache for this inferior. */ + ptid_t pid_ptid = ptid_t (inf->pid); + + registers_changed_ptid (pid_ptid); + + /* We have to ensure we have no frame cache left. Normally, + registers_changed_ptid (pid_ptid) calls reinit_frame_cache when + inferior_ptid matches pid_ptid, but in our case, it does not + call it, as inferior_ptid has been reset. */ + reinit_frame_cache (); } void |