mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 12:32:56 +02:00
LazDebuggerFp (pure): Use pretty-printer to show watch-values
git-svn-id: trunk@44645 -
This commit is contained in:
parent
b618ff3fc2
commit
b889db60c8
@ -12,6 +12,7 @@ uses
|
||||
FpDbgClasses,
|
||||
FpDbgInfo,
|
||||
FpErrorMessages,
|
||||
FpPascalBuilder,
|
||||
DbgIntfBaseTypes,
|
||||
DbgIntfDebuggerBase,
|
||||
FpPascalParser,
|
||||
@ -71,11 +72,14 @@ type
|
||||
|
||||
TFPWatches = class(TWatchesSupplier)
|
||||
private
|
||||
FPrettyPrinter: TFpPascalPrettyPrinter;
|
||||
protected
|
||||
function FpDebugger: TFpDebugDebugger;
|
||||
//procedure DoStateChange(const AOldState: TDBGState); override;
|
||||
procedure InternalRequestData(AWatchValue: TWatchValue); override;
|
||||
public
|
||||
constructor Create(const ADebugger: TDebuggerIntf);
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
{ TFPRegisters }
|
||||
@ -128,7 +132,7 @@ var
|
||||
AContext: TFpDbgInfoContext;
|
||||
AController: TDbgController;
|
||||
APasExpr: TFpPascalExpression;
|
||||
|
||||
AVal: string;
|
||||
begin
|
||||
AController := FpDebugger.FDbgController;
|
||||
|
||||
@ -143,14 +147,32 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
AWatchValue.Value := IntToStr(APasExpr.ResultValue.AsInteger);
|
||||
AWatchValue.Validity := ddsValid;
|
||||
FPrettyPrinter.AddressSize:=AContext.SizeOfAddress;
|
||||
if FPrettyPrinter.PrintValue(AVal, APasExpr.ResultValue, []) then
|
||||
begin
|
||||
AWatchValue.Value := IntToStr(APasExpr.ResultValue.AsInteger);
|
||||
AWatchValue.Validity := ddsValid;
|
||||
end
|
||||
else
|
||||
AWatchValue.Validity := ddsInvalid;
|
||||
end;
|
||||
finally
|
||||
APasExpr.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TFPWatches.Create(const ADebugger: TDebuggerIntf);
|
||||
begin
|
||||
inherited Create(ADebugger);
|
||||
FPrettyPrinter := TFpPascalPrettyPrinter.Create(sizeof(pointer));
|
||||
end;
|
||||
|
||||
destructor TFPWatches.Destroy;
|
||||
begin
|
||||
FPrettyPrinter.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{ TFpDebugThread }
|
||||
|
||||
procedure TFpDebugThread.DoDebugLoopFinishedASync(Data: PtrInt);
|
||||
|
Loading…
Reference in New Issue
Block a user