mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 18:39:05 +02:00
FpDebugger (pure): eval locals for selected stackframe
git-svn-id: trunk@44988 -
This commit is contained in:
parent
3a712955ca
commit
95096bfbda
@ -306,6 +306,10 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
m: TFpDbgValue;
|
m: TFpDbgValue;
|
||||||
n, v: String;
|
n, v: String;
|
||||||
|
CurThreadId, CurStackFrame: Integer;
|
||||||
|
AFrame: TDbgCallstackEntry;
|
||||||
|
RegList: TDbgRegisterValueList;
|
||||||
|
Reg: TDbgRegisterValue;
|
||||||
begin
|
begin
|
||||||
AController := FpDebugger.FDbgController;
|
AController := FpDebugger.FDbgController;
|
||||||
if (AController = nil) or (AController.CurrentProcess = nil) or
|
if (AController = nil) or (AController.CurrentProcess = nil) or
|
||||||
@ -314,7 +318,28 @@ begin
|
|||||||
ALocals.SetDataValidity(ddsInvalid);
|
ALocals.SetDataValidity(ddsInvalid);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
AContext := AController.CurrentProcess.DbgInfo.FindContext(AController.CurrentProcess.GetInstructionPointerRegisterValue);
|
|
||||||
|
CurThreadId := Debugger.Threads.CurrentThreads.CurrentThreadId;
|
||||||
|
CurStackFrame := Debugger.CallStack.CurrentCallStackList.EntriesForThreads[CurThreadId].CurrentIndex;
|
||||||
|
|
||||||
|
if CurStackFrame > 0 then
|
||||||
|
begin
|
||||||
|
AController.CurrentProcess.MainThread.PrepareCallStackEntryList(CurStackFrame);
|
||||||
|
AFrame := AController.CurrentProcess.MainThread.CallStackEntryList[CurStackFrame];
|
||||||
|
if AFrame = nil then
|
||||||
|
begin
|
||||||
|
ALocals.SetDataValidity(ddsInvalid);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
RegList := AFrame.RegisterValueList;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
RegList := AController.CurrentProcess.MainThread.RegisterValueList;
|
||||||
|
Reg := RegList.FindRegisterByDwarfIndex(8);
|
||||||
|
if Reg <> nil then
|
||||||
|
AContext := AController.CurrentProcess.DbgInfo.FindContext(ThreadId, CurStackFrame, Reg.NumValue)
|
||||||
|
else
|
||||||
|
AContext := nil;
|
||||||
|
|
||||||
if (AContext = nil) or (AContext.SymbolAtAddress = nil) then begin
|
if (AContext = nil) or (AContext.SymbolAtAddress = nil) then begin
|
||||||
ALocals.SetDataValidity(ddsInvalid);
|
ALocals.SetDataValidity(ddsInvalid);
|
||||||
|
Loading…
Reference in New Issue
Block a user