Skip to content

Commit

Permalink
Handle hit of an implicitly closed breakpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
WheretIB committed May 29, 2020
1 parent f913413 commit ce7c222
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions LuaDkmDebuggerComponent/RemoteComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,29 @@ void IDkmRuntimeBreakpointReceived.OnRuntimeBreakpointReceived(DkmRuntimeBreakpo

eventDescriptor.Suppress();

try
{
var breakpointPos = DebugHelpers.ReadUintVariable(process, processData.locations.helperBreakHitIdAddress);
var breakpointPos = DebugHelpers.ReadUintVariable(process, processData.locations.helperBreakHitIdAddress);

if (!breakpointPos.HasValue)
return;
if (!breakpointPos.HasValue)
return;

if (breakpointPos.Value < processData.activeBreakpoints.Count)
if (breakpointPos.Value < processData.activeBreakpoints.Count)
{
try
{
var breakpoint = processData.activeBreakpoints[(int)breakpointPos.Value];

breakpoint.runtimeBreakpoint.OnHit(thread, false);
if (breakpoint.runtimeBreakpoint != null)
breakpoint.runtimeBreakpoint.OnHit(thread, false);
}
catch (System.ObjectDisposedException)
{
// Breakpoint was implicitly closed
processData.activeBreakpoints.RemoveAt((int)breakpointPos.Value);
}
catch (DkmException)
{
// In case another component evaluates a function
}
}
catch (DkmException)
{
// In case another component evaluates a function
}

return;
Expand Down

0 comments on commit ce7c222

Please sign in to comment.