mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 20:19:10 +02:00
LazDebuggerFp (pure): When stepping(over) out of a procedure, continue until a new sourceline has been reached.
git-svn-id: trunk@44799 -
This commit is contained in:
parent
f677379864
commit
056bfcfe4b
@ -39,7 +39,8 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, Maps, FpDbgDwarf, FpDbgUtil, FpDbgWinExtra, FpDbgLoader,
|
||||
FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazClasses, DbgIntfBaseTypes, fgl,
|
||||
FpDbgDisasX86;
|
||||
FpDbgDisasX86,
|
||||
FpDbgDwarfDataClasses;
|
||||
|
||||
type
|
||||
TFPDEvent = (deExitProcess, deBreakpoint, deException, deCreateProcess, deLoadLibrary, deInternalContinue);
|
||||
@ -123,6 +124,7 @@ type
|
||||
function SingleStep: Boolean; virtual;
|
||||
function StepOver: Boolean; virtual;
|
||||
function Next: Boolean; virtual;
|
||||
function IntNext: Boolean; virtual;
|
||||
function CompareStepInfo: boolean;
|
||||
property ID: Integer read FID;
|
||||
property Handle: THandle read FHandle;
|
||||
@ -803,6 +805,7 @@ function TDbgThread.CompareStepInfo: boolean;
|
||||
var
|
||||
AnAddr: TDBGPtr;
|
||||
Sym: TFpDbgSymbol;
|
||||
CU: TDwarfCompilationUnit;
|
||||
begin
|
||||
AnAddr := FProcess.GetInstructionPointerRegisterValue;
|
||||
sym := FProcess.FindSymbol(AnAddr);
|
||||
@ -810,6 +813,17 @@ begin
|
||||
begin
|
||||
result := (FStoreStepSrcFilename=sym.FileName) and (FStoreStepSrcLineNo=sym.Line) and
|
||||
(FStoreStepFuncAddr=sym.Address.Address);
|
||||
if not result and (FStoreStepFuncAddr<>sym.Address.Address) then
|
||||
begin
|
||||
// If the procedure changed, also check if the current instruction
|
||||
// is at the start of a new sourceline. (Dwarf only)
|
||||
if sym is TDbgDwarfSymbolBase then
|
||||
begin
|
||||
CU := TDbgDwarfSymbolBase(sym).CompilationUnit;
|
||||
if cu.GetLineAddress(sym.FileName, sym.Line)<>AnAddr then
|
||||
result := true;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
result := true;
|
||||
@ -838,6 +852,12 @@ begin
|
||||
// Do nothing
|
||||
end;
|
||||
|
||||
function TDbgThread.IntNext: Boolean;
|
||||
begin
|
||||
result := StepOver;
|
||||
FStepping:=result;
|
||||
end;
|
||||
|
||||
constructor TDbgThread.Create(const AProcess: TDbgProcess; const AID: Integer; const AHandle: THandle);
|
||||
begin
|
||||
FID := AID;
|
||||
@ -897,9 +917,8 @@ end;
|
||||
|
||||
function TDbgThread.Next: Boolean;
|
||||
begin
|
||||
result := StepOver;
|
||||
StoreStepInfo;
|
||||
FStepping:=result;
|
||||
result := IntNext;
|
||||
end;
|
||||
|
||||
{ TDbgBreak }
|
||||
|
@ -236,7 +236,7 @@ begin
|
||||
deInternalContinue :
|
||||
begin
|
||||
if assigned(FCurrentThread) and FCurrentThread.Stepping then
|
||||
FCurrentThread.Next;
|
||||
FCurrentThread.IntNext;
|
||||
end;
|
||||
end; {case}
|
||||
AExit:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user