mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:39:18 +02:00
Init-Setup: Change detection of incorrect dbg settings
git-svn-id: trunk@61632 -
This commit is contained in:
parent
0aa50e2f0f
commit
4f145f9709
@ -534,6 +534,7 @@ type
|
|||||||
XML_PATH_DEBUGGER_CONF_OLD = 'EnvironmentOptions/Debugger/Class%s/%s/';
|
XML_PATH_DEBUGGER_CONF_OLD = 'EnvironmentOptions/Debugger/Class%s/%s/';
|
||||||
private
|
private
|
||||||
FCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
FCurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig;
|
||||||
|
FHasActiveDebuggerEntry: Boolean;
|
||||||
fRegisteredSubConfig: TObjectList;
|
fRegisteredSubConfig: TObjectList;
|
||||||
FDebuggerAutoCloseAsm: boolean;
|
FDebuggerAutoCloseAsm: boolean;
|
||||||
// config file
|
// config file
|
||||||
@ -927,6 +928,7 @@ type
|
|||||||
function DebuggerPropertiesConfigList: TDebuggerPropertiesConfigList;
|
function DebuggerPropertiesConfigList: TDebuggerPropertiesConfigList;
|
||||||
property CurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig read GetCurrentDebuggerPropertiesConfig write SetCurrentDebuggerPropertiesOpt;
|
property CurrentDebuggerPropertiesConfig: TDebuggerPropertiesConfig read GetCurrentDebuggerPropertiesConfig write SetCurrentDebuggerPropertiesOpt;
|
||||||
property CurrentDebuggerClass: TDebuggerClass read GetCurrentDebuggerClass;
|
property CurrentDebuggerClass: TDebuggerClass read GetCurrentDebuggerClass;
|
||||||
|
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;
|
||||||
|
|
||||||
// Debugger event log
|
// Debugger event log
|
||||||
@ -3437,6 +3439,7 @@ begin
|
|||||||
then
|
then
|
||||||
exit;
|
exit;
|
||||||
FKnownDebuggerClassCount := TBaseDebugManagerIntf.DebuggerCount;
|
FKnownDebuggerClassCount := TBaseDebugManagerIntf.DebuggerCount;
|
||||||
|
HasActiveDebuggerEntry := False;
|
||||||
|
|
||||||
|
|
||||||
FDebuggerProperties.ClearAll;
|
FDebuggerProperties.ClearAll;
|
||||||
@ -3448,6 +3451,8 @@ begin
|
|||||||
for i := 1 to ConfCount do begin
|
for i := 1 to ConfCount do begin
|
||||||
Entry := TDebuggerPropertiesConfig.CreateFromXmlConf(FXMLCfg, XML_PATH_DEBUGGER_CONF, i);
|
Entry := TDebuggerPropertiesConfig.CreateFromXmlConf(FXMLCfg, XML_PATH_DEBUGGER_CONF, i);
|
||||||
FDebuggerProperties.AddObject(Entry.ConfigName, Entry);
|
FDebuggerProperties.AddObject(Entry.ConfigName, Entry);
|
||||||
|
if Entry.Active then
|
||||||
|
HasActiveDebuggerEntry := True;
|
||||||
if Entry.Active and Entry.IsLoaded and (FCurrentDebuggerPropertiesConfig = nil) then
|
if Entry.Active and Entry.IsLoaded and (FCurrentDebuggerPropertiesConfig = nil) then
|
||||||
FCurrentDebuggerPropertiesConfig := Entry;
|
FCurrentDebuggerPropertiesConfig := Entry;
|
||||||
if Entry.Active and (UnloadedCurrent = nil) then
|
if Entry.Active and (UnloadedCurrent = nil) then
|
||||||
@ -3462,6 +3467,7 @@ begin
|
|||||||
ActiveClassSeen := False;
|
ActiveClassSeen := False;
|
||||||
if FCurrentDebuggerPropertiesConfig = nil then
|
if FCurrentDebuggerPropertiesConfig = nil then
|
||||||
ActiveClassName := FXMLCfg.GetValue('EnvironmentOptions/Debugger/Class', '');
|
ActiveClassName := FXMLCfg.GetValue('EnvironmentOptions/Debugger/Class', '');
|
||||||
|
HasActiveDebuggerEntry := HasActiveDebuggerEntry or (ActiveClassName <> '');
|
||||||
// There is only one filename for all classes
|
// There is only one filename for all classes
|
||||||
CurFilename:=FXMLCfg.GetValue('EnvironmentOptions/DebuggerFilename/Value','');
|
CurFilename:=FXMLCfg.GetValue('EnvironmentOptions/DebuggerFilename/Value','');
|
||||||
|
|
||||||
@ -3480,17 +3486,6 @@ begin
|
|||||||
if (Entry.ConfigClass = ActiveClassName) and (FCurrentDebuggerPropertiesConfig = nil) then
|
if (Entry.ConfigClass = ActiveClassName) and (FCurrentDebuggerPropertiesConfig = nil) then
|
||||||
FCurrentDebuggerPropertiesConfig := Entry;
|
FCurrentDebuggerPropertiesConfig := Entry;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// current active debugger was not found / may not an unknown class
|
|
||||||
// InitialSetupDlg depends on having a debugger loaded, with the ONLY exception: ActiveClassName = ''
|
|
||||||
if (not ActiveClassSeen) and (ActiveClassName <> '') then begin
|
|
||||||
Entry := TDebuggerPropertiesConfig.CreateFromOldXmlConf(FXMLCfg, XML_PATH_DEBUGGER_CONF_OLD, ActiveClassName, True);
|
|
||||||
if (Entry.DebuggerFilename = '') and (Entry.NeedsExePath or (not Entry.IsLoaded)) then
|
|
||||||
Entry.DebuggerFilename := CurFilename;
|
|
||||||
FDebuggerProperties.AddObject(Entry.ConfigName, Entry);
|
|
||||||
// FCurrentDebuggerPropertiesConfig may NOT be loaded !!!
|
|
||||||
FCurrentDebuggerPropertiesConfig := Entry;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEnvironmentOptions.GetCurrentDebuggerClass: TDebuggerClass;
|
function TEnvironmentOptions.GetCurrentDebuggerClass: TDebuggerClass;
|
||||||
|
@ -245,7 +245,7 @@ begin
|
|||||||
Result:=sddqCompatible;
|
Result:=sddqCompatible;
|
||||||
if ASkip and // assume compatible
|
if ASkip and // assume compatible
|
||||||
( (EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil) or
|
( (EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil) or
|
||||||
(EnvironmentOptions.DebuggerFilename = AFilename) // unless the user edited the filename
|
(EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerFilename = AFilename) // unless the user edited the filename
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
exit;
|
exit;
|
||||||
@ -745,13 +745,10 @@ begin
|
|||||||
s:=MakeExeComboBox.Text;
|
s:=MakeExeComboBox.Text;
|
||||||
if s<>'' then
|
if s<>'' then
|
||||||
EnvironmentOptions.MakeFilename:=s;
|
EnvironmentOptions.MakeFilename:=s;
|
||||||
if not (FSkipDebugger and (EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil))
|
if not (FSkipDebugger and (EnvironmentOptions.CurrentDebuggerPropertiesConfig <> nil))
|
||||||
then begin
|
then begin
|
||||||
s:=DebuggerComboBox.Text;
|
s:=DebuggerComboBox.Text;
|
||||||
if s<>'' then begin
|
if s<>'' then begin
|
||||||
if EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil then
|
|
||||||
EnvironmentOptions.CurrentDebuggerPropertiesConfig :=
|
|
||||||
TDebuggerPropertiesConfig.CreateForDebuggerClass(TGDBMIDebugger);
|
|
||||||
EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerFilename:=s;
|
EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerFilename:=s;
|
||||||
EnvironmentOptions.SaveDebuggerPropertiesList; // Update XML
|
EnvironmentOptions.SaveDebuggerPropertiesList; // Update XML
|
||||||
end;
|
end;
|
||||||
@ -1373,26 +1370,30 @@ begin
|
|||||||
UpdateMakeExeNote;
|
UpdateMakeExeNote;
|
||||||
|
|
||||||
RegisterDebugger(TGDBMIDebugger); // make sure we can read the config
|
RegisterDebugger(TGDBMIDebugger); // make sure we can read the config
|
||||||
FSkipDebugger := (EnvironmentOptions.CurrentDebuggerPropertiesConfig <> nil) and ( // Has a debugger
|
FSkipDebugger := EnvironmentOptions.HasActiveDebuggerEntry // There is a configured entry. Assume it is right, unless we can prove it is incorrect
|
||||||
(EnvironmentOptions.CurrentDebuggerClass = nil) or // Unknown existing debugger class
|
and not (
|
||||||
(not EnvironmentOptions.CurrentDebuggerPropertiesConfig.NeedsExePath) // Does not need an exe
|
(EnvironmentOptions.CurrentDebuggerPropertiesConfig <> nil) and // The ACTIVE dbg is a known debugger
|
||||||
);
|
(EnvironmentOptions.CurrentDebuggerClass <> nil) and // with existing debugger class
|
||||||
|
(EnvironmentOptions.CurrentDebuggerPropertiesConfig.NeedsExePath) // Does need an exe
|
||||||
|
);
|
||||||
// Debugger
|
// Debugger
|
||||||
FInitialDebuggerFileName := EnvironmentOptions.DebuggerFilename;
|
FInitialDebuggerFileName := EnvironmentOptions.DebuggerFilename;
|
||||||
UpdateDebuggerCandidates;
|
UpdateDebuggerCandidates;
|
||||||
if (not FSkipDebugger) and
|
if (not FSkipDebugger) then begin
|
||||||
( IsFirstStart or (not FileExistsCached(EnvironmentOptions.GetParsedDebuggerFilename)) )
|
if EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil then
|
||||||
then begin
|
EnvironmentOptions.CurrentDebuggerPropertiesConfig :=
|
||||||
// first start => choose first best candidate
|
TDebuggerPropertiesConfig.CreateForDebuggerClass(TGDBMIDebugger);
|
||||||
Candidate:=GetFirstCandidate(FCandidates[sddtDebuggerFilename]);
|
if IsFirstStart or (not FileExistsCached(EnvironmentOptions.GetParsedDebuggerFilename))
|
||||||
if Candidate<>nil then begin
|
then begin
|
||||||
if EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil then
|
// first start => choose first best candidate
|
||||||
EnvironmentOptions.CurrentDebuggerPropertiesConfig :=
|
Candidate:=GetFirstCandidate(FCandidates[sddtDebuggerFilename]);
|
||||||
TDebuggerPropertiesConfig.CreateForDebuggerClass(TGDBMIDebugger);
|
if Candidate<>nil then begin
|
||||||
EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerFilename:=Candidate.Caption;
|
EnvironmentOptions.CurrentDebuggerPropertiesConfig.DebuggerFilename:=Candidate.Caption;
|
||||||
EnvironmentOptions.SaveDebuggerPropertiesList; // Update XML
|
end;
|
||||||
end;
|
end;
|
||||||
|
EnvironmentOptions.SaveDebuggerPropertiesList; // Update XML
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebuggerComboBox.Text:=EnvironmentOptions.DebuggerFilename;
|
DebuggerComboBox.Text:=EnvironmentOptions.DebuggerFilename;
|
||||||
fLastParsedDebugger:='. .';
|
fLastParsedDebugger:='. .';
|
||||||
UpdateDebuggerNote;
|
UpdateDebuggerNote;
|
||||||
|
@ -1434,7 +1434,8 @@ begin
|
|||||||
RegisterDebugger(TGDBMIDebugger); // make sure we can read the config
|
RegisterDebugger(TGDBMIDebugger); // make sure we can read the config
|
||||||
// Todo: add LldbFpDebugger for Mac
|
// Todo: add LldbFpDebugger for Mac
|
||||||
// If the default debugger is of a class that is not yet Registered, then the dialog is not shown
|
// If the default debugger is of a class that is not yet Registered, then the dialog is not shown
|
||||||
if (EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil) // no debugger at all / not even with unknown class
|
if ( (EnvironmentOptions.CurrentDebuggerPropertiesConfig = nil) and // no debugger at all
|
||||||
|
(not EnvironmentOptions.HasActiveDebuggerEntry) ) // not even with unknown class
|
||||||
or ( (EnvironmentOptions.CurrentDebuggerClass <> nil) // Debugger with known class
|
or ( (EnvironmentOptions.CurrentDebuggerClass <> nil) // Debugger with known class
|
||||||
and (EnvironmentOptions.CurrentDebuggerPropertiesConfig.NeedsExePath) // Which does need an exe
|
and (EnvironmentOptions.CurrentDebuggerPropertiesConfig.NeedsExePath) // Which does need an exe
|
||||||
and (CheckDebuggerQuality(EnvironmentOptions.GetParsedDebuggerFilename, Note)<>sddqCompatible)
|
and (CheckDebuggerQuality(EnvironmentOptions.GetParsedDebuggerFilename, Note)<>sddqCompatible)
|
||||||
|
Loading…
Reference in New Issue
Block a user