From: Pedro Alves Date: Wed, 14 Sep 2011 12:26:29 +0000 (+0000) Subject: 2011-09-14 Pedro Alves X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15148d6a1d80bd795b2d53910640a65c76e87b31;p=binutils-gdb.git 2011-09-14 Pedro Alves * infrun.c (prepare_for_detach, wait_for_inferior) (fetch_inferior_event): Don't flush the register cache. * remote.c (struct stop_reply) : Add comment. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 34e8eb07ed7..00188e64e20 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2011-09-14 Pedro Alves + + * infrun.c (prepare_for_detach, wait_for_inferior) + (fetch_inferior_event): Don't flush the register cache. + * remote.c (struct stop_reply) : Add comment. + 2011-09-13 Jan Kratochvil Remove excessive DWARF expressions memory duplication. diff --git a/gdb/infrun.c b/gdb/infrun.c index 2b4f6dbb30e..c72b05dbe00 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2580,14 +2580,6 @@ prepare_for_detach (void) overlay_cache_invalid = 1; - /* We have to invalidate the registers BEFORE calling - target_wait because they can be loaded from the target while - in target_wait. This makes remote debugging a bit more - efficient for those targets that provide critical registers - as part of their normal status mechanism. */ - - registers_changed (); - if (deprecated_target_wait_hook) ecs->ptid = deprecated_target_wait_hook (pid_ptid, &ecs->ws, 0); else @@ -2657,14 +2649,7 @@ wait_for_inferior (void) { struct cleanup *old_chain; - /* We have to invalidate the registers BEFORE calling target_wait - because they can be loaded from the target while in target_wait. - This makes remote debugging a bit more efficient for those - targets that provide critical registers as part of their normal - status mechanism. */ - overlay_cache_invalid = 1; - registers_changed (); if (deprecated_target_wait_hook) ecs->ptid = deprecated_target_wait_hook (waiton_ptid, &ecs->ws, 0); @@ -2734,26 +2719,8 @@ fetch_inferior_event (void *client_data) running any breakpoint commands. */ make_cleanup_restore_current_thread (); - /* We have to invalidate the registers BEFORE calling target_wait - because they can be loaded from the target while in target_wait. - This makes remote debugging a bit more efficient for those - targets that provide critical registers as part of their normal - status mechanism. */ - overlay_cache_invalid = 1; - /* But don't do it if the current thread is already stopped (hence - this is either a delayed event that will result in - TARGET_WAITKIND_IGNORE, or it's an event for another thread (and - we always clear the register and frame caches when the user - switches threads anyway). If we didn't do this, a spurious - delayed event in all-stop mode would make the user lose the - selected frame. */ - if (non_stop - || (!ptid_equal (inferior_ptid, null_ptid) - && is_executing (inferior_ptid))) - registers_changed (); - make_cleanup_restore_integer (&execution_direction); execution_direction = target_execution_direction (); diff --git a/gdb/remote.c b/gdb/remote.c index 1535fb61624..1c9e96508f7 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4898,6 +4898,10 @@ struct stop_reply struct target_waitstatus ws; + /* Expedited registers. This makes remote debugging a bit more + efficient for those targets that provide critical registers as + part of their normal status mechanism (as another roundtrip to + fetch them is avoided). */ VEC(cached_reg_t) *regcache; int stopped_by_watchpoint_p;