FpDebug: Windows, Check dwDebugEventCode before accessing case dependent data

git-svn-id: trunk@59740 -
This commit is contained in:
martin 2018-12-06 18:01:02 +00:00
parent 396d0d0387
commit 0506cd7fb5

View File

@ -519,6 +519,7 @@ begin
end; end;
AProcess.ThreadsBeforeContinue; AProcess.ThreadsBeforeContinue;
if MDebugEvent.dwDebugEventCode = EXCEPTION_DEBUG_EVENT then
case MDebugEvent.Exception.ExceptionRecord.ExceptionCode of case MDebugEvent.Exception.ExceptionRecord.ExceptionCode of
EXCEPTION_BREAKPOINT, EXCEPTION_BREAKPOINT,
EXCEPTION_SINGLE_STEP: begin EXCEPTION_SINGLE_STEP: begin
@ -526,7 +527,9 @@ begin
end end
else else
Windows.ContinueDebugEvent(MDebugEvent.dwProcessId, MDebugEvent.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); Windows.ContinueDebugEvent(MDebugEvent.dwProcessId, MDebugEvent.dwThreadId, DBG_EXCEPTION_NOT_HANDLED);
end; end
else
Windows.ContinueDebugEvent(MDebugEvent.dwProcessId, MDebugEvent.dwThreadId, DBG_CONTINUE);
result := true; result := true;
end; end;
@ -828,7 +831,7 @@ begin
end; end;
CREATE_PROCESS_DEBUG_EVENT: begin CREATE_PROCESS_DEBUG_EVENT: begin
//DumpEvent('CREATE_PROCESS_DEBUG_EVENT'); //DumpEvent('CREATE_PROCESS_DEBUG_EVENT');
if MDebugEvent.dwProcessId = TDbgWinThread(AThread).Process.ProcessID then begin; if MDebugEvent.dwProcessId = TDbgWinThread(AThread).Process.ProcessID then begin
//main process //main process
StartProcess(MDebugEvent.dwThreadId, MDebugEvent.CreateProcessInfo); // hfile will be closed by TDbgImageLoader StartProcess(MDebugEvent.dwThreadId, MDebugEvent.CreateProcessInfo); // hfile will be closed by TDbgImageLoader
FJustStarted := true; FJustStarted := true;