mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-21 15:00:42 +02:00
FpDebug: workaround, when hardcoded int3 is allowed as user breakpoint, don't stop on internal breakrequest. Issue #40910
This commit is contained in:
parent
7d11cc3fe8
commit
6b5a7e75ea
@ -140,6 +140,7 @@ type
|
|||||||
FIsSuspended: Boolean;
|
FIsSuspended: Boolean;
|
||||||
FBreakPointState: TBreakPointState;
|
FBreakPointState: TBreakPointState;
|
||||||
FDoNotPollName: Boolean;
|
FDoNotPollName: Boolean;
|
||||||
|
FIgnoreNextInt3: Boolean;
|
||||||
FName: String;
|
FName: String;
|
||||||
FUnwinder: TDbgStackUnwinderX86MultiMethod;
|
FUnwinder: TDbgStackUnwinderX86MultiMethod;
|
||||||
protected
|
protected
|
||||||
@ -207,6 +208,7 @@ type
|
|||||||
FInfo: TCreateProcessDebugInfo;
|
FInfo: TCreateProcessDebugInfo;
|
||||||
FProcProcess: TProcessWithRedirect;
|
FProcProcess: TProcessWithRedirect;
|
||||||
FJustStarted, FTerminated: boolean;
|
FJustStarted, FTerminated: boolean;
|
||||||
|
FDbgUiRemoteBreakin: TDBGPtr;
|
||||||
FBitness: TBitness;
|
FBitness: TBitness;
|
||||||
FThreadNameList: TDbgWinThreadNameList;
|
FThreadNameList: TDbgWinThreadNameList;
|
||||||
function GetFullProcessImageName(AProcessHandle: THandle): string;
|
function GetFullProcessImageName(AProcessHandle: THandle): string;
|
||||||
@ -1454,6 +1456,8 @@ var
|
|||||||
InterceptAtFirst: Boolean;
|
InterceptAtFirst: Boolean;
|
||||||
threadname: String;
|
threadname: String;
|
||||||
t: TDbgThread;
|
t: TDbgThread;
|
||||||
|
Lib: TDbgLibrary;
|
||||||
|
FpProc: TFpSymbol;
|
||||||
begin
|
begin
|
||||||
if AThread <> nil then
|
if AThread <> nil then
|
||||||
TDbgWinThread(AThread).EndSingleStepOverBreakPoint;
|
TDbgWinThread(AThread).EndSingleStepOverBreakPoint;
|
||||||
@ -1472,6 +1476,11 @@ begin
|
|||||||
FJustStarted:=false;
|
FJustStarted:=false;
|
||||||
result := deInternalContinue;
|
result := deInternalContinue;
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if (AThread <> nil) and (TDbgWinThread(AThread).FIgnoreNextInt3) then begin
|
||||||
|
result := deInternalContinue; // pause request
|
||||||
|
TDbgWinThread(AThread).FIgnoreNextInt3 := False;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
result := deBreakpoint;
|
result := deBreakpoint;
|
||||||
if AThread <> nil then
|
if AThread <> nil then
|
||||||
@ -1522,6 +1531,24 @@ begin
|
|||||||
CREATE_THREAD_DEBUG_EVENT: begin
|
CREATE_THREAD_DEBUG_EVENT: begin
|
||||||
//DumpEvent('CREATE_THREAD_DEBUG_EVENT');
|
//DumpEvent('CREATE_THREAD_DEBUG_EVENT');
|
||||||
result := deInternalContinue;
|
result := deInternalContinue;
|
||||||
|
if PauseRequested then begin
|
||||||
|
if FDbgUiRemoteBreakin = 0 then begin
|
||||||
|
FDbgUiRemoteBreakin := TDBGPtr(-1);
|
||||||
|
for Lib in LibMap do
|
||||||
|
if (lowercase(Lib.Name) = 'ntdll.dll') or
|
||||||
|
(lowercase(copy(Lib.Name, length(Lib.Name)-9, 10)) = '\ntdll.dll')
|
||||||
|
then begin
|
||||||
|
FpProc := Lib.SymbolTableInfo.FindProcSymbol('DbgUiRemoteBreakin', True);
|
||||||
|
if (FpProc <> nil) and (FpProc.Address.Address <> 0) then begin
|
||||||
|
FDbgUiRemoteBreakin := FpProc.Address.Address;
|
||||||
|
FpProc.ReleaseReference;
|
||||||
|
end;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if (FDbgUiRemoteBreakin <> TDBGPtr(-1)) and (TDBGPtr(MDebugEvent.CreateThread.lpStartAddress) = FDbgUiRemoteBreakin) and (AThread <> nil) then
|
||||||
|
TDbgWinThread(AThread).FIgnoreNextInt3 := True;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
CREATE_PROCESS_DEBUG_EVENT: begin
|
CREATE_PROCESS_DEBUG_EVENT: begin
|
||||||
//DumpEvent('CREATE_PROCESS_DEBUG_EVENT');
|
//DumpEvent('CREATE_PROCESS_DEBUG_EVENT');
|
||||||
|
Loading…
Reference in New Issue
Block a user