[Lazarus] Need testers for the a new debugger

Flávio Etrusco flavio.etrusco at gmail.com
Sat Nov 22 07:14:39 CET 2014


On Fri, Nov 21, 2014 at 10:33 PM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> On Fri, 21 Nov 2014 23:51:13 +0100
> Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>
(...)
> Without the AVs you can see the mem leaks. I fixed the three mem leaks.

Here's a patch to change the Append method, just in case ;-)

Best regards,
Flávio
-------------- next part --------------
diff --git a/components/debuggerintf/dbgintfdebuggerbase.pp b/components/debuggerintf/dbgintfdebuggerbase.pp
index 146ba74..261d95a 100644
--- a/components/debuggerintf/dbgintfdebuggerbase.pp
+++ b/components/debuggerintf/dbgintfdebuggerbase.pp
@@ -1240,7 +1240,7 @@ type
     procedure SetCount(const AValue: Integer);
   public
     procedure Clear;
-    function Append(const AnEntryPtr: PDisassemblerEntry): Integer;
+    function Append(const AnEntry: TDisassemblerEntry): Integer;
     procedure Merge(const AnotherRange: TDBGDisassemblerEntryRange);
     // Actual addresses on the ranges
     function FirstAddr: TDbgPtr;
@@ -4706,12 +4706,13 @@ begin
   FCount := 0;
 end;
 
-function TDBGDisassemblerEntryRange.Append(const AnEntryPtr: PDisassemblerEntry): Integer;
+function TDBGDisassemblerEntryRange.Append(const AnEntry: TDisassemblerEntry
+  ): Integer;
 begin
   if FCount >= Capacity
   then Capacity := FCount + Max(20,FCount div 4);
 
-  FEntries[FCount] := AnEntryPtr^;
+  FEntries[FCount] := AnEntry;
   Result := FCount;
   inc(FCount);
 end;
diff --git a/components/lazdebuggergdbmi/gdbmidebugger.pp b/components/lazdebuggergdbmi/gdbmidebugger.pp
index 5f4df11..5d61759 100644
--- a/components/lazdebuggergdbmi/gdbmidebugger.pp
+++ b/components/lazdebuggergdbmi/gdbmidebugger.pp
@@ -4042,7 +4042,7 @@ function TGDBMIDebuggerCommandDisassemble.DoExecute: Boolean;
         if (ItmPtr^.FuncName = LastItem^.FuncName)
         then ItmPtr^.FuncName:= LastItem^.FuncName;
       end;
-      ADestRange.Append(ItmPtr);
+      ADestRange.Append(ItmPtr^);
       // now we can move the data, pointed to by ItmPtr // reduce search range
       if ItmPtr2 <> nil
       then begin
@@ -4388,7 +4388,7 @@ function TGDBMIDebuggerCommandDisassemble.DoExecute: Boolean;
         Itm.SrcFileLine := 0;
         Itm.Offset := 0;
         itm.Statement := '<error>';
-        NewRange.Append(@Itm);
+        NewRange.Append(Itm);
         FKnownRanges.AddRange(NewRange);  // NewRange is now owned by FKnownRanges
         NewRange := nil;
         FreeAndNil(DisAssList);
diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas
index 6a23801..5706864 100644
--- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas
+++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas
@@ -804,7 +804,7 @@ begin
       AnEntry.SrcFileLine:=ASrcFileLine;
       AnEntry.SrcFileName:=ASrcFileName;
       AnEntry.SrcStatementIndex:=StatIndex;
-      ARange.Append(@AnEntry);
+      ARange.Append(AnEntry);
       ALastAddr:=AnAddr;
       inc(StatIndex);
       Inc(AnAddr, {%H-}PtrUInt(p) - {%H-}PtrUInt(@CodeBin));


More information about the Lazarus mailing list