mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 16:49:35 +01:00
check if debugger path name is an executable to prevent problems like bug #8454
git-svn-id: trunk@10719 -
This commit is contained in:
parent
7847b25113
commit
7b0a38e5ed
@ -992,6 +992,7 @@ type
|
|||||||
public
|
public
|
||||||
class function Caption: String; virtual; // The name of the debugger as shown in the debuggeroptions
|
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 ExePaths: String; virtual; // The default locations of the exe
|
||||||
|
class function HasExePath: boolean; virtual; // If the debugger needs to have an exe path
|
||||||
|
|
||||||
// debugger properties
|
// debugger properties
|
||||||
class function CreateProperties: TDebuggerProperties; virtual; // Creates debuggerproperties
|
class function CreateProperties: TDebuggerProperties; virtual; // Creates debuggerproperties
|
||||||
@ -1372,6 +1373,11 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TDebugger.HasExePath: boolean;
|
||||||
|
begin
|
||||||
|
Result := true; // most debugger are external and have an exe path
|
||||||
|
end;
|
||||||
|
|
||||||
function TDebugger.GetCommands: TDBGCommands;
|
function TDebugger.GetCommands: TDBGCommands;
|
||||||
begin
|
begin
|
||||||
Result := COMMANDMAP[State] * GetSupportedCommands;
|
Result := COMMANDMAP[State] * GetSupportedCommands;
|
||||||
|
|||||||
@ -57,6 +57,7 @@ type
|
|||||||
function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override;
|
function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override;
|
||||||
public
|
public
|
||||||
class function Caption: String; override;
|
class function Caption: String; override;
|
||||||
|
class function HasExePath: boolean; override;
|
||||||
|
|
||||||
published
|
published
|
||||||
end;
|
end;
|
||||||
@ -167,6 +168,11 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TProcessDebugger.HasExePath: boolean;
|
||||||
|
begin
|
||||||
|
Result:= false; // no need to have a valid exe path for the process debugger
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDebugger(TProcessDebugger);
|
RegisterDebugger(TProcessDebugger);
|
||||||
|
|
||||||
|
|||||||
@ -339,9 +339,9 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
Caption = 'Page4'
|
Caption = 'Page4'
|
||||||
object gbSignals: TGroupBox
|
object gbSignals: TGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 354
|
Height = 362
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 454
|
Width = 450
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Signals'
|
Caption = 'Signals'
|
||||||
@ -352,9 +352,9 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = gbSignals
|
AnchorSideBottom.Control = gbSignals
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 369
|
Left = 365
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 302
|
Top = 313
|
||||||
Width = 75
|
Width = 75
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -370,9 +370,9 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
AnchorSideRight.Control = cmdSignalRemove
|
AnchorSideRight.Control = cmdSignalRemove
|
||||||
AnchorSideBottom.Control = gbSignals
|
AnchorSideBottom.Control = gbSignals
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 288
|
Left = 284
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 302
|
Top = 313
|
||||||
Width = 75
|
Width = 75
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -386,9 +386,9 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
object lvSignals: TListView
|
object lvSignals: TListView
|
||||||
AnchorSideBottom.Control = cmdSignalAdd
|
AnchorSideBottom.Control = cmdSignalAdd
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 290
|
Height = 301
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 438
|
Width = 434
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -419,7 +419,7 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
AnchorSideRight.Control = cmdCancel
|
AnchorSideRight.Control = cmdCancel
|
||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 308
|
Left = 311
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 412
|
Top = 412
|
||||||
Width = 75
|
Width = 75
|
||||||
@ -429,8 +429,8 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
Caption = '&OK'
|
Caption = '&OK'
|
||||||
Constraints.MaxHeight = 25
|
Constraints.MaxHeight = 25
|
||||||
Constraints.MinWidth = 75
|
Constraints.MinWidth = 75
|
||||||
|
Default = True
|
||||||
Kind = bkOK
|
Kind = bkOK
|
||||||
ModalResult = 1
|
|
||||||
NumGlyphs = 0
|
NumGlyphs = 0
|
||||||
OnClick = cmdOKCLICK
|
OnClick = cmdOKCLICK
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -440,10 +440,10 @@ object DebuggerOptionsForm: TDebuggerOptionsForm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 389
|
Left = 392
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 412
|
Top = 412
|
||||||
Width = 87
|
Width = 84
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
|||||||
@ -100,47 +100,47 @@ LazarusResources.Add('TDebuggerOptionsForm','FORMDATA',[
|
|||||||
+'Width'#3#198#1#5'Align'#7#8'alBottom'#11'AllowGrayed'#9#7'Anchors'#11#6'akL'
|
+'Width'#3#198#1#5'Align'#7#8'alBottom'#11'AllowGrayed'#9#7'Anchors'#11#6'akL'
|
||||||
+'eft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#27'Break on La'
|
+'eft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#27'Break on La'
|
||||||
+'zarus Exceptions'#8'TabOrder'#2#1#0#0#0#5'TPage'#9'pgSignals'#7'Caption'#6#5
|
+'zarus Exceptions'#8'TabOrder'#2#1#0#0#0#5'TPage'#9'pgSignals'#7'Caption'#6#5
|
||||||
+'Page4'#0#9'TGroupBox'#9'gbSignals'#4'Left'#2#6#6'Height'#3'b'#1#3'Top'#2#6#5
|
+'Page4'#0#9'TGroupBox'#9'gbSignals'#4'Left'#2#6#6'Height'#3'j'#1#3'Top'#2#6#5
|
||||||
+'Width'#3#198#1#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7'Captio'
|
+'Width'#3#194#1#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7'Captio'
|
||||||
+'n'#6#7'Signals'#11'ParentCtl3D'#8#8'TabOrder'#2#0#0#7'TButton'#15'cmdSignal'
|
+'n'#6#7'Signals'#11'ParentCtl3D'#8#8'TabOrder'#2#0#0#7'TButton'#15'cmdSignal'
|
||||||
+'Remove'#23'AnchorSideRight.Control'#7#9'gbSignals'#20'AnchorSideRight.Side'
|
+'Remove'#23'AnchorSideRight.Control'#7#9'gbSignals'#20'AnchorSideRight.Side'
|
||||||
+#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#9'gbSignals'#21'AnchorSideBot'
|
+#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#9'gbSignals'#21'AnchorSideBot'
|
||||||
+'tom.Side'#7#9'asrBottom'#4'Left'#3'q'#1#6'Height'#2#25#3'Top'#3'.'#1#5'Widt'
|
+'tom.Side'#7#9'asrBottom'#4'Left'#3'm'#1#6'Height'#2#25#3'Top'#3'9'#1#5'Widt'
|
||||||
+'h'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpaci'
|
+'h'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpaci'
|
||||||
+'ng.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#6'Remove'#21
|
+'ng.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#6'Remove'#21
|
||||||
+'Constraints.MaxHeight'#2#25#20'Constraints.MinWidth'#2'K'#7'Enabled'#8#8'Ta'
|
+'Constraints.MaxHeight'#2#25#20'Constraints.MinWidth'#2'K'#7'Enabled'#8#8'Ta'
|
||||||
+'bOrder'#2#0#0#0#7'TButton'#12'cmdSignalAdd'#23'AnchorSideRight.Control'#7#15
|
+'bOrder'#2#0#0#0#7'TButton'#12'cmdSignalAdd'#23'AnchorSideRight.Control'#7#15
|
||||||
+'cmdSignalRemove'#24'AnchorSideBottom.Control'#7#9'gbSignals'#21'AnchorSideB'
|
+'cmdSignalRemove'#24'AnchorSideBottom.Control'#7#9'gbSignals'#21'AnchorSideB'
|
||||||
+'ottom.Side'#7#9'asrBottom'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3'.'#1#5'Wi'
|
+'ottom.Side'#7#9'asrBottom'#4'Left'#3#28#1#6'Height'#2#25#3'Top'#3'9'#1#5'Wi'
|
||||||
+'dth'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpa'
|
+'dth'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpa'
|
||||||
+'cing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Add'#21'C'
|
+'cing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Add'#21'C'
|
||||||
+'onstraints.MaxHeight'#2#25#20'Constraints.MinWidth'#2'K'#8'TabOrder'#2#1#0#0
|
+'onstraints.MaxHeight'#2#25#20'Constraints.MinWidth'#2'K'#8'TabOrder'#2#1#0#0
|
||||||
+#9'TListView'#9'lvSignals'#24'AnchorSideBottom.Control'#7#12'cmdSignalAdd'#4
|
+#9'TListView'#9'lvSignals'#24'AnchorSideBottom.Control'#7#12'cmdSignalAdd'#4
|
||||||
+'Left'#2#6#6'Height'#3'"'#1#3'Top'#2#6#5'Width'#3#182#1#5'Align'#7#5'alTop'#7
|
+'Left'#2#6#6'Height'#3'-'#1#3'Top'#2#6#5'Width'#3#178#1#5'Align'#7#5'alTop'#7
|
||||||
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Ar'
|
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Ar'
|
||||||
+'ound'#2#6#7'Columns'#14#1#7'Caption'#6#4'Name'#5'Width'#3#200#0#0#1#7'Capti'
|
+'ound'#2#6#7'Columns'#14#1#7'Caption'#6#4'Name'#5'Width'#3#200#0#0#1#7'Capti'
|
||||||
+'on'#6#2'ID'#0#1#7'Caption'#6#10'Handled by'#5'Width'#2'K'#0#1#7'Caption'#6#6
|
+'on'#6#2'ID'#0#1#7'Caption'#6#10'Handled by'#5'Width'#2'K'#0#1#7'Caption'#6#6
|
||||||
+'Resume'#5'Width'#2#5#0#0#9'PopupMenu'#7#9'popSignal'#8'TabOrder'#2#2#9'View'
|
+'Resume'#5'Width'#2#5#0#0#9'PopupMenu'#7#9'popSignal'#8'TabOrder'#2#2#9'View'
|
||||||
+'Style'#7#8'vsReport'#0#0#0#0#0#7'TBitBtn'#5'cmdOK'#23'AnchorSideRight.Contr'
|
+'Style'#7#8'vsReport'#0#0#0#0#0#7'TBitBtn'#5'cmdOK'#23'AnchorSideRight.Contr'
|
||||||
+'ol'#7#9'cmdCancel'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBot'
|
+'ol'#7#9'cmdCancel'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBot'
|
||||||
+'tom.Side'#7#9'asrBottom'#4'Left'#3'4'#1#6'Height'#2#25#3'Top'#3#156#1#5'Wid'
|
+'tom.Side'#7#9'asrBottom'#4'Left'#3'7'#1#6'Height'#2#25#3'Top'#3#156#1#5'Wid'
|
||||||
+'th'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpac'
|
+'th'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpac'
|
||||||
+'ing.Around'#2#6#7'Caption'#6#3'&OK'#21'Constraints.MaxHeight'#2#25#20'Const'
|
+'ing.Around'#2#6#7'Caption'#6#3'&OK'#21'Constraints.MaxHeight'#2#25#20'Const'
|
||||||
+'raints.MinWidth'#2'K'#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0
|
+'raints.MinWidth'#2'K'#7'Default'#9#4'Kind'#7#4'bkOK'#9'NumGlyphs'#2#0#7'OnC'
|
||||||
+#7'OnClick'#7#10'cmdOKCLICK'#8'TabOrder'#2#1#0#0#7'TBitBtn'#9'cmdCancel'#23
|
+'lick'#7#10'cmdOKCLICK'#8'TabOrder'#2#1#0#0#7'TBitBtn'#9'cmdCancel'#23'Ancho'
|
||||||
+'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'
|
+'rSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'A'
|
||||||
,#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBo'
|
,'nchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'
|
||||||
+'ttom'#4'Left'#3#133#1#6'Height'#2#25#3'Top'#3#156#1#5'Width'#2'W'#7'Anchors'
|
+#4'Left'#3#136#1#6'Height'#2#25#3'Top'#3#156#1#5'Width'#2'T'#7'Anchors'#11#7
|
||||||
+#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6'Ca'
|
+'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#6'Cancel'
|
||||||
+'ncel'#9#7'Caption'#6#6'Cancel'#21'Constraints.MaxHeight'#2#25#20'Constraint'
|
+#9#7'Caption'#6#6'Cancel'#21'Constraints.MaxHeight'#2#25#20'Constraints.MinW'
|
||||||
+'s.MinWidth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0
|
+'idth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'Tab'
|
||||||
+#8'TabOrder'#2#2#0#0#10'TPopupMenu'#9'popSignal'#4'left'#2#8#3'top'#3#192#1#0
|
+'Order'#2#2#0#0#10'TPopupMenu'#9'popSignal'#4'left'#2#8#3'top'#3#192#1#0#9'T'
|
||||||
+#9'TMenuItem'#19'mnuHandledByProgram'#9'AutoCheck'#9#7'Caption'#6#18'Handled'
|
+'MenuItem'#19'mnuHandledByProgram'#9'AutoCheck'#9#7'Caption'#6#18'Handled by'
|
||||||
+' by Program'#10'GroupIndex'#2#1#9'RadioItem'#9#0#0#9'TMenuItem'#21'mnuiHand'
|
+' Program'#10'GroupIndex'#2#1#9'RadioItem'#9#0#0#9'TMenuItem'#21'mnuiHandled'
|
||||||
+'ledByDebugger'#9'AutoCheck'#9#7'Caption'#6#19'Handled by Debugger'#10'Group'
|
+'ByDebugger'#9'AutoCheck'#9#7'Caption'#6#19'Handled by Debugger'#10'GroupInd'
|
||||||
+'Index'#2#1#9'RadioItem'#9#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TM'
|
+'ex'#2#1#9'RadioItem'#9#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TMenu'
|
||||||
+'enuItem'#16'mnuResumeHandled'#9'AutoCheck'#9#7'Caption'#6#14'Resume Handled'
|
+'Item'#16'mnuResumeHandled'#9'AutoCheck'#9#7'Caption'#6#14'Resume Handled'#10
|
||||||
+#10'GroupIndex'#2#2#9'RadioItem'#9#0#0#9'TMenuItem'#18'mnuResumeUnhandled'#9
|
+'GroupIndex'#2#2#9'RadioItem'#9#0#0#9'TMenuItem'#18'mnuResumeUnhandled'#9'Au'
|
||||||
+'AutoCheck'#9#7'Caption'#6#16'Resume Unhandled'#10'GroupIndex'#2#2#9'RadioIt'
|
+'toCheck'#9#7'Caption'#6#16'Resume Unhandled'#10'GroupIndex'#2#2#9'RadioItem'
|
||||||
+'em'#9#0#0#0#0
|
+#9#0#0#0#0
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -103,6 +103,7 @@ type
|
|||||||
FCurDebuggerClass: TDebuggerClass; // currently shown debugger class
|
FCurDebuggerClass: TDebuggerClass; // currently shown debugger class
|
||||||
procedure AddExceptionLine(const AException: TIDEException; AName: String);
|
procedure AddExceptionLine(const AException: TIDEException; AName: String);
|
||||||
procedure AddSignalLine(const ASignal: TIDESignal);
|
procedure AddSignalLine(const ASignal: TIDESignal);
|
||||||
|
function CheckValues: boolean;
|
||||||
procedure FetchDebuggerClass;
|
procedure FetchDebuggerClass;
|
||||||
procedure FetchDebuggerGeneralOptions;
|
procedure FetchDebuggerGeneralOptions;
|
||||||
procedure FetchDebuggerSpecificOptions;
|
procedure FetchDebuggerSpecificOptions;
|
||||||
@ -147,6 +148,19 @@ begin
|
|||||||
Item.Data := ASignal;
|
Item.Data := ASignal;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDebuggerOptionsForm.CheckValues: boolean;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
|
||||||
|
if assigned(FCurDebuggerClass) and FCurDebuggerClass.HasExePath and
|
||||||
|
not CheckExecutable(FOldDebuggerPathAndParams,cmbDebuggerPath.Text,
|
||||||
|
lisEnvOptDlgInvalidDebuggerFilename,
|
||||||
|
lisEnvOptDlgInvalidDebuggerFilenameMsg)
|
||||||
|
then exit;
|
||||||
|
|
||||||
|
Result := true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDebuggerOptionsForm.FetchDebuggerClass;
|
procedure TDebuggerOptionsForm.FetchDebuggerClass;
|
||||||
var
|
var
|
||||||
n: PtrInt;
|
n: PtrInt;
|
||||||
@ -290,6 +304,8 @@ var
|
|||||||
n: Integer;
|
n: Integer;
|
||||||
ie: TIDEException;
|
ie: TIDEException;
|
||||||
begin
|
begin
|
||||||
|
if not CheckValues then exit;
|
||||||
|
|
||||||
for n := 0 to FExceptionDeleteList.Count - 1 do
|
for n := 0 to FExceptionDeleteList.Count - 1 do
|
||||||
FExceptionDeleteList.Objects[n].Free;
|
FExceptionDeleteList.Objects[n].Free;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user