mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 03:16:10 +02:00
FpDebug: Removed usage of hard-coded register
git-svn-id: trunk@64310 -
This commit is contained in:
parent
fbb46cb85d
commit
4b59383f64
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user