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 RestoreRegisters;
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;
end;
@ -422,7 +422,9 @@ var
{ TDbgControllerCallRoutineCmd }
constructor TDbgControllerCallRoutineCmd.Create(AController: TDbgController; ARoutineAddress: TFpDbgMemLocation; ACallContext: TFpDbgInfoCallContext);
constructor TDbgControllerCallRoutineCmd.Create(AController: TDbgController;
const ARoutineAddress: TFpDbgMemLocation; ACallContext: TFpDbgInfoCallContext
);
begin
inherited Create(AController);

View File

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

View File

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

View File

@ -149,7 +149,7 @@ type
protected
function GetValueObject: TFpValue; override;
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;
{ TDbgHardcodedFPCClassMember }
@ -520,7 +520,9 @@ begin
(Result as TDbgHardcodedVariableValue).SetDataSymbol(Self);
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
inherited create(AName, AKind, AMemLocation);
Assert(ATypeSymbol.SymbolType=stType);

View File

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