From 799ade039d1333ef0c622ba25a218351bef88a3c Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 23 Feb 2014 00:49:05 +0000 Subject: [PATCH] FPDebug: clean up / fix array len git-svn-id: trunk@44209 - --- components/fpdebug/fpdbgdwarf.pas | 2 +- components/fpdebug/fppascalbuilder.pas | 7 ++++++- components/lazdebuggerfp/fpgdbmidebugger.pp | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/components/fpdebug/fpdbgdwarf.pas b/components/fpdebug/fpdbgdwarf.pas index 3045d3128d..901fda972d 100644 --- a/components/fpdebug/fpdbgdwarf.pas +++ b/components/fpdebug/fpdbgdwarf.pas @@ -1941,7 +1941,7 @@ begin then begin Addr.Address := Addr.Address - 4; if MemManager.ReadSignedInt(Addr, 4, i) then begin - Result := Integer(i); + Result := Integer(i)+1; exit; end; end; diff --git a/components/fpdebug/fppascalbuilder.pas b/components/fpdebug/fppascalbuilder.pas index d0c6cb597b..032128061e 100644 --- a/components/fpdebug/fppascalbuilder.pas +++ b/components/fpdebug/fppascalbuilder.pas @@ -410,9 +410,14 @@ function PrintPasValue(out APrintedValue: String; AResValue: TDbgSymbolValue; s: String; t: TDbgSymbol; i: Integer; + v: QWord; begin s := ResTypeName; - APrintedValue := '$'+IntToHex(AResValue.AsCardinal, AnAddrSize); + v := AResValue.AsCardinal; + if v = 0 then + APrintedValue := 'nil' + else + APrintedValue := '$'+IntToHex(AResValue.AsCardinal, AnAddrSize); if s <> '' then APrintedValue := s + '(' + APrintedValue + ')'; diff --git a/components/lazdebuggerfp/fpgdbmidebugger.pp b/components/lazdebuggerfp/fpgdbmidebugger.pp index 0697670813..fd56bb2ae2 100644 --- a/components/lazdebuggerfp/fpgdbmidebugger.pp +++ b/components/lazdebuggerfp/fpgdbmidebugger.pp @@ -1186,7 +1186,7 @@ begin end; if AStackFrame = 0 then begin Result := t.Address; - DebugLn(['Returning addr from Threads', dbgs(Result)]); + //DebugLn(['Returning addr from Threads', dbgs(Result)]); exit; end; @@ -1202,7 +1202,7 @@ begin end; Result := f.Address; - DebugLn(['Returning addr from frame', dbgs(Result)]); + //DebugLn(['Returning addr from frame', dbgs(Result)]); end; @@ -1231,11 +1231,11 @@ begin (FLastContext[AStackFrame - FlastStackFrame] <> nil) and (FLastContext[AStackFrame - FlastStackFrame].Address = Addr) then begin -DebugLn('******* cached contex <<<<<<<<<<<'); Result := FLastContext[AStackFrame - FlastStackFrame]; exit; end; + DebugLn(['* FDwarfInfo.FindContext ', dbgs(Addr)]); Result := FDwarfInfo.FindContext(Addr); FLastThread := AThreadId;