FpDebug: Removed usage of hard-coded register

git-svn-id: trunk@64310 -
This commit is contained in:
joost 2020-12-30 19:15:57 +00:00
parent fbb46cb85d
commit 4b59383f64
2 changed files with 10 additions and 8 deletions

View File

@ -9,29 +9,30 @@ uses
FpDbgInfo,
FpdMemoryTools,
FpDbgDwarfDataClasses,
FpDbgDwarf;
FpDbgDwarf,
FpDbgClasses;
type
{ TFpDbgInfoCallContext }
TFpDbgInfoCallContext = class(TFpDbgAbstractCallContext)
public
function CreateParamSymbol(AParamIndex: Integer; ASymbol: TFpSymbol): TFpValue; override;
function CreateParamSymbol(AParamIndex: Integer; ASymbolType: TFpSymbol; ADbgProcess: TDbgProcess): TFpValue; virtual;
end;
implementation
{ TFpDbgInfoCallContext }
function TFpDbgInfoCallContext.CreateParamSymbol(AParamIndex: Integer; ASymbol: TFpSymbol): TFpValue;
function TFpDbgInfoCallContext.CreateParamSymbol(AParamIndex: Integer; ASymbolType: TFpSymbol; ADbgProcess: TDbgProcess): TFpValue;
var
ParameterMemLocation: TFpDbgMemLocation;
TypeSymbol: TFpSymbol;
ParamSymbol: TFpSymbolDwarfFunctionResult;
begin
ParameterMemLocation := RegisterLoc(5);
TypeSymbol := ASymbol.TypeInfo;
ParamSymbol := TFpSymbolDwarfFunctionResult.Create(ASymbol.Name, TDbgDwarfSymbolBase(ASymbol).InformationEntry, TypeSymbol.Kind, ParameterMemLocation);
ParameterMemLocation := ADbgProcess.CallParamDefaultLocation(AParamIndex);
TypeSymbol := ASymbolType.TypeInfo;
ParamSymbol := TFpSymbolDwarfFunctionResult.Create(ASymbolType.Name, TDbgDwarfSymbolBase(ASymbolType).InformationEntry, TypeSymbol.Kind, ParameterMemLocation);
try
Result := ParamSymbol.Value;
finally

View File

@ -553,6 +553,9 @@ type
// The special addition to make this work is that it is possible to set a
// register-value by calling SetRegisterValue. Further this class is an empty
// wrapper.
{ TFpDbgAbstractCallContext }
TFpDbgAbstractCallContext = class(TFpDbgLocationContext)
private
FBaseContext: TFpDbgLocationContext;
@ -570,8 +573,6 @@ type
constructor Create(const ABaseContext: TFpDbgLocationContext; AMemReader: TFpDbgMemReaderBase; AMemConverter: TFpDbgMemConvertor);
destructor Destroy; override;
function CreateParamSymbol(AParamIndex: Integer; ASymbolType: TFpSymbol): TFpValue; virtual; abstract;
procedure SetRegisterValue(ARegNum: Cardinal; AValue: TDbgPtr);
procedure SetError(const Message: string);
property IsValid: Boolean read FIsValid;