@@ -2092,6 +2092,10 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
thread execs, it changes its tid to the tgid, and the old
tgid thread might have not been resumed. */
lp->resumed = 1;
+
+ /* Let the arch know that lp called exec. */
+ linux_target->low_post_exec (lp);
+
return 0;
}
@@ -168,6 +168,19 @@ public:
virtual void low_forget_process (pid_t pid)
{}
+ /* The method to call, if any, when an exec event is detected on
+ LWP.
+
+ This is meant to be used by the low target to update its own
+ internal state of debug registers, given that infrun assumes that
+ watchpoints are cleared accross an exec.
+
+ For other needs, be careful of assumptions about the state of
+ other layers of GDB, which haven't been notified of the exec
+ event at this point. */
+ virtual void low_post_exec (struct lwp_info * lwp)
+ {}
+
/* Hook to call prior to resuming a thread. */
virtual void low_prepare_to_resume (struct lwp_info *)
{}