mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 21:59:07 +02:00
LLDB Debugger: mem leaks
git-svn-id: trunk@58353 -
This commit is contained in:
parent
4295b09fdb
commit
35c480e02e
@ -348,6 +348,7 @@ var
|
|||||||
CurThr: Boolean;
|
CurThr: Boolean;
|
||||||
Arguments: TStringList;
|
Arguments: TStringList;
|
||||||
addr: TDBGPtr;
|
addr: TDBGPtr;
|
||||||
|
te: TThreadEntry;
|
||||||
begin
|
begin
|
||||||
CurrentThreads.Clear;
|
CurrentThreads.Clear;
|
||||||
for i := 0 to Length(Instr.Res) - 1 do begin
|
for i := 0 to Length(Instr.Res) - 1 do begin
|
||||||
@ -356,16 +357,16 @@ begin
|
|||||||
if CurThr then
|
if CurThr then
|
||||||
CurThrId := TId;
|
CurThrId := TId;
|
||||||
|
|
||||||
CurrentThreads.Add(
|
te := CurrentThreads.CreateEntry(
|
||||||
CurrentThreads.CreateEntry(
|
addr,
|
||||||
addr,
|
Arguments,
|
||||||
Arguments,
|
func,
|
||||||
func,
|
filename, '',
|
||||||
filename, '',
|
line,
|
||||||
line,
|
TId, name, ''
|
||||||
TId, name, ''
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
CurrentThreads.Add(te);
|
||||||
|
te.Free;
|
||||||
|
|
||||||
Arguments.Free;
|
Arguments.Free;
|
||||||
end;
|
end;
|
||||||
@ -455,6 +456,7 @@ begin
|
|||||||
e := TCallStackEntry(It.DataPtr^);
|
e := TCallStackEntry(It.DataPtr^);
|
||||||
e.Init(addr, Arguments, func, filename, '', line);
|
e.Init(addr, Arguments, func, filename, '', line);
|
||||||
end;
|
end;
|
||||||
|
Arguments.Free;
|
||||||
end;
|
end;
|
||||||
It.Free;
|
It.Free;
|
||||||
|
|
||||||
@ -1057,6 +1059,7 @@ begin
|
|||||||
if ParseFrameLocation(ALine, AnId, AnIsCurrent, AnAddr, AFuncName, AnArgs,
|
if ParseFrameLocation(ALine, AnId, AnIsCurrent, AnAddr, AFuncName, AnArgs,
|
||||||
AFile, SrcLine, AReminder)
|
AFile, SrcLine, AReminder)
|
||||||
then begin
|
then begin
|
||||||
|
AnArgs.Free;
|
||||||
FCurrentLocation.Address := AnAddr;
|
FCurrentLocation.Address := AnAddr;
|
||||||
FCurrentLocation.FuncName := AFuncName;
|
FCurrentLocation.FuncName := AFuncName;
|
||||||
FCurrentLocation.SrcFile := AFile;
|
FCurrentLocation.SrcFile := AFile;
|
||||||
|
@ -173,6 +173,7 @@ type
|
|||||||
procedure SendCommandDataToDbg(); override;
|
procedure SendCommandDataToDbg(); override;
|
||||||
public
|
public
|
||||||
constructor Create(AnAddress: TDBGPtr; ALen: Cardinal);
|
constructor Create(AnAddress: TDBGPtr; ALen: Cardinal);
|
||||||
|
destructor Destroy; override;
|
||||||
property Res: TArrayOfByte read FRes;
|
property Res: TArrayOfByte read FRes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -188,6 +189,7 @@ type
|
|||||||
procedure SendCommandDataToDbg(); override;
|
procedure SendCommandDataToDbg(); override;
|
||||||
public
|
public
|
||||||
constructor Create(AThread, AFrame: Integer);
|
constructor Create(AThread, AFrame: Integer);
|
||||||
|
destructor Destroy; override;
|
||||||
property Res: TStringList read FRes;
|
property Res: TStringList read FRes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -202,6 +204,7 @@ type
|
|||||||
function ProcessInputFromDbg(const AData: String): Boolean; override;
|
function ProcessInputFromDbg(const AData: String): Boolean; override;
|
||||||
public
|
public
|
||||||
constructor Create();
|
constructor Create();
|
||||||
|
destructor Destroy; override;
|
||||||
property Res: TStringArray read FRes;
|
property Res: TStringArray read FRes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -216,6 +219,7 @@ type
|
|||||||
function ProcessInputFromDbg(const AData: String): Boolean; override;
|
function ProcessInputFromDbg(const AData: String): Boolean; override;
|
||||||
public
|
public
|
||||||
constructor Create(FrameCount: Integer; AThread: Integer);
|
constructor Create(FrameCount: Integer; AThread: Integer);
|
||||||
|
destructor Destroy; override;
|
||||||
property Res: TStringArray read FRes;
|
property Res: TStringArray read FRes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -477,6 +481,9 @@ begin
|
|||||||
if not Result then // if Result=true then self is destroyed;
|
if not Result then // if Result=true then self is destroyed;
|
||||||
MarkAsSuccess;
|
MarkAsSuccess;
|
||||||
Result := true;
|
Result := true;
|
||||||
|
|
||||||
|
//TODO: "error: No breakpoints exist to be deleted."
|
||||||
|
// prevent from failing other instruction
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TLldbInstructionBreakDelete.Create(AnId: Integer);
|
constructor TLldbInstructionBreakDelete.Create(AnId: Integer);
|
||||||
@ -644,6 +651,12 @@ begin
|
|||||||
inherited Create(Format('memory read --force --size 1 --format x --count %u %u', [ALen, AnAddress]));
|
inherited Create(Format('memory read --force --size 1 --format x --count %u %u', [ALen, AnAddress]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TLldbInstructionMemory.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
FRes := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLldbInstructionRegister }
|
{ TLldbInstructionRegister }
|
||||||
|
|
||||||
procedure TLldbInstructionRegister.DoFree;
|
procedure TLldbInstructionRegister.DoFree;
|
||||||
@ -722,6 +735,12 @@ begin
|
|||||||
inherited Create('register read --all', AThread, AFrame);
|
inherited Create('register read --all', AThread, AFrame);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TLldbInstructionRegister.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
FRes.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLldbInstructionThreadList }
|
{ TLldbInstructionThreadList }
|
||||||
|
|
||||||
procedure TLldbInstructionThreadList.SendCommandDataToDbg();
|
procedure TLldbInstructionThreadList.SendCommandDataToDbg();
|
||||||
@ -773,6 +792,12 @@ begin
|
|||||||
inherited Create('thread list');
|
inherited Create('thread list');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TLldbInstructionThreadList.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
FRes := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLldbInstructionStackTrace }
|
{ TLldbInstructionStackTrace }
|
||||||
|
|
||||||
procedure TLldbInstructionStackTrace.SendCommandDataToDbg();
|
procedure TLldbInstructionStackTrace.SendCommandDataToDbg();
|
||||||
@ -824,5 +849,11 @@ begin
|
|||||||
inherited Create(Format('bt %d', [FrameCount]), AThread);
|
inherited Create(Format('bt %d', [FrameCount]), AThread);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TLldbInstructionStackTrace.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
FRes := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user