diff --git a/src/OpenDebugAD7/AD7DebugSession.cs b/src/OpenDebugAD7/AD7DebugSession.cs index fcb7b2ad3..b031b199e 100644 --- a/src/OpenDebugAD7/AD7DebugSession.cs +++ b/src/OpenDebugAD7/AD7DebugSession.cs @@ -1322,11 +1322,11 @@ protected override void HandleGotoRequestAsync(IRequestResponder } var builder = new ErrorBuilder(() => AD7Resources.Error_UnableToSetNextStatement); + IDebugThread2 thread = null; try { if (m_gotoCodeContexts.TryGetValue(responder.Arguments.TargetId, out IDebugCodeContext2 gotoTarget)) { - IDebugThread2 thread = null; lock (m_threads) { if (!m_threads.TryGetValue(responder.Arguments.ThreadId, out thread)) @@ -1340,9 +1340,11 @@ protected override void HandleGotoRequestAsync(IRequestResponder { m_isStopped = true; responder.SetError(new ProtocolException(e.Message)); + return; } responder.SetResponse(response); + FireStoppedEvent(thread, StoppedEvent.ReasonValue.Goto); } protected override void HandleGotoTargetsRequestAsync(IRequestResponder responder)