From e74b00e9dc97a70f91f2f21da3cc959da384eaaa Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 19 Dec 2018 01:42:45 +0000 Subject: [PATCH] LazDebuggerFp: Fix, showing pchar and string version for index access of string/pchar git-svn-id: trunk@59862 - --- .../lazdebuggerfp/fpdebugdebugger.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index 892cb977cb..b07a47091b 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -1334,7 +1334,7 @@ var StackFrame, ThreadId: Integer; StackList: TCallStackBase; ResValue: TFpDbgValue; - CastName: String; + CastName, ResText2: String; ClassAddr, CNameAddr: TFpDbgMemLocation; NameLen: QWord; begin @@ -1420,7 +1420,18 @@ begin Res := FPrettyPrinter.PrintValue(AResText, APasExpr.ResultValue, DispFormat, RepeatCnt) else Res := FPrettyPrinter.PrintValue(AResText, ATypeInfo, APasExpr.ResultValue, DispFormat, RepeatCnt); - // TODO: PCHAR/String + + // PCHAR/String + if APasExpr.HasPCharIndexAccess then begin + // TODO: Only dwarf 2 + APasExpr.FixPCharIndexAccess := True; + APasExpr.ResetEvaluation; + ResValue := APasExpr.ResultValue; + if (ResValue=nil) or (not FPrettyPrinter.PrintValue(ResText2, ResValue, DispFormat, RepeatCnt)) then + ResText2 := 'Failed'; + AResText := 'PChar: '+AResText+ LineEnding + 'String: '+ResText2; + end; + if Res then begin if AWatchValue <> nil then