LazDebuggerFp: fix context (crash) during stack eval

git-svn-id: trunk@61804 -
This commit is contained in:
martin 2019-09-02 00:44:49 +00:00
parent 386be78e7c
commit 4db4bc458b

View File

@ -21,7 +21,7 @@ uses
DbgIntfDebuggerBase,
FpdMemoryTools,
FpPascalParser,
FPDbgController, FpDbgDwarfDataClasses, FpDbgDwarfFreePascal;
FPDbgController, FpDbgDwarfDataClasses, FpDbgDwarfFreePascal, FpDbgDwarf;
type
@ -663,9 +663,12 @@ begin
else
Reg := RegList.FindRegisterByDwarfIndex(16);
if Reg <> nil then begin
// TODO: TDbgCallstackEntry.GetParamsAsString
AContext := AController.CurrentProcess.DbgInfo.FindContext(CurThreadId, e.Index, Reg.NumValue);
if AContext <> nil then begin
AContext.MemManager.DefaultContext := AContext;
if ProcVal is TFpValueDwarfBase then
TFpValueDwarfBase(ProcVal).Context := AContext;
FPrettyPrinter.MemManager := AContext.MemManager;
FPrettyPrinter.AddressSize := AContext.SizeOfAddress;
@ -677,6 +680,8 @@ begin
params := params + v;
end;
end;
if ProcVal is TFpValueDwarfBase then
TFpValueDwarfBase(ProcVal).Context := nil;
AContext.ReleaseReference;
end;
end;