mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 21:09:45 +02:00
Debugger: Allow project to override selected debugger.
git-svn-id: trunk@61673 -
This commit is contained in:
parent
3356170ca6
commit
5e7fd9a4fa
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -7431,6 +7431,8 @@ ide/frames/oi_options.lfm svneol=native#text/plain
|
|||||||
ide/frames/oi_options.pas svneol=native#text/pascal
|
ide/frames/oi_options.pas svneol=native#text/pascal
|
||||||
ide/frames/project_application_options.lfm svneol=native#text/plain
|
ide/frames/project_application_options.lfm svneol=native#text/plain
|
||||||
ide/frames/project_application_options.pas svneol=native#text/plain
|
ide/frames/project_application_options.pas svneol=native#text/plain
|
||||||
|
ide/frames/project_debug_options.lfm svneol=native#text/plain
|
||||||
|
ide/frames/project_debug_options.pas svneol=native#text/plain
|
||||||
ide/frames/project_forms_options.lfm svneol=native#text/plain
|
ide/frames/project_forms_options.lfm svneol=native#text/plain
|
||||||
ide/frames/project_forms_options.pas svneol=native#text/plain
|
ide/frames/project_forms_options.pas svneol=native#text/plain
|
||||||
ide/frames/project_i18n_options.lfm svneol=native#text/plain
|
ide/frames/project_i18n_options.lfm svneol=native#text/plain
|
||||||
|
@ -215,7 +215,8 @@ const
|
|||||||
ProjectOptionsResources = 550;
|
ProjectOptionsResources = 550;
|
||||||
ProjectOptionsI18N = 600;
|
ProjectOptionsI18N = 600;
|
||||||
ProjectOptionsMisc = 700;
|
ProjectOptionsMisc = 700;
|
||||||
DbgOptionsLanguageExceptions = 800;
|
ProjectOptionsDebug = 700;
|
||||||
|
DbgOptionsLanguageExceptions = 900;
|
||||||
|
|
||||||
GroupPackage = 200100;
|
GroupPackage = 200100;
|
||||||
PackageOptionsUsage = 100;
|
PackageOptionsUsage = 100;
|
||||||
|
@ -530,6 +530,7 @@ type
|
|||||||
procedure SetSessionStorage(const AValue: TProjectSessionStorage); virtual;
|
procedure SetSessionStorage(const AValue: TProjectSessionStorage); virtual;
|
||||||
procedure SetTitle(const AValue: String); virtual;
|
procedure SetTitle(const AValue: String); virtual;
|
||||||
procedure SetUseManifest(AValue: boolean); virtual; abstract;
|
procedure SetUseManifest(AValue: boolean); virtual; abstract;
|
||||||
|
function GetCurrentDebuggerBackend: String; virtual; abstract;
|
||||||
public
|
public
|
||||||
constructor Create({%H-}ProjectDescription: TProjectDescriptor); virtual; reintroduce;
|
constructor Create({%H-}ProjectDescription: TProjectDescriptor); virtual; reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -588,6 +589,7 @@ type
|
|||||||
property Resources: TObject read FResources; // TAbstractProjectResources
|
property Resources: TObject read FResources; // TAbstractProjectResources
|
||||||
property UseManifest: boolean read GetUseManifest write SetUseManifest;
|
property UseManifest: boolean read GetUseManifest write SetUseManifest;
|
||||||
property RunParameters: TAbstractRunParamsOptions read FRunParameters;
|
property RunParameters: TAbstractRunParamsOptions read FRunParameters;
|
||||||
|
property CurrentDebuggerBackend: String read GetCurrentDebuggerBackend;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TLazProjectClass = class of TLazProject;
|
TLazProjectClass = class of TLazProject;
|
||||||
|
@ -2409,14 +2409,14 @@ begin
|
|||||||
|
|
||||||
// check if debugger needs an Exe and the exe is there
|
// check if debugger needs an Exe and the exe is there
|
||||||
if (NewDebuggerClass.NeedsExePath)
|
if (NewDebuggerClass.NeedsExePath)
|
||||||
and not FileIsExecutable(EnvironmentOptions.GetParsedDebuggerFilename)
|
and not FileIsExecutable(EnvironmentOptions.GetParsedDebuggerFilename(Project1))
|
||||||
then begin
|
then begin
|
||||||
if not PromptOnError then
|
if not PromptOnError then
|
||||||
ClearPathAndExe
|
ClearPathAndExe
|
||||||
else begin
|
else begin
|
||||||
IDEMessageDialog(lisDebuggerInvalid,
|
IDEMessageDialog(lisDebuggerInvalid,
|
||||||
Format(lisTheDebuggerDoesNotExistsOrIsNotExecutableSeeEnviro,
|
Format(lisTheDebuggerDoesNotExistsOrIsNotExecutableSeeEnviro,
|
||||||
[EnvironmentOptions.DebuggerFilename, LineEnding, LineEnding+LineEnding]),
|
[EnvironmentOptions.DebuggerFilename(Project1), LineEnding, LineEnding+LineEnding]),
|
||||||
mtError,[mbOK]);
|
mtError,[mbOK]);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -2465,7 +2465,7 @@ begin
|
|||||||
// check if debugger is already created with the right type
|
// check if debugger is already created with the right type
|
||||||
if (FDebugger <> nil)
|
if (FDebugger <> nil)
|
||||||
and (not (FDebugger.ClassType = NewDebuggerClass) // exact class match
|
and (not (FDebugger.ClassType = NewDebuggerClass) // exact class match
|
||||||
or (FDebugger.ExternalDebugger <> EnvironmentOptions.GetParsedDebuggerFilename)
|
or (FDebugger.ExternalDebugger <> EnvironmentOptions.GetParsedDebuggerFilename(Project1))
|
||||||
or (FDebugger.State in [dsError])
|
or (FDebugger.State in [dsError])
|
||||||
)
|
)
|
||||||
then begin
|
then begin
|
||||||
@ -2476,7 +2476,7 @@ begin
|
|||||||
|
|
||||||
// create debugger object
|
// create debugger object
|
||||||
if FDebugger = nil
|
if FDebugger = nil
|
||||||
then SetDebugger(NewDebuggerClass.Create(EnvironmentOptions.GetParsedDebuggerFilename));
|
then SetDebugger(NewDebuggerClass.Create(EnvironmentOptions.GetParsedDebuggerFilename(Project1)));
|
||||||
|
|
||||||
if FDebugger = nil
|
if FDebugger = nil
|
||||||
then begin
|
then begin
|
||||||
@ -2484,10 +2484,10 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (EnvironmentOptions.CurrentDebuggerPropertiesConfig <> nil) and
|
if (EnvironmentOptions.CurrentDebuggerPropertiesConfigEx(Project1) <> nil) and
|
||||||
(EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerProperties <> nil)
|
(EnvironmentOptions.CurrentDebuggerPropertiesConfigEx(Project1).DebuggerProperties <> nil)
|
||||||
then
|
then
|
||||||
FDebugger.GetProperties.Assign(EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerProperties);
|
FDebugger.GetProperties.Assign(EnvironmentOptions.CurrentDebuggerPropertiesConfigEx(Project1).DebuggerProperties);
|
||||||
|
|
||||||
ClearDebugOutputLog;
|
ClearDebugOutputLog;
|
||||||
if EnvironmentOptions.DebuggerEventLogClearOnRun then
|
if EnvironmentOptions.DebuggerEventLogClearOnRun then
|
||||||
@ -2598,10 +2598,10 @@ function TDebugManager.DoSetBreakkPointWarnIfNoDebugger: boolean;
|
|||||||
var
|
var
|
||||||
DbgClass: TDebuggerClass;
|
DbgClass: TDebuggerClass;
|
||||||
begin
|
begin
|
||||||
DbgClass:=EnvironmentOptions.CurrentDebuggerClass;
|
DbgClass:=EnvironmentOptions.CurrentDebuggerClass(Project1);
|
||||||
if (DbgClass=nil)
|
if (DbgClass=nil)
|
||||||
or (DbgClass.NeedsExePath
|
or (DbgClass.NeedsExePath
|
||||||
and (not FileIsExecutableCached(EnvironmentOptions.GetParsedDebuggerFilename)))
|
and (not FileIsExecutableCached(EnvironmentOptions.GetParsedDebuggerFilename(Project1))))
|
||||||
then begin
|
then begin
|
||||||
if IDEQuestionDialog(lisDbgMangNoDebuggerSpecified,
|
if IDEQuestionDialog(lisDbgMangNoDebuggerSpecified,
|
||||||
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo,[LineEnding]),
|
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo,[LineEnding]),
|
||||||
@ -3121,7 +3121,7 @@ end;
|
|||||||
|
|
||||||
function TDebugManager.GetDebuggerClass: TDebuggerClass;
|
function TDebugManager.GetDebuggerClass: TDebuggerClass;
|
||||||
begin
|
begin
|
||||||
Result := EnvironmentOptions.CurrentDebuggerClass;
|
Result := EnvironmentOptions.CurrentDebuggerClass(Project1);
|
||||||
if Result = nil then
|
if Result = nil then
|
||||||
Result := TProcessDebugger;
|
Result := TProcessDebugger;
|
||||||
end;
|
end;
|
||||||
|
@ -301,8 +301,11 @@ type
|
|||||||
FDebuggerClass: TDebuggerClass;
|
FDebuggerClass: TDebuggerClass;
|
||||||
FDebuggerFilename: string;
|
FDebuggerFilename: string;
|
||||||
FIsFromOldXml: Boolean;
|
FIsFromOldXml: Boolean;
|
||||||
|
FUID: String;
|
||||||
FXmlIndex: Integer;
|
FXmlIndex: Integer;
|
||||||
FDebuggerProperties: TDebuggerProperties;
|
FDebuggerProperties: TDebuggerProperties;
|
||||||
|
|
||||||
|
procedure InitUID;
|
||||||
public
|
public
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
constructor CreateFromXmlConf(AXMLCfg: TRttiXMLConfig; APath: String; AIndex: Integer);
|
constructor CreateFromXmlConf(AXMLCfg: TRttiXMLConfig; APath: String; AIndex: Integer);
|
||||||
@ -336,6 +339,7 @@ type
|
|||||||
property ConfigClass: String read FConfigClass write FConfigClass;
|
property ConfigClass: String read FConfigClass write FConfigClass;
|
||||||
property DebuggerFilename: string read FDebuggerFilename write FDebuggerFilename;
|
property DebuggerFilename: string read FDebuggerFilename write FDebuggerFilename;
|
||||||
property Active: Boolean read FActive write FActive;
|
property Active: Boolean read FActive write FActive;
|
||||||
|
property UID: String read FUID write FUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TLastOpenPackagesList = class(TStringList)
|
TLastOpenPackagesList = class(TStringList)
|
||||||
@ -523,6 +527,7 @@ type
|
|||||||
public
|
public
|
||||||
procedure ClearAll;
|
procedure ClearAll;
|
||||||
function EntryByName(AConfName, AConfClass: String): TDebuggerPropertiesConfig;
|
function EntryByName(AConfName, AConfClass: String): TDebuggerPropertiesConfig;
|
||||||
|
function EntryByUid(AnUid: String): TDebuggerPropertiesConfig;
|
||||||
property Opt[Index: Integer]: TDebuggerPropertiesConfig read GetOpt;
|
property Opt[Index: Integer]: TDebuggerPropertiesConfig read GetOpt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -716,11 +721,9 @@ type
|
|||||||
function GetActiveDesktop: TDesktopOpt;
|
function GetActiveDesktop: TDesktopOpt;
|
||||||
function GetCompilerFilename: string;
|
function GetCompilerFilename: string;
|
||||||
function GetCompilerMessagesFilename: string;
|
function GetCompilerMessagesFilename: string;
|
||||||
function GetCurrentDebuggerClass: TDebuggerClass;
|
|
||||||
function GetCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
function GetCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
||||||
function GetDebugDesktop: TDesktopOpt;
|
function GetDebugDesktop: TDesktopOpt;
|
||||||
function GetDebuggerEventLogColors(AIndex: TDBGEventType): TDebuggerEventLogColor;
|
function GetDebuggerEventLogColors(AIndex: TDBGEventType): TDebuggerEventLogColor;
|
||||||
function GetDebuggerFilename: string;
|
|
||||||
function GetDebuggerSearchPath: string;
|
function GetDebuggerSearchPath: string;
|
||||||
function GetFPCSourceDirectory: string;
|
function GetFPCSourceDirectory: string;
|
||||||
function GetFPDocPaths: string;
|
function GetFPDocPaths: string;
|
||||||
@ -782,7 +785,7 @@ type
|
|||||||
function GetParsedMakeFilename: string;
|
function GetParsedMakeFilename: string;
|
||||||
function GetParsedCompilerMessagesFilename: string;
|
function GetParsedCompilerMessagesFilename: string;
|
||||||
function GetParsedFPDocPaths: string;
|
function GetParsedFPDocPaths: string;
|
||||||
function GetParsedDebuggerFilename: string;
|
function GetParsedDebuggerFilename(TheProject: TLazProject = nil): string;
|
||||||
function GetParsedDebuggerSearchPath: string;
|
function GetParsedDebuggerSearchPath: string;
|
||||||
function GetParsedFppkgConfig: string; override;
|
function GetParsedFppkgConfig: string; override;
|
||||||
function GetParsedValue(o: TEnvOptParseType; AUnparsedValue: String = ''): string;
|
function GetParsedValue(o: TEnvOptParseType; AUnparsedValue: String = ''): string;
|
||||||
@ -892,7 +895,7 @@ type
|
|||||||
property FPCSourceDirHistory: TStringList read FFPCSourceDirHistory;
|
property FPCSourceDirHistory: TStringList read FFPCSourceDirHistory;
|
||||||
property MakeFilename: string read GetMakeFilename write SetMakeFilename;
|
property MakeFilename: string read GetMakeFilename write SetMakeFilename;
|
||||||
property MakeFileHistory: TStringList read FMakeFileHistory;
|
property MakeFileHistory: TStringList read FMakeFileHistory;
|
||||||
property DebuggerFilename: string read GetDebuggerFilename;
|
function DebuggerFilename(TheProject: TLazProject = nil): string;
|
||||||
property DebuggerFileHistory[AnIndex: String]: TStringList read GetNamedDebuggerFileHistory;
|
property DebuggerFileHistory[AnIndex: String]: TStringList read GetNamedDebuggerFileHistory;
|
||||||
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
||||||
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
||||||
@ -925,9 +928,10 @@ type
|
|||||||
|
|
||||||
// Debugger
|
// Debugger
|
||||||
procedure SaveDebuggerPropertiesList;
|
procedure SaveDebuggerPropertiesList;
|
||||||
|
function CurrentDebuggerClass(TheProject: TLazProject = nil): TDebuggerClass;
|
||||||
function DebuggerPropertiesConfigList: TDebuggerPropertiesConfigList;
|
function DebuggerPropertiesConfigList: TDebuggerPropertiesConfigList;
|
||||||
|
function CurrentDebuggerPropertiesConfigEx(TheProject: TLazProject): TDebuggerPropertiesConfig;
|
||||||
property CurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig read GetCurrentDebuggerPropertiesConfig write SetCurrentDebuggerPropertiesOpt;
|
property CurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig read GetCurrentDebuggerPropertiesConfig write SetCurrentDebuggerPropertiesOpt;
|
||||||
property CurrentDebuggerClass: TDebuggerClass read GetCurrentDebuggerClass;
|
|
||||||
property HasActiveDebuggerEntry: Boolean read FHasActiveDebuggerEntry write FHasActiveDebuggerEntry; // for the initial setup dialog / entry may be of unknown class
|
property HasActiveDebuggerEntry: Boolean read FHasActiveDebuggerEntry write FHasActiveDebuggerEntry; // for the initial setup dialog / entry may be of unknown class
|
||||||
property DebuggerConfig: TDebuggerConfigStore read FDebuggerConfig;
|
property DebuggerConfig: TDebuggerConfigStore read FDebuggerConfig;
|
||||||
|
|
||||||
@ -1220,8 +1224,34 @@ begin
|
|||||||
Result := Opt[i];
|
Result := Opt[i];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDebuggerPropertiesConfigList.EntryByUid(AnUid: String
|
||||||
|
): TDebuggerPropertiesConfig;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
i := Count - 1;
|
||||||
|
while (i >= 0) and (Opt[i].UID <> AnUid) do
|
||||||
|
dec(i);
|
||||||
|
if i >= 0 then
|
||||||
|
Result := Opt[i];
|
||||||
|
end;
|
||||||
|
|
||||||
{ TDebuggerPropertiesConfig }
|
{ TDebuggerPropertiesConfig }
|
||||||
|
|
||||||
|
procedure TDebuggerPropertiesConfig.InitUID;
|
||||||
|
var
|
||||||
|
g: TGUID;
|
||||||
|
begin
|
||||||
|
if FUID <> '' then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
if CreateGUID(g) = 0 then
|
||||||
|
FUID := GUIDToString(g)
|
||||||
|
else
|
||||||
|
FUID := IntToHex(Random($100000000), 8)+'-'+IntToHex(Random($100000000), 8)+'-'+IntToHex(Random($100000000), 8);
|
||||||
|
end;
|
||||||
|
|
||||||
destructor TDebuggerPropertiesConfig.Destroy;
|
destructor TDebuggerPropertiesConfig.Destroy;
|
||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -1243,6 +1273,8 @@ begin
|
|||||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||||
AXMLCfg.ReadObject(APath + 'Properties/', FDebuggerProperties);
|
AXMLCfg.ReadObject(APath + 'Properties/', FDebuggerProperties);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
InitUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TDebuggerPropertiesConfig.CreateFromOldXmlConf(
|
constructor TDebuggerPropertiesConfig.CreateFromOldXmlConf(
|
||||||
@ -1270,6 +1302,8 @@ begin
|
|||||||
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
||||||
AXMLCfg.ReadObject(APath, FDebuggerProperties);
|
AXMLCfg.ReadObject(APath, FDebuggerProperties);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
InitUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TDebuggerPropertiesConfig.CreateFromOldXmlConf(
|
constructor TDebuggerPropertiesConfig.CreateFromOldXmlConf(
|
||||||
@ -1297,6 +1331,8 @@ begin
|
|||||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||||
AXMLCfg.ReadObject(APath, FDebuggerProperties);
|
AXMLCfg.ReadObject(APath, FDebuggerProperties);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
InitUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TDebuggerPropertiesConfig.CreateForDebuggerClass(
|
constructor TDebuggerPropertiesConfig.CreateForDebuggerClass(
|
||||||
@ -1310,6 +1346,8 @@ begin
|
|||||||
FConfigClass := ADebuggerClass.ClassName;
|
FConfigClass := ADebuggerClass.ClassName;
|
||||||
FConfigName := '';
|
FConfigName := '';
|
||||||
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
||||||
|
|
||||||
|
InitUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TDebuggerPropertiesConfig.CreateCopy(
|
constructor TDebuggerPropertiesConfig.CreateCopy(
|
||||||
@ -1321,6 +1359,7 @@ begin
|
|||||||
if ACopyXmlOrigin then begin
|
if ACopyXmlOrigin then begin
|
||||||
FIsFromOldXml := ASource.FIsFromOldXml;
|
FIsFromOldXml := ASource.FIsFromOldXml;
|
||||||
FXmlIndex := ASource.FXmlIndex;
|
FXmlIndex := ASource.FXmlIndex;
|
||||||
|
FUID := ASource.FUID;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
FIsFromOldXml := False;
|
FIsFromOldXml := False;
|
||||||
@ -1341,6 +1380,9 @@ begin
|
|||||||
FDebuggerProperties := ASource.DebuggerClass.CreateProperties;
|
FDebuggerProperties := ASource.DebuggerClass.CreateProperties;
|
||||||
if ACopyPropValues and (ASource.FDebuggerProperties <> nil) then
|
if ACopyPropValues and (ASource.FDebuggerProperties <> nil) then
|
||||||
FDebuggerProperties.Assign(ASource.FDebuggerProperties);
|
FDebuggerProperties.Assign(ASource.FDebuggerProperties);
|
||||||
|
|
||||||
|
FUID := '';
|
||||||
|
InitUID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebuggerPropertiesConfig.AssignTo(Dest: TPersistent);
|
procedure TDebuggerPropertiesConfig.AssignTo(Dest: TPersistent);
|
||||||
@ -3169,10 +3211,11 @@ begin
|
|||||||
Result:=GetParsedValue(eopFPDocPaths);
|
Result:=GetParsedValue(eopFPDocPaths);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetParsedDebuggerFilename: string;
|
function TEnvironmentOptions.GetParsedDebuggerFilename(TheProject: TLazProject
|
||||||
|
): string;
|
||||||
begin
|
begin
|
||||||
if FParseValues[eopDebuggerFilename].UnparsedValue <> DebuggerFilename then
|
if FParseValues[eopDebuggerFilename].UnparsedValue <> DebuggerFilename(TheProject) then
|
||||||
SetParseValue(eopDebuggerFilename,UTF8Trim(DebuggerFilename));
|
SetParseValue(eopDebuggerFilename,UTF8Trim(DebuggerFilename(TheProject)));
|
||||||
|
|
||||||
Result:=GetParsedValue(eopDebuggerFilename);
|
Result:=GetParsedValue(eopDebuggerFilename);
|
||||||
end;
|
end;
|
||||||
@ -3487,13 +3530,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetCurrentDebuggerClass: TDebuggerClass;
|
function TEnvironmentOptions.CurrentDebuggerClass(TheProject: TLazProject): TDebuggerClass;
|
||||||
begin
|
begin
|
||||||
LoadDebuggerProperties;
|
LoadDebuggerProperties;
|
||||||
|
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if CurrentDebuggerPropertiesConfig <> nil then
|
if CurrentDebuggerPropertiesConfigEx(TheProject) <> nil then
|
||||||
Result := CurrentDebuggerPropertiesConfig.DebuggerClass;
|
Result := CurrentDebuggerPropertiesConfigEx(TheProject).DebuggerClass;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
function TEnvironmentOptions.GetCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
||||||
@ -3520,6 +3563,17 @@ begin
|
|||||||
Result := FDebuggerProperties;
|
Result := FDebuggerProperties;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TEnvironmentOptions.CurrentDebuggerPropertiesConfigEx(
|
||||||
|
TheProject: TLazProject): TDebuggerPropertiesConfig;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
if (TheProject <> nil) and (TheProject.CurrentDebuggerBackend <> '') then
|
||||||
|
Result := FDebuggerProperties.EntryByUid(TheProject.CurrentDebuggerBackend);
|
||||||
|
|
||||||
|
if Result = nil then
|
||||||
|
Result := CurrentDebuggerPropertiesConfig;
|
||||||
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.FileHasChangedOnDisk: boolean;
|
function TEnvironmentOptions.FileHasChangedOnDisk: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=FFileHasChangedOnDisk
|
Result:=FFileHasChangedOnDisk
|
||||||
@ -3710,12 +3764,12 @@ begin
|
|||||||
Result := FDebuggerEventLogColors[AIndex];
|
Result := FDebuggerEventLogColors[AIndex];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetDebuggerFilename: string;
|
function TEnvironmentOptions.DebuggerFilename(TheProject: TLazProject): string;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
LoadDebuggerProperties;
|
LoadDebuggerProperties;
|
||||||
if CurrentDebuggerPropertiesConfig <> nil then
|
if CurrentDebuggerPropertiesConfigEx(TheProject) <> nil then
|
||||||
Result:=CurrentDebuggerPropertiesConfig.DebuggerFilename;
|
Result:=CurrentDebuggerPropertiesConfigEx(TheProject).DebuggerFilename;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetDebuggerSearchPath: string;
|
function TEnvironmentOptions.GetDebuggerSearchPath: string;
|
||||||
|
39
ide/frames/project_debug_options.lfm
Normal file
39
ide/frames/project_debug_options.lfm
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
object ProjectDebugOptionsFrame: TProjectDebugOptionsFrame
|
||||||
|
Left = 0
|
||||||
|
Height = 240
|
||||||
|
Top = 0
|
||||||
|
Width = 320
|
||||||
|
ClientHeight = 240
|
||||||
|
ClientWidth = 320
|
||||||
|
TabOrder = 0
|
||||||
|
DesignLeft = 617
|
||||||
|
DesignTop = 390
|
||||||
|
object lbProjectDebugger: TLabel
|
||||||
|
AnchorSideLeft.Control = Owner
|
||||||
|
AnchorSideTop.Control = cbProjectDebugger
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 6
|
||||||
|
Height = 15
|
||||||
|
Top = 10
|
||||||
|
Width = 99
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = 'lbProjectDebugger'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object cbProjectDebugger: TComboBox
|
||||||
|
AnchorSideLeft.Control = lbProjectDebugger
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = Owner
|
||||||
|
AnchorSideRight.Control = Owner
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 111
|
||||||
|
Height = 23
|
||||||
|
Top = 6
|
||||||
|
Width = 203
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
ItemHeight = 15
|
||||||
|
Style = csDropDownList
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
113
ide/frames/project_debug_options.pas
Normal file
113
ide/frames/project_debug_options.pas
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
unit project_debug_options;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,
|
||||||
|
// LazUtils
|
||||||
|
LazTracer,
|
||||||
|
// LCL
|
||||||
|
Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||||||
|
// IdeIntf
|
||||||
|
IDEOptionsIntf, IDEOptEditorIntf, ProjectIntf,
|
||||||
|
// IDE
|
||||||
|
Project, LazarusIDEStrConsts, EnvironmentOpts;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TProjectDebugOptionsFrame }
|
||||||
|
|
||||||
|
TProjectDebugOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||||
|
cbProjectDebugger: TComboBox;
|
||||||
|
lbProjectDebugger: TLabel;
|
||||||
|
private
|
||||||
|
fProject: TProject;
|
||||||
|
FDebuggerBackend: String;
|
||||||
|
public
|
||||||
|
function GetTitle: string; override;
|
||||||
|
procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
|
||||||
|
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||||
|
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||||
|
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||||
|
//property aProject: TProject read fProject;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TProjectDebugOptionsFrame }
|
||||||
|
|
||||||
|
function TProjectDebugOptionsFrame.GetTitle: string;
|
||||||
|
begin
|
||||||
|
Result := dlgPODebugger;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TProjectDebugOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||||
|
begin
|
||||||
|
lbProjectDebugger.Caption := lisDebugOptionsFrmDebuggerBackend;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TProjectDebugOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
|
var
|
||||||
|
i, sel: Integer;
|
||||||
|
dbg: TDebuggerPropertiesConfigList;
|
||||||
|
begin
|
||||||
|
if not (AOptions is TProjectIDEOptions) then exit;
|
||||||
|
fProject:=(AOptions as TProjectIDEOptions).Project;
|
||||||
|
with fProject do
|
||||||
|
begin
|
||||||
|
Self.FDebuggerBackend := DebuggerBackend;
|
||||||
|
end;
|
||||||
|
|
||||||
|
cbProjectDebugger.Clear;
|
||||||
|
sel := -1;
|
||||||
|
cbProjectDebugger.AddItem(lisDebugOptionsFrmUseIDEDebugger, TObject(-1));
|
||||||
|
if FDebuggerBackend = '' then
|
||||||
|
sel := 0;
|
||||||
|
|
||||||
|
dbg := EnvironmentOptions.DebuggerPropertiesConfigList;
|
||||||
|
for i := 0 to dbg.Count - 1 do begin
|
||||||
|
cbProjectDebugger.AddItem(dbg.Opt[i].DisplayName, TObject(PtrUInt((i))));
|
||||||
|
if dbg.Opt[i].UID = FDebuggerBackend then
|
||||||
|
sel := i+1;
|
||||||
|
end;
|
||||||
|
if sel < 0 then
|
||||||
|
sel := cbProjectDebugger.Items.AddObject(Format(
|
||||||
|
lisDebugOptionsFrmUnknownDebuggerBacke, [FDebuggerBackend]), TObject(PtrUInt(( - 2))));
|
||||||
|
cbProjectDebugger.ItemIndex := sel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TProjectDebugOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||||
|
var
|
||||||
|
AFlags: TProjectFlags;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
if not (AOptions is TProjectIDEOptions) then exit;
|
||||||
|
|
||||||
|
i := cbProjectDebugger.ItemIndex;
|
||||||
|
if i >= 0 then begin
|
||||||
|
FDebuggerBackend := ''; // -1
|
||||||
|
i := PtrInt(cbProjectDebugger.Items.Objects[i]);
|
||||||
|
if i >= 0 then
|
||||||
|
FDebuggerBackend := EnvironmentOptions.DebuggerPropertiesConfigList.Opt[i].UID;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with (AOptions as TProjectIDEOptions).Project do
|
||||||
|
begin
|
||||||
|
DebuggerBackend := FDebuggerBackend;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
class function TProjectDebugOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||||
|
begin
|
||||||
|
Result := TProjectIDEOptions;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterIDEOptionsEditor(GroupProject, TProjectDebugOptionsFrame, ProjectOptionsDebug);
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -6594,6 +6594,10 @@ resourcestring
|
|||||||
UnitDepOptionsForUnit = 'Options for Unit graph';
|
UnitDepOptionsForUnit = 'Options for Unit graph';
|
||||||
LvlGraphReduceBackedges = 'Reduce backedges';
|
LvlGraphReduceBackedges = 'Reduce backedges';
|
||||||
lisDebugOptionsFrmBackend = 'Debugger backend';
|
lisDebugOptionsFrmBackend = 'Debugger backend';
|
||||||
|
dlgPODebugger = 'Debugger';
|
||||||
|
lisDebugOptionsFrmDebuggerBackend = 'DebuggerBackend:';
|
||||||
|
lisDebugOptionsFrmUseIDEDebugger = '-- Use IDE default Debugger --';
|
||||||
|
lisDebugOptionsFrmUnknownDebuggerBacke = 'Unknown Debugger backend "%s"';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ uses
|
|||||||
// project option frames
|
// project option frames
|
||||||
project_application_options, project_forms_options, project_lazdoc_options,
|
project_application_options, project_forms_options, project_lazdoc_options,
|
||||||
project_save_options, project_versioninfo_options, project_i18n_options,
|
project_save_options, project_versioninfo_options, project_i18n_options,
|
||||||
project_misc_options, project_resources_options,
|
project_misc_options, project_resources_options, project_debug_options,
|
||||||
// project compiler option frames
|
// project compiler option frames
|
||||||
compiler_path_options, compiler_config_target, compiler_parsing_options,
|
compiler_path_options, compiler_config_target, compiler_parsing_options,
|
||||||
compiler_codegen_options, compiler_debugging_options, compiler_verbosity_options,
|
compiler_codegen_options, compiler_debugging_options, compiler_verbosity_options,
|
||||||
|
@ -708,6 +708,7 @@ type
|
|||||||
FAllEditorsInfoMap: TMap;
|
FAllEditorsInfoMap: TMap;
|
||||||
FAutoCreateForms: boolean;
|
FAutoCreateForms: boolean;
|
||||||
FChangeStampSaved: integer;
|
FChangeStampSaved: integer;
|
||||||
|
FDebuggerBackend: String;
|
||||||
FEnableI18NForLFM: boolean;
|
FEnableI18NForLFM: boolean;
|
||||||
FHistoryLists: THistoryLists;
|
FHistoryLists: THistoryLists;
|
||||||
FLastCompileComplete: boolean;
|
FLastCompileComplete: boolean;
|
||||||
@ -799,6 +800,7 @@ type
|
|||||||
CheckIfAllowed: boolean; var Allowed: boolean);
|
CheckIfAllowed: boolean; var Allowed: boolean);
|
||||||
procedure SetActiveBuildMode(const AValue: TProjectBuildMode);
|
procedure SetActiveBuildMode(const AValue: TProjectBuildMode);
|
||||||
procedure SetAutoOpenDesignerFormsDisabled(const AValue: boolean);
|
procedure SetAutoOpenDesignerFormsDisabled(const AValue: boolean);
|
||||||
|
procedure SetDebuggerBackend(AValue: String);
|
||||||
procedure SetEnableI18N(const AValue: boolean);
|
procedure SetEnableI18N(const AValue: boolean);
|
||||||
procedure SetEnableI18NForLFM(const AValue: boolean);
|
procedure SetEnableI18NForLFM(const AValue: boolean);
|
||||||
procedure SetLastCompilerParams(AValue: string);
|
procedure SetLastCompilerParams(AValue: string);
|
||||||
@ -861,6 +863,7 @@ type
|
|||||||
procedure SetSessionModified(const AValue: boolean); override;
|
procedure SetSessionModified(const AValue: boolean); override;
|
||||||
procedure SetSessionStorage(const AValue: TProjectSessionStorage); override;
|
procedure SetSessionStorage(const AValue: TProjectSessionStorage); override;
|
||||||
procedure SetUseManifest(AValue: boolean); override;
|
procedure SetUseManifest(AValue: boolean); override;
|
||||||
|
function GetCurrentDebuggerBackend: String; override;
|
||||||
protected
|
protected
|
||||||
// special unit lists
|
// special unit lists
|
||||||
procedure AddToList(AnUnitInfo: TUnitInfo; ListType: TUnitInfoList);
|
procedure AddToList(AnUnitInfo: TUnitInfo; ListType: TUnitInfoList);
|
||||||
@ -1114,6 +1117,8 @@ type
|
|||||||
property OtherDefines: TStrings read FOtherDefines;
|
property OtherDefines: TStrings read FOtherDefines;
|
||||||
property UpdateLock: integer read FUpdateLock;
|
property UpdateLock: integer read FUpdateLock;
|
||||||
property UseAsDefault: Boolean read FUseAsDefault write FUseAsDefault; // for dialog only (used to store options once)
|
property UseAsDefault: Boolean read FUseAsDefault write FUseAsDefault; // for dialog only (used to store options once)
|
||||||
|
|
||||||
|
property DebuggerBackend: String read FDebuggerBackend write SetDebuggerBackend;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2953,6 +2958,9 @@ begin
|
|||||||
LoadOtherDefines(Path);
|
LoadOtherDefines(Path);
|
||||||
// load session info
|
// load session info
|
||||||
LoadSessionInfo(Path,false);
|
LoadSessionInfo(Path,false);
|
||||||
|
|
||||||
|
FDebuggerBackend := FXMLConfig.GetValue(Path+'Debugger/Backend/Value', '');
|
||||||
|
|
||||||
// call hooks to read their info (e.g. DebugBoss)
|
// call hooks to read their info (e.g. DebugBoss)
|
||||||
if Assigned(OnLoadProjectInfo) then
|
if Assigned(OnLoadProjectInfo) then
|
||||||
OnLoadProjectInfo(Self, FXMLConfig, false);
|
OnLoadProjectInfo(Self, FXMLConfig, false);
|
||||||
@ -3275,6 +3283,8 @@ begin
|
|||||||
// save units
|
// save units
|
||||||
SaveUnits(Path,FSaveSessionInLPI);
|
SaveUnits(Path,FSaveSessionInLPI);
|
||||||
|
|
||||||
|
FXMLConfig.SetDeleteValue(Path+'Debugger/Backend/Value', DebuggerBackend, '');
|
||||||
|
|
||||||
if FSaveSessionInLPI then begin
|
if FSaveSessionInLPI then begin
|
||||||
// save defines used for custom options
|
// save defines used for custom options
|
||||||
SaveOtherDefines(Path);
|
SaveOtherDefines(Path);
|
||||||
@ -3912,6 +3922,11 @@ begin
|
|||||||
ProjResources.XPManifest.UseManifest:=AValue;
|
ProjResources.XPManifest.UseManifest:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TProject.GetCurrentDebuggerBackend: String;
|
||||||
|
begin
|
||||||
|
Result := FDebuggerBackend;
|
||||||
|
end;
|
||||||
|
|
||||||
function TProject.UnitCount:integer;
|
function TProject.UnitCount:integer;
|
||||||
begin
|
begin
|
||||||
Result:=FUnitList.Count;
|
Result:=FUnitList.Count;
|
||||||
@ -5279,6 +5294,13 @@ begin
|
|||||||
FAutoOpenDesignerFormsDisabled:=AValue;
|
FAutoOpenDesignerFormsDisabled:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TProject.SetDebuggerBackend(AValue: String);
|
||||||
|
begin
|
||||||
|
if FDebuggerBackend = AValue then Exit;
|
||||||
|
FDebuggerBackend := AValue;
|
||||||
|
Modified := True;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TProject.SetEnableI18NForLFM(const AValue: boolean);
|
procedure TProject.SetEnableI18NForLFM(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FEnableI18NForLFM=AValue then exit;
|
if FEnableI18NForLFM=AValue then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user