FpDebug: reduce logged errors for messages that are expected (cannot write to terminated process)

git-svn-id: trunk@61816 -
This commit is contained in:
martin 2019-09-05 20:05:54 +00:00
parent 2fa22bf873
commit c86c8d65e6
3 changed files with 6 additions and 3 deletions

View File

@ -330,6 +330,7 @@ type
FExceptionClass: string;
FExceptionMessage: string;
FExitCode: DWord;
FGotExitProcess: Boolean;
FProcessID: Integer;
FThreadID: Integer;
@ -423,6 +424,7 @@ type
property LastEventProcessIdentifier: THandle read GetLastEventProcessIdentifier;
property MainThread: TDbgThread read FMainThread;
property GotExitProcess: Boolean read FGotExitProcess write FGotExitProcess;
end;
TDbgProcessClass = class of TDbgProcess;
@ -1482,8 +1484,7 @@ begin
Result := WriteData(ALocation, 1, OrigValue);
DebugLn(DBG_VERBOSE or DBG_BREAKPOINTS, ['Breakpoint Int3 removed from '+FormatAddress(ALocation), ' Result:',Result, ' OVal:', OrigValue]);
if (not Result) then
DebugLn(DBG_WARNINGS or DBG_BREAKPOINTS, 'Unable to reset breakpoint at %s', [FormatAddress(ALocation)]);
DebugLn((not Result) and (not GotExitProcess) and (DBG_WARNINGS or DBG_BREAKPOINTS), 'Unable to reset breakpoint at %s', [FormatAddress(ALocation)]);
if Result then
AfterChangingInstructionCode(ALocation);

View File

@ -924,6 +924,7 @@ begin
begin
(* Only events for the main process get here / See ProcessLoop *)
if FCurrentProcess = FMainProcess then FMainProcess := nil;
FCurrentProcess.GotExitProcess := True;
if assigned(OnProcessExitEvent) then
OnProcessExitEvent(FCurrentProcess.ExitCode);

View File

@ -157,7 +157,8 @@ end;
procedure TDbgWinProcess.LogLastError;
begin
DebugLn(DBG_WARNINGS, 'FpDbg-ERROR: %s', [GetLastErrorText]);
if not GotExitProcess then
DebugLn(DBG_WARNINGS, 'FpDbg-ERROR: %s', [GetLastErrorText]);
end;
procedure TDbgWinProcess.AfterChangingInstructionCode(const ALocation: TDBGPtr);