LazDebuggerFpLldb: get current IP address from register (instead of stack) if available

git-svn-id: trunk@60007 -
This commit is contained in:
martin 2019-01-05 16:20:22 +00:00
parent 29dbe9729c
commit 5dc6bda9b0

View File

@ -1169,6 +1169,8 @@ var
t: TThreadEntry;
s: TCallStackBase;
f: TCallStackEntry;
r: TRegisters;
v: string;
//Instr: TLldbDebuggerInstruction;
begin
(*
@ -1211,6 +1213,21 @@ begin
exit;
end;
r := Registers.CurrentRegistersList[AThreadId, AStackFrame];
if (r <> nil) and (r.DataValidity = ddsValid) then begin
try
if TargetWidth = 64 then
v := r.EntriesByName['RIP'].ValueObjFormat[rdDefault].Value[rdDefault]
else
v := r.EntriesByName['EIP'].ValueObjFormat[rdDefault].Value[rdDefault];
if pos(' ', v) > 1 then v := copy(v, 1, pos(' ', v)-1);
Result := StrToQWord(v);
exit;
except
end;
end;
s := CallStack.CurrentCallStackList.EntriesForThreads[AThreadId];
if (s = nil) or (AStackFrame >= s.Count) then begin
DebugLn(DBG_ERRORS, ['NO Stackframe list for thread']);