mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 08:36:40 +02:00
IDE: added TDebuggerIntf.CanExternalDebugSymbolsFile
git-svn-id: trunk@47107 -
This commit is contained in:
parent
d7122737e1
commit
a46dc8915a
@ -1731,6 +1731,7 @@ type
|
|||||||
class function ExePaths: String; virtual; // The default locations of the exe
|
class function ExePaths: String; virtual; // The default locations of the exe
|
||||||
class function HasExePath: boolean; virtual; deprecated; // use NeedsExePath instead
|
class function HasExePath: boolean; virtual; deprecated; // use NeedsExePath instead
|
||||||
class function NeedsExePath: boolean; virtual; // If the debugger needs to have an exe path
|
class function NeedsExePath: boolean; virtual; // If the debugger needs to have an exe path
|
||||||
|
class function CanExternalDebugSymbolsFile: boolean; virtual; // If the debugger support the -Xg compiler option to store the debug info in an external file
|
||||||
|
|
||||||
// debugger properties
|
// debugger properties
|
||||||
class function CreateProperties: TDebuggerProperties; virtual; // Creates debuggerproperties
|
class function CreateProperties: TDebuggerProperties; virtual; // Creates debuggerproperties
|
||||||
@ -5490,6 +5491,11 @@ begin
|
|||||||
Result := HasExePath;
|
Result := HasExePath;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TDebuggerIntf.CanExternalDebugSymbolsFile: boolean;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
|
||||||
function TDebuggerIntf.GetCommands: TDBGCommands;
|
function TDebuggerIntf.GetCommands: TDBGCommands;
|
||||||
begin
|
begin
|
||||||
Result := COMMANDMAP[State] * GetSupportedCommands;
|
Result := COMMANDMAP[State] * GetSupportedCommands;
|
||||||
|
@ -404,7 +404,7 @@ type
|
|||||||
property Win32GraphicApp: boolean read FWin32GraphicApp write SetWin32GraphicApp;
|
property Win32GraphicApp: boolean read FWin32GraphicApp write SetWin32GraphicApp;
|
||||||
property ExecutableType: TCompilationExecutableType
|
property ExecutableType: TCompilationExecutableType
|
||||||
read FExecutableType write SetExecutableType;
|
read FExecutableType write SetExecutableType;
|
||||||
property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write SetUseExternalDbgSyms;
|
property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write SetUseExternalDbgSyms; // -Xg
|
||||||
|
|
||||||
// messages:
|
// messages:
|
||||||
property ShowErrors: Boolean read fShowErrors write SetShowErrors; // -ve
|
property ShowErrors: Boolean read fShowErrors write SetShowErrors; // -ve
|
||||||
|
@ -79,6 +79,7 @@ type
|
|||||||
constructor Create(const AExternalDebugger: String); override;
|
constructor Create(const AExternalDebugger: String); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
|
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
|
||||||
|
class function CanExternalDebugSymbolsFile: boolean; override;
|
||||||
public
|
public
|
||||||
property DebugProcess: TProcessUTF8 read FDbgProcess;
|
property DebugProcess: TProcessUTF8 read FDbgProcess;
|
||||||
property DebugProcessRunning: Boolean read GetDebugProcessRunning;
|
property DebugProcessRunning: Boolean read GetDebugProcessRunning;
|
||||||
@ -577,6 +578,11 @@ begin
|
|||||||
SendCmdLn(ACommand);
|
SendCmdLn(ACommand);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TCmdLineDebugger.CanExternalDebugSymbolsFile: boolean;
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
DBG_CMD_ECHO := DebugLogger.RegisterLogGroup('DBG_CMD_ECHO' {$IF defined(DBG_VERBOSE) or defined(DBG_CMD_ECHO)} , True {$ENDIF} );
|
DBG_CMD_ECHO := DebugLogger.RegisterLogGroup('DBG_CMD_ECHO' {$IF defined(DBG_VERBOSE) or defined(DBG_CMD_ECHO)} , True {$ENDIF} );
|
||||||
DBG_CMD_ECHO_FULL := DebugLogger.RegisterLogGroup('DBG_CMD_ECHO_FULL' {$IF defined(DBG_VERBOSE_FULL_DATA) or defined(DBG_CMD_ECHO_FULL)} , True {$ENDIF} );
|
DBG_CMD_ECHO_FULL := DebugLogger.RegisterLogGroup('DBG_CMD_ECHO_FULL' {$IF defined(DBG_VERBOSE_FULL_DATA) or defined(DBG_CMD_ECHO_FULL)} , True {$ENDIF} );
|
||||||
|
@ -157,6 +157,7 @@ type
|
|||||||
function GetLocation: TDBGLocationRec; override;
|
function GetLocation: TDBGLocationRec; override;
|
||||||
class function Caption: String; override;
|
class function Caption: String; override;
|
||||||
class function NeedsExePath: boolean; override;
|
class function NeedsExePath: boolean; override;
|
||||||
|
class function CanExternalDebugSymbolsFile: boolean; override;
|
||||||
class function CreateProperties: TDebuggerProperties; override;
|
class function CreateProperties: TDebuggerProperties; override;
|
||||||
function GetSupportedCommands: TDBGCommands; override;
|
function GetSupportedCommands: TDBGCommands; override;
|
||||||
end;
|
end;
|
||||||
@ -1804,6 +1805,11 @@ begin
|
|||||||
Result:=False;
|
Result:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TFpDebugDebugger.CanExternalDebugSymbolsFile: boolean;
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
class function TFpDebugDebugger.CreateProperties: TDebuggerProperties;
|
class function TFpDebugDebugger.CreateProperties: TDebuggerProperties;
|
||||||
begin
|
begin
|
||||||
Result := TFpDebugDebuggerProperties.Create;
|
Result := TFpDebugDebuggerProperties.Create;
|
||||||
|
@ -58,7 +58,7 @@ type
|
|||||||
public
|
public
|
||||||
class function Caption: String; override;
|
class function Caption: String; override;
|
||||||
class function NeedsExePath: boolean; override;
|
class function NeedsExePath: boolean; override;
|
||||||
|
class function CanExternalDebugSymbolsFile: boolean; override;
|
||||||
published
|
published
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -171,7 +171,12 @@ end;
|
|||||||
|
|
||||||
class function TProcessDebugger.NeedsExePath: boolean;
|
class function TProcessDebugger.NeedsExePath: boolean;
|
||||||
begin
|
begin
|
||||||
Result:= false; // no need to have a valid exe path for the process debugger
|
Result := false; // no need to have a valid exe path for the process debugger
|
||||||
|
end;
|
||||||
|
|
||||||
|
class function TProcessDebugger.CanExternalDebugSymbolsFile: boolean;
|
||||||
|
begin
|
||||||
|
Result := true; // Yeah, why not.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -3758,6 +3758,11 @@ resourcestring
|
|||||||
+'%sHit Stop, and hope the best, we''re pulling the plug.';
|
+'%sHit Stop, and hope the best, we''re pulling the plug.';
|
||||||
lisExecutionStopped = 'Execution stopped';
|
lisExecutionStopped = 'Execution stopped';
|
||||||
lisFileNotFound = 'File not found';
|
lisFileNotFound = 'File not found';
|
||||||
|
lisDisableOptionXg = 'Disable Option -Xg?';
|
||||||
|
lisTheProjectWritesTheDebugSymbolsToAnExternalFileThe = 'The project writes '
|
||||||
|
+'the debug symbols to an external file. The "%s" supports only symbols '
|
||||||
|
+'within the executable.';
|
||||||
|
lisDisableOptionXg2 = 'Disable option -Xg';
|
||||||
lisCleanUpUnitPath = 'Clean up unit path?';
|
lisCleanUpUnitPath = 'Clean up unit path?';
|
||||||
lisTheDirectoryIsNoLongerNeededInTheUnitPathRemoveIt =
|
lisTheDirectoryIsNoLongerNeededInTheUnitPathRemoveIt =
|
||||||
'The directory "%s" is no longer needed in the unit path.%sRemove it?';
|
'The directory "%s" is no longer needed in the unit path.%sRemove it?';
|
||||||
|
19
ide/main.pp
19
ide/main.pp
@ -6820,6 +6820,7 @@ end;
|
|||||||
function TMainIDE.DoInitProjectRun: TModalResult;
|
function TMainIDE.DoInitProjectRun: TModalResult;
|
||||||
var
|
var
|
||||||
ProgramFilename: string;
|
ProgramFilename: string;
|
||||||
|
DebugClass: TDebuggerClass;
|
||||||
begin
|
begin
|
||||||
if ToolStatus <> itNone
|
if ToolStatus <> itNone
|
||||||
then begin
|
then begin
|
||||||
@ -6846,6 +6847,22 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
DebugClass:=DebugBoss.DebuggerClass;
|
||||||
|
|
||||||
|
// check if debugger supports compiler flags
|
||||||
|
if ((DebugClass <> nil)
|
||||||
|
and (not DebugClass.CanExternalDebugSymbolsFile))
|
||||||
|
and (Project1.CompilerOptions.UseExternalDbgSyms) then
|
||||||
|
begin
|
||||||
|
// this debugger does not support external debug symbols
|
||||||
|
if IDEQuestionDialog(lisDisableOptionXg, Format(
|
||||||
|
lisTheProjectWritesTheDebugSymbolsToAnExternalFileThe, [DebugClass.Caption
|
||||||
|
]),
|
||||||
|
mtConfirmation, [mrYes, lisDisableOptionXg2, mrCancel])<>mrYes then
|
||||||
|
exit;
|
||||||
|
Project1.CompilerOptions.UseExternalDbgSyms:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
// Build project first
|
// Build project first
|
||||||
debugln('TMainIDE.DoInitProjectRun Check build ...');
|
debugln('TMainIDE.DoInitProjectRun Check build ...');
|
||||||
if DoBuildProject(crRun,[pbfOnlyIfNeeded]) <> mrOk then
|
if DoBuildProject(crRun,[pbfOnlyIfNeeded]) <> mrOk then
|
||||||
@ -6854,7 +6871,7 @@ begin
|
|||||||
// Check project build
|
// Check project build
|
||||||
ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);
|
ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);
|
||||||
DebugLn(['TMainIDE.DoInitProjectRun ProgramFilename=',ProgramFilename]);
|
DebugLn(['TMainIDE.DoInitProjectRun ProgramFilename=',ProgramFilename]);
|
||||||
if ((DebugBoss.DebuggerClass = nil) or DebugBoss.DebuggerClass.RequiresLocalExecutable)
|
if ((DebugClass = nil) or DebugClass.RequiresLocalExecutable)
|
||||||
and not FileExistsUTF8(ProgramFilename)
|
and not FileExistsUTF8(ProgramFilename)
|
||||||
then begin
|
then begin
|
||||||
IDEMessageDialog(lisFileNotFound,
|
IDEMessageDialog(lisFileNotFound,
|
||||||
|
Loading…
Reference in New Issue
Block a user