mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:59:14 +02:00
FpDebugger (pure): On a next, only stop if the current instruction is the first instruction of a line. This is to solve a problem in fpcs debuginfo.
git-svn-id: trunk@46136 -
This commit is contained in:
parent
d02d9c6cb1
commit
4b8e6daa2f
@ -111,6 +111,7 @@ type
|
|||||||
private
|
private
|
||||||
FEnvironment: TStrings;
|
FEnvironment: TStrings;
|
||||||
FExecutableFilename: string;
|
FExecutableFilename: string;
|
||||||
|
FNextOnlyStopOnStartLine: boolean;
|
||||||
FOnCreateProcessEvent: TOnCreateProcessEvent;
|
FOnCreateProcessEvent: TOnCreateProcessEvent;
|
||||||
FOnDebugInfoLoaded: TNotifyEvent;
|
FOnDebugInfoLoaded: TNotifyEvent;
|
||||||
FOnExceptionEvent: TOnExceptionEvent;
|
FOnExceptionEvent: TOnExceptionEvent;
|
||||||
@ -157,6 +158,13 @@ type
|
|||||||
property Params: TStringList read FParams write SetParams;
|
property Params: TStringList read FParams write SetParams;
|
||||||
property Environment: TStrings read FEnvironment write SetEnvironment;
|
property Environment: TStrings read FEnvironment write SetEnvironment;
|
||||||
property WorkingDirectory: string read FWorkingDirectory write FWorkingDirectory;
|
property WorkingDirectory: string read FWorkingDirectory write FWorkingDirectory;
|
||||||
|
// With this parameter set a 'next' will only stop if the current
|
||||||
|
// instruction is the first inststruction of a line according to the
|
||||||
|
// debuginfo.
|
||||||
|
// Due to a bug in fpc's debug-info, the line info for the first instruction
|
||||||
|
// of a line, sometimes points the the prior line. This setting hides the
|
||||||
|
// results of that bug. It seems like it that GDB does something similar.
|
||||||
|
property NextOnlyStopOnStartLine: boolean read FNextOnlyStopOnStartLine write FNextOnlyStopOnStartLine;
|
||||||
|
|
||||||
property OnCreateProcessEvent: TOnCreateProcessEvent read FOnCreateProcessEvent write FOnCreateProcessEvent;
|
property OnCreateProcessEvent: TOnCreateProcessEvent read FOnCreateProcessEvent write FOnCreateProcessEvent;
|
||||||
property OnHitBreakpointEvent: TOnHitBreakpointEvent read FOnHitBreakpointEvent write FOnHitBreakpointEvent;
|
property OnHitBreakpointEvent: TOnHitBreakpointEvent read FOnHitBreakpointEvent write FOnHitBreakpointEvent;
|
||||||
@ -360,7 +368,8 @@ begin
|
|||||||
inherited ResolveEvent(AnEvent, Handled, Finished);
|
inherited ResolveEvent(AnEvent, Handled, Finished);
|
||||||
if (AnEvent=deBreakpoint) and not assigned(FController.CurrentProcess.CurrentBreakpoint) then
|
if (AnEvent=deBreakpoint) and not assigned(FController.CurrentProcess.CurrentBreakpoint) then
|
||||||
begin
|
begin
|
||||||
if FController.FCurrentThread.CompareStepInfo<>dcsiNewLine then
|
if (FController.FCurrentThread.CompareStepInfo<>dcsiNewLine) or
|
||||||
|
(not FController.FCurrentThread.IsAtStartOfLine and FController.NextOnlyStopOnStartLine) then
|
||||||
begin
|
begin
|
||||||
AnEvent:=deInternalContinue;
|
AnEvent:=deInternalContinue;
|
||||||
FHiddenBreakpoint:=nil;
|
FHiddenBreakpoint:=nil;
|
||||||
@ -720,6 +729,7 @@ begin
|
|||||||
FParams := TStringList.Create;
|
FParams := TStringList.Create;
|
||||||
FEnvironment := TStringList.Create;
|
FEnvironment := TStringList.Create;
|
||||||
FProcessMap := TMap.Create(itu4, SizeOf(TDbgProcess));
|
FProcessMap := TMap.Create(itu4, SizeOf(TDbgProcess));
|
||||||
|
FNextOnlyStopOnStartLine := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -54,6 +54,18 @@ type
|
|||||||
SyncLogLevel: TFPDLogLevel;
|
SyncLogLevel: TFPDLogLevel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFpDebugDebuggerProperties }
|
||||||
|
|
||||||
|
TFpDebugDebuggerProperties = class(TDebuggerProperties)
|
||||||
|
private
|
||||||
|
FNextOnlyStopOnStartLine: boolean;
|
||||||
|
public
|
||||||
|
constructor Create; override;
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
published
|
||||||
|
property NextOnlyStopOnStartLine: boolean read FNextOnlyStopOnStartLine write FNextOnlyStopOnStartLine;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFpDebugDebugger }
|
{ TFpDebugDebugger }
|
||||||
|
|
||||||
TFpDebugDebugger = class(TDebuggerIntf)
|
TFpDebugDebugger = class(TDebuggerIntf)
|
||||||
@ -142,6 +154,7 @@ type
|
|||||||
function GetLocation: TDBGLocationRec; override;
|
function GetLocation: TDBGLocationRec; override;
|
||||||
class function Caption: String; override;
|
class function Caption: String; override;
|
||||||
class function HasExePath: boolean; override;
|
class function HasExePath: boolean; override;
|
||||||
|
class function CreateProperties: TDebuggerProperties; override;
|
||||||
function GetSupportedCommands: TDBGCommands; override;
|
function GetSupportedCommands: TDBGCommands; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -289,6 +302,22 @@ begin
|
|||||||
RegisterDebugger(TFpDebugDebugger);
|
RegisterDebugger(TFpDebugDebugger);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFpDebugDebuggerProperties }
|
||||||
|
|
||||||
|
constructor TFpDebugDebuggerProperties.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FNextOnlyStopOnStartLine:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFpDebugDebuggerProperties.Assign(Source: TPersistent);
|
||||||
|
begin
|
||||||
|
inherited Assign(Source);
|
||||||
|
if Source is TFpDebugDebuggerProperties then begin
|
||||||
|
FNextOnlyStopOnStartLine := TFpDebugDebuggerProperties(Source).NextOnlyStopOnStartLine;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFpWaitForConsoleOutputThread }
|
{ TFpWaitForConsoleOutputThread }
|
||||||
|
|
||||||
procedure TFpWaitForConsoleOutputThread.DoHasConsoleOutput(Data: PtrInt);
|
procedure TFpWaitForConsoleOutputThread.DoHasConsoleOutput(Data: PtrInt);
|
||||||
@ -1376,6 +1405,8 @@ var
|
|||||||
addr: TDBGPtr;
|
addr: TDBGPtr;
|
||||||
begin
|
begin
|
||||||
result := False;
|
result := False;
|
||||||
|
if assigned(FDbgController) then
|
||||||
|
FDbgController.NextOnlyStopOnStartLine := TFpDebugDebuggerProperties(GetProperties).NextOnlyStopOnStartLine;
|
||||||
case ACommand of
|
case ACommand of
|
||||||
dcRun:
|
dcRun:
|
||||||
begin
|
begin
|
||||||
@ -1678,6 +1709,7 @@ begin
|
|||||||
FDbgController.OnProcessExitEvent:=@FDbgControllerProcessExitEvent;
|
FDbgController.OnProcessExitEvent:=@FDbgControllerProcessExitEvent;
|
||||||
FDbgController.OnExceptionEvent:=@FDbgControllerExceptionEvent;
|
FDbgController.OnExceptionEvent:=@FDbgControllerExceptionEvent;
|
||||||
FDbgController.OnDebugInfoLoaded := @FDbgControllerDebugInfoLoaded;
|
FDbgController.OnDebugInfoLoaded := @FDbgControllerDebugInfoLoaded;
|
||||||
|
FDbgController.NextOnlyStopOnStartLine := TFpDebugDebuggerProperties(GetProperties).NextOnlyStopOnStartLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TFpDebugDebugger.Destroy;
|
destructor TFpDebugDebugger.Destroy;
|
||||||
@ -1741,6 +1773,11 @@ begin
|
|||||||
Result:=False;
|
Result:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TFpDebugDebugger.CreateProperties: TDebuggerProperties;
|
||||||
|
begin
|
||||||
|
Result := TFpDebugDebuggerProperties.Create;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFpDebugDebugger.GetSupportedCommands: TDBGCommands;
|
function TFpDebugDebugger.GetSupportedCommands: TDBGCommands;
|
||||||
begin
|
begin
|
||||||
Result:=[dcRun, dcStop, dcStepIntoInstr, dcStepOverInstr, dcStepOver,
|
Result:=[dcRun, dcStop, dcStepIntoInstr, dcStepOverInstr, dcStepOver,
|
||||||
|
Loading…
Reference in New Issue
Block a user