FpDebug: add a few missing "const" for params

This commit is contained in:
Martin 2021-11-14 15:36:41 +01:00
parent eac49ae44f
commit f49b54bae5
5 changed files with 22 additions and 18 deletions

View File

@ -199,7 +199,7 @@ type
procedure StoreRegisters; procedure StoreRegisters;
procedure RestoreRegisters; procedure RestoreRegisters;
public public
constructor Create(AController: TDbgController; ARoutineAddress: TFpDbgMemLocation; ACallContext:TFpDbgInfoCallContext); constructor Create(AController: TDbgController; const ARoutineAddress: TFpDbgMemLocation; ACallContext:TFpDbgInfoCallContext);
procedure DoContinue(AProcess: TDbgProcess; AThread: TDbgThread); override; procedure DoContinue(AProcess: TDbgProcess; AThread: TDbgThread); override;
end; end;
@ -422,7 +422,9 @@ var
{ TDbgControllerCallRoutineCmd } { TDbgControllerCallRoutineCmd }
constructor TDbgControllerCallRoutineCmd.Create(AController: TDbgController; ARoutineAddress: TFpDbgMemLocation; ACallContext: TFpDbgInfoCallContext); constructor TDbgControllerCallRoutineCmd.Create(AController: TDbgController;
const ARoutineAddress: TFpDbgMemLocation; ACallContext: TFpDbgInfoCallContext
);
begin begin
inherited Create(AController); inherited Create(AController);

View File

@ -416,7 +416,7 @@ type
TFpValueDwarfConstAddress = class(TFpValueConstAddress) TFpValueDwarfConstAddress = class(TFpValueConstAddress)
protected protected
procedure Update(AnAddress: TFpDbgMemLocation); procedure Update(const AnAddress: TFpDbgMemLocation);
end; end;
{ TFpValueDwarfArray } { TFpValueDwarfArray }
@ -3188,7 +3188,7 @@ end;
{ TFpValueDwarfConstAddress } { TFpValueDwarfConstAddress }
procedure TFpValueDwarfConstAddress.Update(AnAddress: TFpDbgMemLocation); procedure TFpValueDwarfConstAddress.Update(const AnAddress: TFpDbgMemLocation);
begin begin
Address := AnAddress; Address := AnAddress;
end; end;

View File

@ -485,7 +485,7 @@ type
public public
constructor Create(const AName: String; AnInformationEntry: TDwarfInformationEntry); constructor Create(const AName: String; AnInformationEntry: TDwarfInformationEntry);
constructor Create(const AName: String; AnInformationEntry: TDwarfInformationEntry; constructor Create(const AName: String; AnInformationEntry: TDwarfInformationEntry;
AKind: TDbgSymbolKind; AAddress: TFpDbgMemLocation); AKind: TDbgSymbolKind; const AAddress: TFpDbgMemLocation);
destructor Destroy; override; destructor Destroy; override;
function CreateSymbolScope(ALocationContext: TFpDbgLocationContext; ADwarfInfo: TFpDwarfInfo): TFpDbgSymbolScope; virtual; overload; function CreateSymbolScope(ALocationContext: TFpDbgLocationContext; ADwarfInfo: TFpDwarfInfo): TFpDbgSymbolScope; virtual; overload;
@ -801,7 +801,7 @@ type
procedure SetLastError(ALastError: TFpError); procedure SetLastError(ALastError: TFpError);
procedure Evaluate; procedure Evaluate;
function ResultData: TFpDbgMemLocation; function ResultData: TFpDbgMemLocation;
procedure Push(AValue: TFpDbgMemLocation); procedure Push(const AValue: TFpDbgMemLocation);
property FrameBase: TDbgPtr read FFrameBase write FFrameBase; property FrameBase: TDbgPtr read FFrameBase write FFrameBase;
property OnFrameBaseNeeded: TNotifyEvent read FOnFrameBaseNeeded write FOnFrameBaseNeeded; property OnFrameBaseNeeded: TNotifyEvent read FOnFrameBaseNeeded write FOnFrameBaseNeeded;
property LastError: TFpError read FLastError; property LastError: TFpError read FLastError;
@ -2138,7 +2138,7 @@ var
SetError(fpErrLocationParserMinStack); SetError(fpErrLocationParserMinStack);
end; end;
function ReadAddressFromMemory(AnAddress: TFpDbgMemLocation; ASize: Cardinal; out AValue: TFpDbgMemLocation): Boolean; function ReadAddressFromMemory(const AnAddress: TFpDbgMemLocation; ASize: Cardinal; out AValue: TFpDbgMemLocation): Boolean;
begin begin
//TODO: zero fill / sign extend //TODO: zero fill / sign extend
if (ASize > SizeOf(AValue)) or (ASize > AddrSize) then exit(False); if (ASize > SizeOf(AValue)) or (ASize > AddrSize) then exit(False);
@ -2147,7 +2147,7 @@ var
SetError; SetError;
end; end;
function ReadAddressFromMemoryEx(AnAddress: TFpDbgMemLocation; AnAddrSpace: TDbgPtr; ASize: Cardinal; out AValue: TFpDbgMemLocation): Boolean; function ReadAddressFromMemoryEx(const AnAddress: TFpDbgMemLocation; AnAddrSpace: TDbgPtr; ASize: Cardinal; out AValue: TFpDbgMemLocation): Boolean;
begin begin
//TODO: zero fill / sign extend //TODO: zero fill / sign extend
if (ASize > SizeOf(AValue)) or (ASize > AddrSize) then exit(False); if (ASize > SizeOf(AValue)) or (ASize > AddrSize) then exit(False);
@ -2599,7 +2599,7 @@ begin
Result := InvalidLoc; Result := InvalidLoc;
end; end;
procedure TDwarfLocationExpression.Push(AValue: TFpDbgMemLocation); procedure TDwarfLocationExpression.Push(const AValue: TFpDbgMemLocation);
begin begin
FStack.Push(AValue); FStack.Push(AValue);
end; end;
@ -3856,7 +3856,7 @@ end;
constructor TDbgDwarfSymbolBase.Create(const AName: String; constructor TDbgDwarfSymbolBase.Create(const AName: String;
AnInformationEntry: TDwarfInformationEntry; AKind: TDbgSymbolKind; AnInformationEntry: TDwarfInformationEntry; AKind: TDbgSymbolKind;
AAddress: TFpDbgMemLocation); const AAddress: TFpDbgMemLocation);
begin begin
FCU := AnInformationEntry.CompUnit; FCU := AnInformationEntry.CompUnit;
FInformationEntry := AnInformationEntry; FInformationEntry := AnInformationEntry;

View File

@ -149,7 +149,7 @@ type
protected protected
function GetValueObject: TFpValue; override; function GetValueObject: TFpValue; override;
public public
constructor Create(const AName: String; AKind: TDbgSymbolKind; ATypeSymbol: TFpSymbol; AMemLocation: TFpDbgMemLocation); constructor Create(const AName: String; AKind: TDbgSymbolKind; ATypeSymbol: TFpSymbol; const AMemLocation: TFpDbgMemLocation);
end; end;
{ TDbgHardcodedFPCClassMember } { TDbgHardcodedFPCClassMember }
@ -520,7 +520,9 @@ begin
(Result as TDbgHardcodedVariableValue).SetDataSymbol(Self); (Result as TDbgHardcodedVariableValue).SetDataSymbol(Self);
end; end;
constructor TDbgHardcodedVariableAtMemLocation.Create(const AName: string; AKind: TDbgSymbolKind; ATypeSymbol: TFpSymbol; AMemLocation: TFpDbgMemLocation); constructor TDbgHardcodedVariableAtMemLocation.Create(const AName: String;
AKind: TDbgSymbolKind; ATypeSymbol: TFpSymbol;
const AMemLocation: TFpDbgMemLocation);
begin begin
inherited create(AName, AKind, AMemLocation); inherited create(AName, AKind, AMemLocation);
Assert(ATypeSymbol.SymbolType=stType); Assert(ATypeSymbol.SymbolType=stType);

View File

@ -316,7 +316,7 @@ type
function GetFieldFlags: TFpValueFieldFlags; override; function GetFieldFlags: TFpValueFieldFlags; override;
function GetAddress: TFpDbgMemLocation; override; function GetAddress: TFpDbgMemLocation; override;
public public
constructor Create(AnAddress: TFpDbgMemLocation); constructor Create(const AnAddress: TFpDbgMemLocation);
end; end;
{ TFpValueTypeDefinition } { TFpValueTypeDefinition }
@ -377,7 +377,7 @@ type
procedure SetName(const AValue: String); inline; procedure SetName(const AValue: String); inline;
procedure SetKind(AValue: TDbgSymbolKind); inline; procedure SetKind(AValue: TDbgSymbolKind); inline;
procedure SetSymbolType(AValue: TDbgSymbolType); inline; procedure SetSymbolType(AValue: TDbgSymbolType); inline;
procedure SetAddress(AValue: TFpDbgMemLocation); inline; procedure SetAddress(const AValue: TFpDbgMemLocation); inline;
procedure SetTypeInfo(ASymbol: TFpSymbol); inline; procedure SetTypeInfo(ASymbol: TFpSymbol); inline;
procedure SetMemberVisibility(AValue: TDbgSymbolMemberVisibility); inline; procedure SetMemberVisibility(AValue: TDbgSymbolMemberVisibility); inline;
@ -391,7 +391,7 @@ type
//procedure Needed; virtual; //procedure Needed; virtual;
public public
constructor Create(const AName: String); constructor Create(const AName: String);
constructor Create(const AName: String; AKind: TDbgSymbolKind; AAddress: TFpDbgMemLocation); constructor Create(const AName: String; AKind: TDbgSymbolKind; const AAddress: TFpDbgMemLocation);
destructor Destroy; override; destructor Destroy; override;
// Basic info // Basic info
property Name: String read GetName; property Name: String read GetName;
@ -1132,7 +1132,7 @@ begin
Result := FAddress; Result := FAddress;
end; end;
constructor TFpValueConstAddress.Create(AnAddress: TFpDbgMemLocation); constructor TFpValueConstAddress.Create(const AnAddress: TFpDbgMemLocation);
begin begin
inherited Create; inherited Create;
FAddress := AnAddress; FAddress := AnAddress;
@ -1258,7 +1258,7 @@ begin
end; end;
constructor TFpSymbol.Create(const AName: String; AKind: TDbgSymbolKind; constructor TFpSymbol.Create(const AName: String; AKind: TDbgSymbolKind;
AAddress: TFpDbgMemLocation); const AAddress: TFpDbgMemLocation);
begin begin
Create(AName); Create(AName);
SetKind(AKind); SetKind(AKind);
@ -1398,7 +1398,7 @@ begin
Result := 0; Result := 0;
end; end;
procedure TFpSymbol.SetAddress(AValue: TFpDbgMemLocation); procedure TFpSymbol.SetAddress(const AValue: TFpDbgMemLocation);
begin begin
FAddress := AValue; FAddress := AValue;
Include(FEvaluatedFields, sfiAddress); Include(FEvaluatedFields, sfiAddress);