FpDbg: Moved Windows-specific code to terminate the process to fpdbgwinclasses.pas

git-svn-id: trunk@44437 -
This commit is contained in:
joost 2014-03-16 10:33:04 +00:00
parent eba8717294
commit 6974915b8b
3 changed files with 10 additions and 1 deletions

View File

@ -269,7 +269,7 @@ begin
end;
WriteLN('Terminating ...');
TerminateProcess(GMainProcess.Handle, 0);
GMainProcess.TerminateProcess;
if GState = dsPause
then DebugLoop; // continue runnig so we can terminate
end;

View File

@ -175,6 +175,8 @@ type
function GetInstructionPointerRegisterValue: TDbgPtr; virtual; abstract;
function GetStackBasePointerRegisterValue: TDbgPtr; virtual; abstract;
procedure TerminateProcess; virtual; abstract;
property Handle: THandle read GetHandle;
property Name: String read FName write SetName;
property ProcessID: integer read FProcessID;

View File

@ -100,6 +100,8 @@ type
function GetInstructionPointerRegisterValue: TDbgPtr; override;
function GetStackBasePointerRegisterValue: TDbgPtr; override;
procedure TerminateProcess; override;
function AddrOffset: Int64; override;
function AddLib(const AInfo: TLoadDLLDebugInfo): TDbgLibrary;
procedure AddThread(const AID: Integer; const AInfo: TCreateThreadDebugInfo);
@ -852,6 +854,11 @@ begin
{$endif}
end;
procedure TDbgWinProcess.TerminateProcess;
begin
Windows.TerminateProcess(Handle, 0);
end;
function TDbgWinProcess.AddrOffset: Int64;
begin
Result:=inherited AddrOffset - TDbgPtr(FInfo.lpBaseOfImage);