mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-09 19:17:38 +01:00
FpDebug: SetRegisterValue for Windows
git-svn-id: trunk@63764 -
This commit is contained in:
parent
3ea304cd6e
commit
2bba45a96c
@ -152,6 +152,7 @@ type
|
||||
function ResetInstructionPointerAfterBreakpoint: boolean; override;
|
||||
function ReadThreadState: boolean;
|
||||
|
||||
procedure SetRegisterValue(AName: string; AValue: QWord); override;
|
||||
function GetInstructionPointerRegisterValue: TDbgPtr; override;
|
||||
function GetStackBasePointerRegisterValue: TDbgPtr; override;
|
||||
function GetStackPointerRegisterValue: TDbgPtr; override;
|
||||
@ -1713,6 +1714,39 @@ begin
|
||||
FRegisterValueListValid:=False;
|
||||
end;
|
||||
|
||||
procedure TDbgWinThread.SetRegisterValue(AName: string; AValue: QWord);
|
||||
begin
|
||||
if ReadThreadState then
|
||||
exit;
|
||||
|
||||
{$ifdef cpui386}
|
||||
case AName of
|
||||
'eip': FCurrentContext^.def.Eip := AValue;
|
||||
'eax': FCurrentContext^.def.Eax := AValue;
|
||||
else
|
||||
raise Exception.CreateFmt('Setting the [%s] register is not supported', [AName]);
|
||||
end;
|
||||
{$else}
|
||||
if (TDbgWinProcess(Process).FBitness = b32) then begin
|
||||
case AName of
|
||||
'eip': FCurrentContext^.WOW.Eip := AValue;
|
||||
'eax': FCurrentContext^.WOW.Eax := AValue;
|
||||
else
|
||||
raise Exception.CreateFmt('Setting the [%s] register is not supported', [AName]);
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
case AName of
|
||||
'eip': FCurrentContext^.def.Rip := AValue;
|
||||
'eax': FCurrentContext^.def.Rax := AValue;
|
||||
else
|
||||
raise Exception.CreateFmt('Setting the [%s] register is not supported', [AName]);
|
||||
end;
|
||||
end;
|
||||
{$endif}
|
||||
FThreadContextChanged:=True;
|
||||
end;
|
||||
|
||||
function TDbgWinThread.GetInstructionPointerRegisterValue: TDbgPtr;
|
||||
begin
|
||||
Result := 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user