mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 15:00:31 +02:00
FpDebug: Remove HasBounds (which did not have a ValueObject). Make SubRanges check for their own size too.
git-svn-id: trunk@61915 -
This commit is contained in:
parent
1e7c605983
commit
f37ef11330
@ -635,7 +635,6 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
||||
protected
|
||||
procedure KindNeeded; override;
|
||||
procedure TypeInfoNeeded; override;
|
||||
function GetHasBounds: Boolean; override;
|
||||
public
|
||||
function GetTypedValueObject({%H-}ATypeCast: Boolean): TFpValueDwarf; override;
|
||||
function GetValueBounds(AValueObj: TFpValue; out ALowBound,
|
||||
@ -689,7 +688,6 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
||||
procedure InitEnumIdx;
|
||||
protected
|
||||
function DoGetNestedTypeInfo: TFpSymbolDwarfType;override;
|
||||
function GetHasBounds: Boolean; override;
|
||||
|
||||
procedure NameNeeded; override;
|
||||
procedure KindNeeded; override;
|
||||
@ -769,8 +767,6 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
||||
function GetNestedSymbol(AIndex: Int64): TFpSymbol; override;
|
||||
function GetNestedSymbolByName(AIndex: String): TFpSymbol; override;
|
||||
function GetNestedSymbolCount: Integer; override;
|
||||
|
||||
function GetHasBounds: Boolean; override;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
function GetTypedValueObject({%H-}ATypeCast: Boolean): TFpValueDwarf; override;
|
||||
@ -3575,11 +3571,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeBasic.GetHasBounds: Boolean;
|
||||
begin
|
||||
Result := (kind = skInteger) or (kind = skCardinal);
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeBasic.GetValueBounds(AValueObj: TFpValue; out
|
||||
ALowBound, AHighBound: Int64): Boolean;
|
||||
begin
|
||||
@ -3719,24 +3710,6 @@ begin
|
||||
Result := FCountValue.TypeInfo as TFpSymbolDwarfType;
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeSubRange.GetHasBounds: Boolean;
|
||||
var
|
||||
dummy: Int64;
|
||||
begin
|
||||
if FLowBoundState = rfNotRead then
|
||||
GetValueLowBound(nil, dummy);
|
||||
Result := (FLowBoundState in [rfConst, rfValue, rfNotRead]);
|
||||
if not Result then
|
||||
exit;
|
||||
|
||||
if (FHighBoundState = rfNotRead) and (FCountState = rfNotRead) then
|
||||
GetValueHighBound(nil, dummy);
|
||||
if FHighBoundState = rfNotRead then
|
||||
FCountState := rfNotFound; // dummy marker. HighBound depends on ValueObj
|
||||
Result := (FHighBoundState in [rfConst, rfValue, rfNotRead]) or
|
||||
(FCountState in [rfConst, rfValue, rfNotRead]);
|
||||
end;
|
||||
|
||||
procedure TFpSymbolDwarfTypeSubRange.NameNeeded;
|
||||
var
|
||||
AName: String;
|
||||
@ -3752,14 +3725,9 @@ var
|
||||
t: TFpSymbol;
|
||||
begin
|
||||
// TODO: limit to ordinal types
|
||||
if not HasBounds then begin // does ReadBounds;
|
||||
SetKind(skNone); // incomplete type
|
||||
end;
|
||||
|
||||
t := NestedTypeInfo;
|
||||
if t = nil then begin
|
||||
SetKind(skInteger);
|
||||
SetSize(CompilationUnit.AddressSize);
|
||||
end
|
||||
else
|
||||
SetKind(t.Kind);
|
||||
@ -3767,15 +3735,20 @@ end;
|
||||
|
||||
procedure TFpSymbolDwarfTypeSubRange.SizeNeeded;
|
||||
var
|
||||
ByteSize: Integer;
|
||||
t: TFpSymbol;
|
||||
begin
|
||||
t := NestedTypeInfo;
|
||||
if t = nil then begin
|
||||
SetKind(skInteger);
|
||||
SetSize(CompilationUnit.AddressSize);
|
||||
end
|
||||
else
|
||||
SetSize(t.Size);
|
||||
if InformationEntry.ReadValue(DW_AT_byte_size, ByteSize) then
|
||||
SetSize(ByteSize)
|
||||
else begin
|
||||
t := NestedTypeInfo;
|
||||
if t = nil then begin
|
||||
SetKind(skInteger);
|
||||
SetSize(CompilationUnit.AddressSize);
|
||||
end
|
||||
else
|
||||
SetSize(t.Size);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeSubRange.GetNestedSymbol(AIndex: Int64): TFpSymbol;
|
||||
@ -4130,11 +4103,6 @@ begin
|
||||
Result := FMembers.Count;
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeEnum.GetHasBounds: Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
destructor TFpSymbolDwarfTypeEnum.Destroy;
|
||||
var
|
||||
i: Integer;
|
||||
|
@ -360,8 +360,6 @@ type
|
||||
function GetHasOrdinalValue: Boolean; virtual;
|
||||
function GetOrdinalValue: Int64; virtual;
|
||||
|
||||
function GetHasBounds: Boolean; virtual;
|
||||
|
||||
function GetNestedSymbol({%H-}AIndex: Int64): TFpSymbol; virtual;
|
||||
function GetNestedSymbolByName({%H-}AIndex: String): TFpSymbol; virtual;
|
||||
function GetNestedSymbolCount: Integer; virtual;
|
||||
@ -432,7 +430,6 @@ type
|
||||
function GetValueBounds(AValueObj: TFpValue; out ALowBound, AHighBound: Int64): Boolean; virtual;
|
||||
function GetValueLowBound(AValueObj: TFpValue; out ALowBound: Int64): Boolean; virtual;
|
||||
function GetValueHighBound(AValueObj: TFpValue; out AHighBound: Int64): Boolean; virtual;
|
||||
property HasBounds: Boolean read GetHasBounds; // Has declaration for BOTH bounds
|
||||
|
||||
// VALUE
|
||||
property Value: TFpValue read GetValueObject; //deprecated 'rename / create';
|
||||
@ -468,7 +465,6 @@ type
|
||||
function GetValueObject: TFpValue; override;
|
||||
function GetHasOrdinalValue: Boolean; override;
|
||||
function GetOrdinalValue: Int64; override;
|
||||
function GetHasBounds: Boolean; override;
|
||||
function GetNestedSymbol(AIndex: Int64): TFpSymbol; override;
|
||||
function GetNestedSymbolByName(AIndex: String): TFpSymbol; override;
|
||||
function GetNestedSymbolCount: Integer; override;
|
||||
@ -1074,11 +1070,6 @@ begin
|
||||
FLastError := AnError;
|
||||
end;
|
||||
|
||||
function TFpSymbol.GetHasBounds: Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function TFpSymbol.GetHasOrdinalValue: Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
@ -1400,17 +1391,6 @@ begin
|
||||
Result := inherited GetValueHighBound(AValueObj, AHighBound);
|
||||
end;
|
||||
|
||||
function TFpSymbolForwarder.GetHasBounds: Boolean;
|
||||
var
|
||||
p: TFpSymbol;
|
||||
begin
|
||||
p := GetForwardToSymbol;
|
||||
if p <> nil then
|
||||
Result := p.HasBounds
|
||||
else
|
||||
Result := False; // Result := inherited GetHasBounds;
|
||||
end;
|
||||
|
||||
function TFpSymbolForwarder.GetNestedSymbol(AIndex: Int64): TFpSymbol;
|
||||
var
|
||||
p: TFpSymbol;
|
||||
|
Loading…
Reference in New Issue
Block a user