mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
FpDebug: Add reference for value.context
git-svn-id: trunk@63787 -
This commit is contained in:
parent
35d829c943
commit
1bacaaff9f
@ -124,10 +124,12 @@ type
|
|||||||
{ TFpValueDwarfBase }
|
{ TFpValueDwarfBase }
|
||||||
|
|
||||||
TFpValueDwarfBase = class(TFpValue)
|
TFpValueDwarfBase = class(TFpValue)
|
||||||
private
|
strict private
|
||||||
FContext: TFpDbgLocationContext;
|
FLocContext: TFpDbgLocationContext;
|
||||||
|
procedure SetContext(AValue: TFpDbgLocationContext);
|
||||||
public
|
public
|
||||||
property Context: TFpDbgLocationContext read FContext write FContext;
|
destructor Destroy; override;
|
||||||
|
property Context: TFpDbgLocationContext read FLocContext write SetContext;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFpValueDwarfTypeDefinition }
|
{ TFpValueDwarfTypeDefinition }
|
||||||
@ -1010,6 +1012,25 @@ begin
|
|||||||
WriteStr(Result, ASubRangeBoundReadState);
|
WriteStr(Result, ASubRangeBoundReadState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFpValueDwarfBase }
|
||||||
|
|
||||||
|
procedure TFpValueDwarfBase.SetContext(AValue: TFpDbgLocationContext);
|
||||||
|
begin
|
||||||
|
if FLocContext = AValue then Exit;
|
||||||
|
if FLocContext <> nil then
|
||||||
|
FLocContext.ReleaseReference;
|
||||||
|
FLocContext := AValue;
|
||||||
|
if FLocContext <> nil then
|
||||||
|
FLocContext.AddReference;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TFpValueDwarfBase.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
if FLocContext <> nil then
|
||||||
|
FLocContext.ReleaseReference;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFpSymbolDwarfFunctionResult }
|
{ TFpSymbolDwarfFunctionResult }
|
||||||
|
|
||||||
function TFpSymbolDwarfFunctionResult.GetValueAddress(AValueObj: TFpValueDwarf; out AnAddress: TFpDbgMemLocation): Boolean;
|
function TFpSymbolDwarfFunctionResult.GetValueAddress(AValueObj: TFpValueDwarf; out AnAddress: TFpDbgMemLocation): Boolean;
|
||||||
@ -1184,8 +1205,8 @@ end;
|
|||||||
|
|
||||||
procedure TFpDwarfInfoSymbolScope.ApplyContext(AVal: TFpValue);
|
procedure TFpDwarfInfoSymbolScope.ApplyContext(AVal: TFpValue);
|
||||||
begin
|
begin
|
||||||
if (AVal <> nil) and (TFpValueDwarfBase(AVal).FContext = nil) then
|
if (AVal <> nil) and (TFpValueDwarfBase(AVal).Context = nil) then
|
||||||
TFpValueDwarfBase(AVal).FContext := Self.LocationContext;
|
TFpValueDwarfBase(AVal).Context := Self.LocationContext;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpDwarfInfoSymbolScope.SymbolToValue(ASym: TFpSymbolDwarf): TFpValue;
|
function TFpDwarfInfoSymbolScope.SymbolToValue(ASym: TFpSymbolDwarf): TFpValue;
|
||||||
@ -1213,7 +1234,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
Result := TFpSymbolDwarfDataProc(FSymbol).GetSelfParameter(FAddress);
|
Result := TFpSymbolDwarfDataProc(FSymbol).GetSelfParameter(FAddress);
|
||||||
if (Result <> nil) then
|
if (Result <> nil) then
|
||||||
Result.FContext := Self.LocationContext;
|
Result.Context := Self.LocationContext;
|
||||||
FSelfParameter := Result;
|
FSelfParameter := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1509,7 +1530,7 @@ begin
|
|||||||
if Result = nil then
|
if Result = nil then
|
||||||
exit;
|
exit;
|
||||||
// TFpValueDwarf(Result).SetStructureValue(Self);
|
// TFpValueDwarf(Result).SetStructureValue(Self);
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpValueDwarfTypeDefinition.GetMember(AIndex: Int64): TFpValue;
|
function TFpValueDwarfTypeDefinition.GetMember(AIndex: Int64): TFpValue;
|
||||||
@ -1518,7 +1539,7 @@ begin
|
|||||||
if Result = nil then
|
if Result = nil then
|
||||||
exit;
|
exit;
|
||||||
// TFpValueDwarf(Result).SetStructureValue(Self);
|
// TFpValueDwarf(Result).SetStructureValue(Self);
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TFpValueDwarfTypeDefinition.Create(ASymbol: TFpSymbolDwarf);
|
constructor TFpValueDwarfTypeDefinition.Create(ASymbol: TFpSymbolDwarf);
|
||||||
@ -1538,8 +1559,8 @@ function TFpValueDwarfTypeDefinition.GetTypeCastedValue(ADataVal: TFpValue): TFp
|
|||||||
begin
|
begin
|
||||||
Result := FSymbol.TypeCastValue(ADataVal);
|
Result := FSymbol.TypeCastValue(ADataVal);
|
||||||
assert((Result = nil) or (Result is TFpValueDwarf), 'TFpValueDwarfTypeDefinition.GetTypeCastedValue: (Result = nil) or (Result is TFpValueDwarf)');
|
assert((Result = nil) or (Result is TFpValueDwarf), 'TFpValueDwarfTypeDefinition.GetTypeCastedValue: (Result = nil) or (Result is TFpValueDwarf)');
|
||||||
if (Result <> nil) and (TFpValueDwarf(Result).FContext = nil) then
|
if (Result <> nil) and (TFpValueDwarf(Result).Context = nil) then
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFpValueDwarf }
|
{ TFpValueDwarf }
|
||||||
@ -1547,8 +1568,8 @@ end;
|
|||||||
function TFpValueDwarf.MemManager: TFpDbgMemManager;
|
function TFpValueDwarf.MemManager: TFpDbgMemManager;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if FContext <> nil then
|
if Context <> nil then
|
||||||
Result := FContext.MemManager;
|
Result := Context.MemManager;
|
||||||
|
|
||||||
if Result = nil then begin
|
if Result = nil then begin
|
||||||
// Either a typecast, or a member gotten from a typecast,...
|
// Either a typecast, or a member gotten from a typecast,...
|
||||||
@ -1754,7 +1775,7 @@ begin
|
|||||||
if Result = nil then
|
if Result = nil then
|
||||||
exit;
|
exit;
|
||||||
TFpValueDwarf(Result).SetStructureValue(Self);
|
TFpValueDwarf(Result).SetStructureValue(Self);
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpValueDwarf.GetMember(AIndex: Int64): TFpValue;
|
function TFpValueDwarf.GetMember(AIndex: Int64): TFpValue;
|
||||||
@ -1763,7 +1784,7 @@ begin
|
|||||||
if Result = nil then
|
if Result = nil then
|
||||||
exit;
|
exit;
|
||||||
TFpValueDwarf(Result).SetStructureValue(Self);
|
TFpValueDwarf(Result).SetStructureValue(Self);
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpValueDwarf.GetDbgSymbol: TFpSymbol;
|
function TFpValueDwarf.GetDbgSymbol: TFpSymbol;
|
||||||
@ -2235,7 +2256,7 @@ begin
|
|||||||
Result := ti.TypeCastValue(Tmp);
|
Result := ti.TypeCastValue(Tmp);
|
||||||
Tmp.ReleaseReference;
|
Tmp.ReleaseReference;
|
||||||
TFpValueDwarf(Result).SetStructureValue(Self);
|
TFpValueDwarf(Result).SetStructureValue(Self);
|
||||||
TFpValueDwarf(Result).FContext := FContext;
|
TFpValueDwarf(Result).Context := Context;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
Result := Tmp;
|
Result := Tmp;
|
||||||
@ -2513,7 +2534,7 @@ begin
|
|||||||
FTypedNumValue.ReleaseReference;
|
FTypedNumValue.ReleaseReference;
|
||||||
FTypedNumValue := t.TypeCastValue(FNumValue);
|
FTypedNumValue := t.TypeCastValue(FNumValue);
|
||||||
assert((FTypedNumValue is TFpValueDwarf), 'is TFpValueDwarf');
|
assert((FTypedNumValue is TFpValueDwarf), 'is TFpValueDwarf');
|
||||||
TFpValueDwarf(FTypedNumValue).FContext := FContext;
|
TFpValueDwarf(FTypedNumValue).Context := Context;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TFpValueDwarf(FTypedNumValue).SetTypeCastInfo(FNumValue); // update
|
TFpValueDwarf(FTypedNumValue).SetTypeCastInfo(FNumValue); // update
|
||||||
@ -2801,7 +2822,7 @@ begin
|
|||||||
FLastMember.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(@FLastMember, 'TFpValueDwarfArray.FLastMember'){$ENDIF};
|
FLastMember.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(@FLastMember, 'TFpValueDwarfArray.FLastMember'){$ENDIF};
|
||||||
FLastMember := TFpValueDwarf(FArraySymbol.TypeInfo.TypeCastValue(FAddrObj));
|
FLastMember := TFpValueDwarf(FArraySymbol.TypeInfo.TypeCastValue(FAddrObj));
|
||||||
{$IFDEF WITH_REFCOUNT_DEBUG}FLastMember.DbgRenameReference(@FLastMember, 'TFpValueDwarfArray.FLastMember'){$ENDIF};
|
{$IFDEF WITH_REFCOUNT_DEBUG}FLastMember.DbgRenameReference(@FLastMember, 'TFpValueDwarfArray.FLastMember'){$ENDIF};
|
||||||
FLastMember.FContext := FContext;
|
FLastMember.Context := Context;
|
||||||
if GetStride(Stride) then
|
if GetStride(Stride) then
|
||||||
TFpValueDwarf(FLastMember).FForcedSize := Stride;
|
TFpValueDwarf(FLastMember).FForcedSize := Stride;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user