mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 15:20:29 +02:00
Debugger-Config: Allow individual LRU list for gdb vs lldb
git-svn-id: trunk@61554 -
This commit is contained in:
parent
37f5929a08
commit
ff1657deea
@ -200,6 +200,7 @@ type
|
||||
*)
|
||||
|
||||
TDebuggerIntf = class;
|
||||
TDebuggerClass = class of TDebuggerIntf;
|
||||
TDebuggerDataSupplier = class;
|
||||
|
||||
{ TDebuggerDataHandler }
|
||||
@ -1888,6 +1889,7 @@ type
|
||||
public
|
||||
class function Caption: String; virtual; // The name of the debugger as shown in the debuggeroptions
|
||||
class function ExePaths: String; virtual; // The default locations of the exe
|
||||
class function ExePathsMruGroup: TDebuggerClass; 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 RequiredCompilerOpts(ATargetCPU, ATargetOS: String): TDebugCompilerRequirements; virtual;
|
||||
@ -1986,7 +1988,6 @@ type
|
||||
property OnFeedback: TDBGFeedbackEvent read FOnFeedback write FOnFeedback;
|
||||
property OnIdle: TNotifyEvent read FOnIdle write FOnIdle; // Called if all outstanding requests are processed (queue empty)
|
||||
end;
|
||||
TDebuggerClass = class of TDebuggerIntf;
|
||||
|
||||
{ TBaseDebugManagerIntf }
|
||||
|
||||
@ -6050,6 +6051,11 @@ begin
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
class function TDebuggerIntf.ExePathsMruGroup: TDebuggerClass;
|
||||
begin
|
||||
Result := Self;
|
||||
end;
|
||||
|
||||
class function TDebuggerIntf.HasExePath: boolean;
|
||||
begin
|
||||
Result := NeedsExePath;
|
||||
|
@ -975,6 +975,7 @@ type
|
||||
class function CreateProperties: TDebuggerProperties; override; // Creates debuggerproperties
|
||||
class function Caption: String; override;
|
||||
class function ExePaths: String; override;
|
||||
class function ExePathsMruGroup: TDebuggerClass; override;
|
||||
|
||||
constructor Create(const AExternalDebugger: String); override;
|
||||
destructor Destroy; override;
|
||||
@ -8635,6 +8636,11 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
class function TGDBMIDebuggerBase.ExePathsMruGroup: TDebuggerClass;
|
||||
begin
|
||||
Result := TGDBMIDebugger;
|
||||
end;
|
||||
|
||||
function TGDBMIDebuggerBase.FindBreakpoint(
|
||||
const ABreakpoint: Integer): TDBGBreakPoint;
|
||||
var
|
||||
|
@ -371,6 +371,7 @@ type
|
||||
class function CreateProperties: TDebuggerProperties; override; // Creates debuggerproperties
|
||||
class function Caption: String; override;
|
||||
class function ExePaths: String; override;
|
||||
class function ExePathsMruGroup: TDebuggerClass; override;
|
||||
|
||||
constructor Create(const AExternalDebugger: String); override;
|
||||
destructor Destroy; override;
|
||||
@ -3052,6 +3053,11 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
class function TLldbDebugger.ExePathsMruGroup: TDebuggerClass;
|
||||
begin
|
||||
Result := TLldbDebugger;
|
||||
end;
|
||||
|
||||
constructor TLldbDebugger.Create(const AExternalDebugger: String);
|
||||
begin
|
||||
inherited Create(AExternalDebugger);
|
||||
|
@ -73,6 +73,7 @@ type
|
||||
procedure tbDeleteClick(Sender: TObject);
|
||||
procedure tbSelectClick(Sender: TObject);
|
||||
private
|
||||
FDebuggerFileHistory: TStringList;
|
||||
FInOdNameExit: Boolean;
|
||||
PropertyGrid: TOIPropertyGrid;
|
||||
FPropertyEditorHook: TPropertyEditorHook;
|
||||
@ -125,14 +126,12 @@ begin
|
||||
ParsedFName := EnvironmentOptions.GetParsedValue(eopDebuggerFilename, FLastCheckedDebuggerPath);
|
||||
if ParsedFName = '' then
|
||||
ParsedFName := FLastCheckedDebuggerPath;
|
||||
DebugLn(['############### ',ParsedFName]);
|
||||
if not CheckExecutable(FSelectedDbgPropertiesConfig.DebuggerFilename, ParsedFName,
|
||||
lisEnvOptDlgInvalidDebuggerFilename,
|
||||
lisEnvOptDlgInvalidDebuggerFilenameMsg)
|
||||
then
|
||||
exit;
|
||||
end;
|
||||
DebugLn(['<<<<<<<<<< ###### ',FSelectedDbgPropertiesConfig.DebuggerFilename ,' << ', cmbDebuggerPath.Text]);
|
||||
|
||||
FSelectedDbgPropertiesConfig.DebuggerFilename := cmbDebuggerPath.Text;
|
||||
end;
|
||||
@ -312,6 +311,7 @@ end;
|
||||
procedure TDebuggerClassOptionsFrame.UpdateDebuggerClass;
|
||||
var
|
||||
c: TDebuggerClass;
|
||||
i: Integer;
|
||||
begin
|
||||
if FSelectedDbgPropertiesConfig = nil then
|
||||
exit;
|
||||
@ -319,6 +319,12 @@ begin
|
||||
if SelectedDebuggerClass = c then
|
||||
exit;
|
||||
|
||||
i := FDebuggerFileHistory.IndexOf(SelectedDebuggerClass.ExePathsMruGroup.ClassName);
|
||||
Assert(i>0, 'Missing dbg lru');
|
||||
if i > 0 then // should always be
|
||||
TStringList(FDebuggerFileHistory.Objects[i]).Assign(cmbDebuggerPath.Items);
|
||||
|
||||
|
||||
FSelectedDbgPropertiesConfig.ChangeDebuggerClass(c, True);
|
||||
// TOOD: Ask user?
|
||||
FSelectedDbgPropertiesConfig.ConfigName := GetUniqueName(FSelectedDbgPropertiesConfig.ConfigName);
|
||||
@ -359,6 +365,8 @@ procedure TDebuggerClassOptionsFrame.FetchDebuggerSpecificOptions;
|
||||
var
|
||||
S, S2, S3: String;
|
||||
Prop: TDebuggerProperties;
|
||||
lru: TStringList;
|
||||
i: Integer;
|
||||
begin
|
||||
PropertyGrid.Selection.Clear;
|
||||
|
||||
@ -369,10 +377,19 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
i := FDebuggerFileHistory.IndexOf(SelectedDebuggerClass.ExePathsMruGroup.ClassName);
|
||||
if i >= 0 then begin
|
||||
lru := TStringList(FDebuggerFileHistory.Objects[i]);
|
||||
end
|
||||
else begin
|
||||
lru := TStringList.Create;
|
||||
lru.Assign(EnvironmentOptions.DebuggerFileHistory[SelectedDebuggerClass.ExePathsMruGroup.ClassName]);
|
||||
FDebuggerFileHistory.AddObject(SelectedDebuggerClass.ExePathsMruGroup.ClassName, lru);
|
||||
end;
|
||||
|
||||
with cmbDebuggerPath.Items do begin
|
||||
BeginUpdate;
|
||||
Assign(EnvironmentOptions.DebuggerFileHistory);
|
||||
Assign(lru);
|
||||
if (Count = 0)
|
||||
and (SelectedDebuggerClass <> nil)
|
||||
then begin
|
||||
@ -390,7 +407,6 @@ begin
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
debugln(['>>>### ',FSelectedDbgPropertiesConfig.DebuggerFilename,cstFilename]);
|
||||
SetComboBoxText(cmbDebuggerPath,FSelectedDbgPropertiesConfig.DebuggerFilename,cstFilename,20);
|
||||
edName.Text := FSelectedDbgPropertiesConfig.ConfigName;
|
||||
|
||||
@ -515,6 +531,8 @@ begin
|
||||
FPropertyEditorHook:=TPropertyEditorHook.Create(Self);
|
||||
FPropertyEditorHook.AddHandlerGetCheckboxForBoolean(@HookGetCheckboxForBoolean);
|
||||
|
||||
FDebuggerFileHistory := TStringList.Create;
|
||||
FDebuggerFileHistory.OwnsObjects := True;
|
||||
FCopiedDbgPropertiesConfigList := TDebuggerPropertiesConfigList.Create;
|
||||
FCopiedDbgPropertiesConfigList.CaseSensitive := False;
|
||||
// create the PropertyGrid
|
||||
@ -543,6 +561,7 @@ begin
|
||||
PropertyGrid.Selection.Clear;
|
||||
FreeAndNil(FPropertyEditorHook);
|
||||
FreeAndNil(FCopiedDbgPropertiesConfigList);
|
||||
FreeAndNil(FDebuggerFileHistory);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -555,7 +574,6 @@ begin
|
||||
UpdateDebuggerClass; // TODO: might edit the name
|
||||
FLastCheckedDebuggerPath := 'X'+cmbDebuggerPath.Text; // ensure a new check is done
|
||||
cmbDebuggerPathEditingDone(nil);
|
||||
debugln(['############### >',FSelectedDbgPropertiesConfig.DebuggerFilename, '< ## >', cmbDebuggerPath.Text, '< #']);
|
||||
|
||||
Result := (FSelectedDbgPropertiesConfig.DebuggerFilename = cmbDebuggerPath.Text);
|
||||
end;
|
||||
@ -585,6 +603,7 @@ begin
|
||||
begin
|
||||
ObjectInspectorOptions.AssignTo(PropertyGrid);
|
||||
|
||||
FDebuggerFileHistory.Clear;
|
||||
FCopiedDbgPropertiesConfigList.ClearAll;
|
||||
for i := 0 to DebuggerPropertiesConfigList.Count - 1 do
|
||||
FCopiedDbgPropertiesConfigList.AddObject(DebuggerPropertiesConfigList[i],
|
||||
@ -609,7 +628,9 @@ var
|
||||
begin
|
||||
with EnvironmentOptions do
|
||||
begin
|
||||
DebuggerFileHistory.Assign(cmbDebuggerPath.Items);
|
||||
for i := 0 to FDebuggerFileHistory.Count - 1 do
|
||||
DebuggerFileHistory[FDebuggerFileHistory[i]].Assign(TStringList(FDebuggerFileHistory.Objects[i]));
|
||||
|
||||
// DebuggerSearchPath := TrimSearchPath(txtAdditionalPath.Text,'');
|
||||
|
||||
EnvConf := DebuggerPropertiesConfigList;
|
||||
|
@ -727,6 +727,7 @@ type
|
||||
function GetMakeFilename: string;
|
||||
function GetMsgColors(u: TMessageLineUrgency): TColor;
|
||||
function GetMsgViewColors(c: TMsgWndColor): TColor;
|
||||
function GetNamedDebuggerFileHistory(AnIndex: String): TStringList;
|
||||
function GetSubConfig(Index: Integer): TIDESubOptions;
|
||||
function GetTestBuildDirectory: string;
|
||||
function GetFppkgConfigFile: string;
|
||||
@ -891,7 +892,7 @@ type
|
||||
property MakeFilename: string read GetMakeFilename write SetMakeFilename;
|
||||
property MakeFileHistory: TStringList read FMakeFileHistory;
|
||||
property DebuggerFilename: string read GetDebuggerFilename;
|
||||
property DebuggerFileHistory: TStringList read FDebuggerFileHistory;
|
||||
property DebuggerFileHistory[AnIndex: String]: TStringList read GetNamedDebuggerFileHistory;
|
||||
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
||||
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
||||
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun write FDebuggerResetAfterRun;
|
||||
@ -2101,6 +2102,7 @@ begin
|
||||
MakeFilename:=DefaultMakefilename;
|
||||
FMakeFileHistory:=TStringList.Create;
|
||||
FDebuggerFileHistory:=TStringList.Create;
|
||||
FDebuggerFileHistory.OwnsObjects := True;
|
||||
FDebuggerProperties := TDebuggerPropertiesConfigList.Create;
|
||||
FDebuggerEventLogColors:=DebuggerDefaultColors;
|
||||
FppkgConfigFile:='';
|
||||
@ -2339,6 +2341,7 @@ procedure TEnvironmentOptions.LoadNonDesktop(Path: String);
|
||||
|
||||
var
|
||||
EventType: TDBGEventType;
|
||||
i: Integer;
|
||||
begin
|
||||
// files
|
||||
LazarusDirectory:=FXMLCfg.GetValue(Path+'LazarusDirectory/Value',LazarusDirectory);
|
||||
@ -2388,7 +2391,10 @@ begin
|
||||
// Debugger
|
||||
// DO not call LoadDebuggerProperties; => not all debuggers are registered when this is first called
|
||||
FDebuggerConfig.Load;
|
||||
LoadRecentList(FXMLCfg,FDebuggerFileHistory,Path+'DebuggerFilename/History/',rltFile);
|
||||
if FXMLCfg.HasPath(Path+'DebuggerFilename/History', False) then begin
|
||||
i := FDebuggerFileHistory.AddObject('', TStringList.Create);
|
||||
LoadRecentList(FXMLCfg,TStrings(FDebuggerFileHistory.Objects[i]),Path+'DebuggerFilename/History/',rltFile);
|
||||
end;
|
||||
DebuggerSearchPath:=FXMLCfg.GetValue(Path+'DebuggerSearchPath/Value','');
|
||||
// Debugger General Options
|
||||
DebuggerShowStopMessage:=FXMLCfg.GetValue(Path+'DebuggerOptions/ShowStopMessage/Value', True);
|
||||
@ -2726,6 +2732,7 @@ procedure TEnvironmentOptions.SaveNonDesktop(Path: String);
|
||||
var
|
||||
BaseDir, CurLazDir: String;
|
||||
EventType: TDBGEventType;
|
||||
i: Integer;
|
||||
begin
|
||||
// files
|
||||
CurLazDir:=ChompPathDelim(LazarusDirectory);
|
||||
@ -2784,7 +2791,12 @@ begin
|
||||
FDebuggerResetAfterRun, False);
|
||||
FXMLCfg.SetDeleteValue(Path+'DebuggerOptions/DebuggerAutoCloseAsm/Value',
|
||||
FDebuggerAutoCloseAsm, False);
|
||||
SaveRecentList(FXMLCfg,FDebuggerFileHistory,Path+'DebuggerFilename/History/');
|
||||
for i := 0 to FDebuggerFileHistory.Count -1 do
|
||||
if FDebuggerFileHistory[i] = '' then
|
||||
SaveRecentList(FXMLCfg,TStrings(FDebuggerFileHistory.Objects[i]),Path+'DebuggerFilename/History/')
|
||||
else
|
||||
SaveRecentList(FXMLCfg,TStrings(FDebuggerFileHistory.Objects[i]),
|
||||
Path+'DebuggerFilename/'+FDebuggerFileHistory[i]+'/History/');
|
||||
FXMLCfg.SetDeleteValue(Path+'DebuggerSearchPath/Value',DebuggerSearchPath,'');
|
||||
FXMLCfg.SetDeleteValue(Path+'Debugger/EventLogClearOnRun',FDebuggerEventLogClearOnRun, True);
|
||||
FXMLCfg.SetDeleteValue(Path+'Debugger/EventLogCheckLineLimit',FDebuggerEventLogCheckLineLimit, False);
|
||||
@ -3776,6 +3788,22 @@ begin
|
||||
Result:=fMsgViewColors[c];
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetNamedDebuggerFileHistory(AnIndex: String
|
||||
): TStringList;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i := FDebuggerFileHistory.IndexOf(AnIndex);
|
||||
if i < 0 then begin
|
||||
i := FDebuggerFileHistory.AddObject(AnIndex, TStringList.Create);
|
||||
if FXMLCfg.HasPath('EnvironmentOptions/DebuggerFilename/'+AnIndex+'/History', False) then
|
||||
LoadRecentList(FXMLCfg,TStrings(FDebuggerFileHistory.Objects[i]),'EnvironmentOptions/DebuggerFilename/'+AnIndex+'/History/',rltFile)
|
||||
else
|
||||
TStrings(FDebuggerFileHistory.Objects[i]).Assign(DebuggerFileHistory['']); // init from old list
|
||||
end;
|
||||
Result := TStringList(FDebuggerFileHistory.Objects[i]);
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetSubConfig(Index: Integer): TIDESubOptions;
|
||||
begin
|
||||
Result := TIDESubOptions(fRegisteredSubConfig[Index]);
|
||||
|
@ -356,7 +356,9 @@ begin
|
||||
end;
|
||||
|
||||
// check history
|
||||
Files:=EnvironmentOptions.DebuggerFileHistory;
|
||||
Files:=EnvironmentOptions.DebuggerFileHistory[CurDbgClassName];
|
||||
if (Files=nil) or (Files.Count=0) then
|
||||
Files:=EnvironmentOptions.DebuggerFileHistory[''];
|
||||
if Files<>nil then
|
||||
for i:=0 to Files.Count-1 do
|
||||
if CheckFile(Files[i],Result) then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user