Lldb/Gdb - FpDebug: fix crash in pretty printer when called from lldb/gdb mixed debugger (MemManager not set)

git-svn-id: trunk@59443 -
This commit is contained in:
martin 2018-11-03 22:45:16 +00:00
parent f07c210185
commit 9b2f44b8c8
3 changed files with 8 additions and 2 deletions

View File

@ -680,7 +680,10 @@ function TFpPascalPrettyPrinter.InternalPrintValue(out APrintedValue: String;
exit;
end;
Cache := MemManager.CacheManager.AddCache(AValue.DataAddress.Address, AValue.DataSize);
if (MemManager <> nil) and (MemManager.CacheManager <> nil) then
Cache := MemManager.CacheManager.AddCache(AValue.DataAddress.Address, AValue.DataSize)
else
Cache := nil;
try
if (ppvCreateDbgType in AFlags) then begin
@ -764,7 +767,8 @@ function TFpPascalPrettyPrinter.InternalPrintValue(out APrintedValue: String;
APrintedValue := '(' + APrintedValue + ')';
Result := True;
finally
MemManager.CacheManager.RemoveCache(Cache)
if Cache <> nil then
MemManager.CacheManager.RemoveCache(Cache)
end;
end;

View File

@ -276,6 +276,7 @@ begin
exit;
end;
FpDebugger.FPrettyPrinter.AddressSize := ctx.SizeOfAddress;
FpDebugger.FPrettyPrinter.MemManager := ctx.MemManager;
ALocals.Clear;
for i := 0 to ProcVal.MemberCount - 1 do begin

View File

@ -285,6 +285,7 @@ begin
exit;
end;
FpDebugger.FPrettyPrinter.AddressSize := ctx.SizeOfAddress;
FpDebugger.FPrettyPrinter.MemManager := ctx.MemManager;
ALocals.Clear;
for i := 0 to ProcVal.MemberCount - 1 do begin