mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 21:09:27 +02:00
LazDebuggerFpLLDB/Gdbmi: Fix cached context
This commit is contained in:
parent
6fc2cb7173
commit
6cded56ae9
@ -933,6 +933,7 @@ function TFpGDBMIDebugger.GetInfoContextForContext(AThreadId,
|
||||
var
|
||||
Addr: TDBGPtr;
|
||||
i, sa: Integer;
|
||||
LocCtx: TFpDbgSimpleLocationContext;
|
||||
begin
|
||||
Result := nil;
|
||||
if FDwarfInfo = nil then
|
||||
@ -969,10 +970,9 @@ begin
|
||||
sa := 4
|
||||
else
|
||||
sa := 8;
|
||||
Result := FDwarfInfo.FindSymbolScope(
|
||||
TFpDbgSimpleLocationContext.Create(FMemManager, Addr, sa, AThreadId, AStackFrame),
|
||||
Addr
|
||||
);
|
||||
LocCtx := TFpDbgSimpleLocationContext.Create(FMemManager, Addr, sa, AThreadId, AStackFrame);
|
||||
Result := FDwarfInfo.FindSymbolScope(LocCtx, Addr);
|
||||
LocCtx.ReleaseReference;
|
||||
|
||||
if Result = nil then begin
|
||||
debugln(DBG_VERBOSE, ['GetInfoContextForContext CTX NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||
@ -980,7 +980,7 @@ begin
|
||||
end;
|
||||
|
||||
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) * SizeOf(FLastContext[0]));
|
||||
FLastContext[0] := Result;
|
||||
// TODO Result.AddReference;
|
||||
end;
|
||||
|
@ -1398,6 +1398,7 @@ function TFpLldbDebugger.GetInfoContextForContext(AThreadId,
|
||||
var
|
||||
Addr: TDBGPtr;
|
||||
i, sa: Integer;
|
||||
LocCtx: TFpDbgSimpleLocationContext;
|
||||
begin
|
||||
Result := nil;
|
||||
if FDwarfInfo = nil then
|
||||
@ -1435,11 +1436,9 @@ begin
|
||||
sa := 4
|
||||
else
|
||||
sa := 8;
|
||||
Result := FDwarfInfo.FindSymbolScope(
|
||||
TFpDbgSimpleLocationContext.Create(FMemManager, Addr, sa, AThreadId, AStackFrame),
|
||||
Addr
|
||||
);
|
||||
Result.LocationContext.ReleaseReference;
|
||||
LocCtx := TFpDbgSimpleLocationContext.Create(FMemManager, Addr, sa, AThreadId, AStackFrame);
|
||||
Result := FDwarfInfo.FindSymbolScope(LocCtx, Addr);
|
||||
LocCtx.ReleaseReference;
|
||||
|
||||
if Result = nil then begin
|
||||
debugln(DBG_VERBOSE, ['GetInfoContextForContext CTX NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||
@ -1447,7 +1446,7 @@ begin
|
||||
end;
|
||||
|
||||
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) * SizeOf(FLastContext[0]));
|
||||
FLastContext[0] := Result;
|
||||
Result.AddReference;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user