IDE: added TDebuggerIntf.CanExternalDebugSymbolsFile

git-svn-id: trunk@47107 -
This commit is contained in:
mattias 2014-12-04 19:14:22 +00:00
parent d7122737e1
commit a46dc8915a
7 changed files with 49 additions and 4 deletions

View File

@ -1731,6 +1731,7 @@ type
class function ExePaths: String; virtual; // The default locations of the exe
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 CanExternalDebugSymbolsFile: boolean; virtual; // If the debugger support the -Xg compiler option to store the debug info in an external file
// debugger properties
class function CreateProperties: TDebuggerProperties; virtual; // Creates debuggerproperties
@ -5490,6 +5491,11 @@ begin
Result := HasExePath;
end;
class function TDebuggerIntf.CanExternalDebugSymbolsFile: boolean;
begin
Result := false;
end;
function TDebuggerIntf.GetCommands: TDBGCommands;
begin
Result := COMMANDMAP[State] * GetSupportedCommands;

View File

@ -404,7 +404,7 @@ type
property Win32GraphicApp: boolean read FWin32GraphicApp write SetWin32GraphicApp;
property ExecutableType: TCompilationExecutableType
read FExecutableType write SetExecutableType;
property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write SetUseExternalDbgSyms;
property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write SetUseExternalDbgSyms; // -Xg
// messages:
property ShowErrors: Boolean read fShowErrors write SetShowErrors; // -ve

View File

@ -79,6 +79,7 @@ type
constructor Create(const AExternalDebugger: String); override;
destructor Destroy; override;
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
class function CanExternalDebugSymbolsFile: boolean; override;
public
property DebugProcess: TProcessUTF8 read FDbgProcess;
property DebugProcessRunning: Boolean read GetDebugProcessRunning;
@ -577,6 +578,11 @@ begin
SendCmdLn(ACommand);
end;
class function TCmdLineDebugger.CanExternalDebugSymbolsFile: boolean;
begin
Result:=true;
end;
initialization
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} );

View File

@ -157,6 +157,7 @@ type
function GetLocation: TDBGLocationRec; override;
class function Caption: String; override;
class function NeedsExePath: boolean; override;
class function CanExternalDebugSymbolsFile: boolean; override;
class function CreateProperties: TDebuggerProperties; override;
function GetSupportedCommands: TDBGCommands; override;
end;
@ -1804,6 +1805,11 @@ begin
Result:=False;
end;
class function TFpDebugDebugger.CanExternalDebugSymbolsFile: boolean;
begin
Result:=False;
end;
class function TFpDebugDebugger.CreateProperties: TDebuggerProperties;
begin
Result := TFpDebugDebuggerProperties.Create;

View File

@ -58,7 +58,7 @@ type
public
class function Caption: String; override;
class function NeedsExePath: boolean; override;
class function CanExternalDebugSymbolsFile: boolean; override;
published
end;
@ -171,7 +171,12 @@ end;
class function TProcessDebugger.NeedsExePath: boolean;
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;
initialization

View File

@ -3758,6 +3758,11 @@ resourcestring
+'%sHit Stop, and hope the best, we''re pulling the plug.';
lisExecutionStopped = 'Execution stopped';
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?';
lisTheDirectoryIsNoLongerNeededInTheUnitPathRemoveIt =
'The directory "%s" is no longer needed in the unit path.%sRemove it?';

View File

@ -6820,6 +6820,7 @@ end;
function TMainIDE.DoInitProjectRun: TModalResult;
var
ProgramFilename: string;
DebugClass: TDebuggerClass;
begin
if ToolStatus <> itNone
then begin
@ -6846,6 +6847,22 @@ begin
Exit;
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
debugln('TMainIDE.DoInitProjectRun Check build ...');
if DoBuildProject(crRun,[pbfOnlyIfNeeded]) <> mrOk then
@ -6854,7 +6871,7 @@ begin
// Check project build
ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);
DebugLn(['TMainIDE.DoInitProjectRun ProgramFilename=',ProgramFilename]);
if ((DebugBoss.DebuggerClass = nil) or DebugBoss.DebuggerClass.RequiresLocalExecutable)
if ((DebugClass = nil) or DebugClass.RequiresLocalExecutable)
and not FileExistsUTF8(ProgramFilename)
then begin
IDEMessageDialog(lisFileNotFound,