+ Added option to skip compiler step on compile, build or run

* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)

git-svn-id: trunk@5918 -
This commit is contained in:
marc 2004-09-04 21:54:08 +00:00
parent 9f010fcf41
commit 90b8b206c0
16 changed files with 3318 additions and 2789 deletions

1
.gitattributes vendored
View File

@ -556,6 +556,7 @@ ide/codetoolsdefpreview.pas svneol=native#text/pascal
ide/codetoolsoptions.pas svneol=native#text/pascal
ide/compiler.pp svneol=native#text/pascal
ide/compileroptions.pp svneol=native#text/pascal
ide/compileroptionsdlg.pp svneol=native#text/pascal
ide/componentpalette.pas svneol=native#text/pascal
ide/condef.lfm svneol=native#text/plain
ide/condef.lrs svneol=native#text/pascal

View File

@ -263,7 +263,6 @@ end;
destructor TCmdLineDebugger.Destroy;
begin
FreeAndNil(FLineEnds);
inherited;
try
FDbgProcess.Free;
@ -271,6 +270,7 @@ begin
except
on E: Exception do WriteLN('Exeption while freeing debugger: ', E.Message);
end;
FreeAndNil(FLineEnds);
end;
procedure TCmdLineDebugger.Flush;
@ -435,6 +435,11 @@ initialization
end.
{ =============================================================================
$Log$
Revision 1.34 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.33 2004/03/13 00:01:53 marc
* fixed debugtarget PID parsing (for win32)

View File

@ -85,6 +85,7 @@ type
FCommandQueue: TStringList;
FTargetPID: Integer;
FBreakErrorBreakID: Integer;
FRunErrorBreakID: Integer;
FExceptionBreakID: Integer;
FVersion: String;
FPauseWaitState: TGDBMIPauseWaitState;
@ -409,6 +410,7 @@ end;
constructor TGDBMIDebugger.Create(const AExternalDebugger: String);
begin
FBreakErrorBreakID := -1;
FRunErrorBreakID := -1;
FExceptionBreakID := -1;
FCommandQueue := TStringList.Create;
FTargetPID := 0;
@ -1230,11 +1232,15 @@ function TGDBMIDebugger.ProcessStopped(const AParams: String; const AIgnoreSigIn
ErrorNo: Integer;
Location: TDBGLocationRec;
begin
ErrorNo := Integer(GetData('$fp+8', []));
if tfRTLUsesRegCall in FTargetFlags
then ErrorNo := GetIntValue('$eax', [])
else ErrorNo := Integer(GetData('$fp+8', []));
Location.SrcLine := -1;
Location.SrcFile := '';
Location.Address := GetData('$fp+12', []);
if tfRTLUsesRegCall in FTargetFlags
then Location.Address := Pointer(GetIntValue('$edx', []))
else Location.Address := GetData('$fp+12', []);
Location.FuncName := '';
if ExecuteCommand('info line * pointer(%d)', [Integer(Location.Address)], S, [cfIgnoreError, cfNoMiCommand])
then begin
@ -1246,6 +1252,30 @@ function TGDBMIDebugger.ProcessStopped(const AParams: String; const AIgnoreSigIn
DoCurrent(Location);
end;
procedure ProcessRunError;
var
S: String;
ErrorNo: Integer;
List: TStrings;
begin
if tfRTLUsesRegCall in FTargetFlags
then ErrorNo := GetIntValue('$eax', [])
else ErrorNo := Integer(GetData('$fp+8', []));
DoException(Format('RunError(%d)', [ErrorNo]), '');
if ExecuteCommand('-stack-list-frames 1 1', [], S, [cfIgnoreError])
then begin
List := CreateMIValueList(S);
S := List.Values['stack'];
FreeAndNil(List);
List := CreateMIValueList(S);
S := List.Values['frame'];
FreeAndNil(List);
ProcessFrame(S);
end;
end;
procedure ProcessSignalReceived(const AList: TStringList);
var
SigInt: Boolean;
@ -1322,6 +1352,13 @@ begin
Exit;
end;
if BreakID = FRunErrorBreakID
then begin
SetState(dsPause);
ProcessRunError;
Exit;
end;
if BreakID = FExceptionBreakID
then begin
SetState(dsPause);
@ -1444,11 +1481,27 @@ function TGDBMIDebugger.StartDebugging(const AContinueCommand: String): Boolean;
// params are passes by stack
Exclude(FTargetFlags, tfRTLUsesRegCall);
end;
function InsertBreakPoint(const AName: String): Integer;
var
S: String;
ResultList, BkptList: TStringList;
ResultState: TDBGState;
begin
ExecuteCommand('-break-insert %s', [AName], ResultState, S, [cfIgnoreError]);
if ResultState <> dsError
then begin
ResultList := CreateMIValueList(S);
BkptList := CreateMIValueList(ResultList.Values['bkpt']);
Result := StrToIntDef(BkptList.Values['number'], -1);
ResultList.Free;
BkptList.Free;
end;
end;
var
S, FileType, EntryPoint: String;
ResultState: TDBGState;
ResultList, BkptList: TStringList;
TargetPIDPart: String;
TempInstalled: Boolean;
begin
@ -1482,35 +1535,15 @@ begin
TempInstalled := False;
end;
// try to insert Exception breakpoint
// we might have rtl symbols
if FExceptionBreakID = -1
then begin
ExecuteCommand('-break-insert FPC_RAISEEXCEPTION', [], ResultState, S, [cfIgnoreError]);
if ResultState <> dsError
then begin
ResultList := CreateMIValueList(S);
BkptList := CreateMIValueList(ResultList.Values['bkpt']);
FExceptionBreakID := StrToIntDef(BkptList.Values['number'], -1);
ResultList.Free;
BkptList.Free;
end;
end;
// try Insert Break breakpoint
// we might have rtl symbols
if FExceptionBreakID = -1
then FExceptionBreakID := InsertBreakPoint('FPC_RAISEEXCEPTION');
if FBreakErrorBreakID = -1
then begin
ExecuteCommand('-break-insert FPC_BREAK_ERROR', [], ResultState, S, [cfIgnoreError]);
if ResultState <> dsError
then begin
ResultList := CreateMIValueList(S);
BkptList := CreateMIValueList(ResultList.Values['bkpt']);
FBreakErrorBreakID := StrToIntDef(BkptList.Values['number'], -1);
ResultList.Free;
BkptList.Free;
end;
end;
then FBreakErrorBreakID := InsertBreakPoint('FPC_BREAK_ERROR');
if FRunErrorBreakID = -1
then FRunErrorBreakID := InsertBreakPoint('FPC_RUNERROR');
// try to retrieve the filetype and program entry point
if ExecuteCommand('info file', [], ResultState, S, [cfIgnoreError, cfNoMICommand])
@ -2250,6 +2283,11 @@ initialization
end.
{ =============================================================================
$Log$
Revision 1.49 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.48 2004/08/26 23:50:05 marc
* Restructured debugger view classes
* Fixed help

View File

@ -81,7 +81,8 @@ type
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); virtual; abstract;
function DoInitDebugger: TModalResult; virtual; abstract;
function InitDebugger: Boolean; virtual; abstract;
function DoPauseProject: TModalResult; virtual; abstract;
function DoStepIntoProject: TModalResult; virtual; abstract;
function DoStepOverProject: TModalResult; virtual; abstract;
@ -169,6 +170,11 @@ end.
{ =============================================================================
$Log$
Revision 1.21 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.20 2004/08/26 23:50:04 marc
* Restructured debugger view classes
* Fixed help

File diff suppressed because it is too large Load Diff

2786
ide/compileroptionsdlg.pp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -111,6 +111,7 @@ type
procedure InitLocalsDlg;
procedure InitCallStackDlg;
procedure FreeDebugger;
protected
function GetState: TDBGState; override;
function GetCommands: TDBGCommands; override;
@ -127,7 +128,8 @@ type
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); override;
procedure ClearDebugOutputLog;
function DoInitDebugger: TModalResult; override;
function InitDebugger: Boolean; override;
function DoPauseProject: TModalResult; override;
function DoStepIntoProject: TModalResult; override;
function DoStepOverProject: TModalResult; override;
@ -216,6 +218,8 @@ type
procedure AssignTo(Dest: TPersistent); override;
function GetValid: TValidState; override;
function GetValue: String; override;
procedure SetEnabled(const AValue: Boolean); override;
procedure SetExpression(const AValue: String); override;
public
constructor Create(ACollection: TCollection); override;
procedure ResetMaster;
@ -442,6 +446,20 @@ begin
else Result := FMaster.GetValue;
end;
procedure TManagedWatch.SetEnabled(const AValue: Boolean);
begin
if Enabled = AValue then Exit;
inherited SetEnabled(AValue);
if FMaster <> nil then FMaster.Enabled := AValue;
end;
procedure TManagedWatch.SetExpression(const AValue: String);
begin
if AValue = Expression then Exit;
inherited SetExpression(AValue);
if FMaster <> nil then FMaster.Expression := AValue;
end;
constructor TManagedWatch.Create(ACollection: TCollection);
begin
inherited Create(ACollection);
@ -977,8 +995,8 @@ begin
if OldState = dsNone then Exit;
EndDebugging;
OnDebuggerChangeState(FDebugger, OldState);
DoInitDebugger;
// OnDebuggerChangeState(FDebugger, OldState);
// InitDebugger;
end;
procedure TDebugManager.mnuDebuggerOptionsClick(Sender: TObject);
@ -1116,21 +1134,20 @@ begin
end;
case FDebugger.State of
dsError:
begin
dsError: begin
WriteLN('Ooops, the debugger entered the error state');
MessageDlg(lisDebuggerError,
Format(lisDebuggerErrorOoopsTheDebuggerEnteredTheErrorState, [#13#13,
#13, #13#13]),
mtError, [mbOK],0);
end;
dsStop:
if (OldState<>dsIdle) then begin
MessageDlg(lisExecutionStopped,
Format(lisExecutionStoppedOn, [#13#13]),
mtInformation, [mbOK],0);
dsStop: begin
if (OldState<>dsIdle)
then begin
MessageDlg(lisExecutionStopped,
Format(lisExecutionStoppedOn, [#13#13]),
mtInformation, [mbOK],0);
end;
end;
end;
@ -1529,17 +1546,20 @@ end;
// Debugger routines
//-----------------------------------------------------------------------------
function TDebugManager.DoInitDebugger: TModalResult;
procedure FreeDebugger;
var
dbg: TDebugger;
begin
dbg := FDebugger;
SetDebugger(nil);
dbg.Free;
Exclude(FManagerStates,dmsDebuggerObjectBroken);
end;
procedure TDebugManager.FreeDebugger;
var
dbg: TDebugger;
begin
dbg := FDebugger;
SetDebugger(nil);
dbg.Free;
FManagerStates := [];
if MainIDE.ToolStatus = itDebugger
then MainIDE.ToolStatus := itNone;
end;
function TDebugManager.InitDebugger: Boolean;
var
LaunchingCmdLine, LaunchingApplication, LaunchingParams: String;
NewWorkingDir: String;
@ -1547,19 +1567,27 @@ var
begin
WriteLN('[TDebugManager.DoInitDebugger] A');
Result:=mrCancel;
Result := False;
if (Project1.MainUnitID < 0) or Destroying then Exit;
LaunchingCmdLine:=MainIDE.GetRunCommandLine;
SplitCmdLine(LaunchingCmdLine,LaunchingApplication,LaunchingParams);
if (not FileExists(LaunchingApplication)) then exit;
LaunchingCmdLine := MainIDE.GetRunCommandLine;
SplitCmdLine(LaunchingCmdLine,LaunchingApplication, LaunchingParams);
if not FileIsExecutable(LaunchingApplication)
then begin
MessageDlg(lisLaunchingApplicationInvalid,
Format(lisTheLaunchingApplicationDoesNotExistsOrIsNotExecuta, ['"',
EnvironmentOptions.DebuggerFilename, '"', #13, #13, #13]),
mtError, [mbOK],0);
Exit;
end;
if not FileIsExecutable(EnvironmentOptions.DebuggerFilename) then begin
if not FileIsExecutable(EnvironmentOptions.DebuggerFilename)
then begin
MessageDlg(lisDebuggerInvalid,
Format(lisTheDebuggerDoesNotExistsOrIsNotExecutableSeeEnviro, ['"',
EnvironmentOptions.DebuggerFilename, '"', #13, #13, #13]),
mtError,[mbCancel],0);
exit;
mtError,[mbOK],0);
Exit;
end;
DebuggerClass := FindDebuggerClass(EnvironmentOptions.DebuggerClass);
@ -1590,8 +1618,7 @@ begin
if FDebugger = nil
then begin
// something went wrong
Result := mrCancel;
exit;
Exit;
end;
ClearDebugOutputLog;
@ -1609,8 +1636,8 @@ begin
Exclude(FManagerStates,dmsInitializingDebuggerObject);
if dmsInitializingDebuggerObjectFailed in FManagerStates
then begin
Result:=mrCancel;
exit;
FreeDebugger;
Exit;
end;
end;
@ -1623,15 +1650,14 @@ begin
FDebugger.WorkingDir:=NewWorkingDir;
// check if debugging needs restart
if ((FDebugger=nil) or (dmsDebuggerObjectBroken in FManagerStates))
and (MainIDE.ToolStatus=itDebugger)
// mwe: can this still happen ?
if (dmsDebuggerObjectBroken in FManagerStates)
then begin
MainIDE.ToolStatus:=itNone;
Result:=mrCancel;
exit;
FreeDebugger;
Exit;
end;
Result := mrOk;
Result := True;
WriteLN('[TDebugManager.DoInitDebugger] END');
end;
@ -1719,6 +1745,8 @@ end;
procedure TDebugManager.EndDebugging;
begin
if FDebugger <> nil then FDebugger.Done;
// if not already freed
FreeDebugger;
end;
function TDebugManager.Evaluate(const AExpression: String;
@ -1863,6 +1891,11 @@ end.
{ =============================================================================
$Log$
Revision 1.72 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.71 2004/08/27 09:19:27 micha
fix compile by adding braces

View File

@ -1,91 +1,88 @@
object ImExportCompOptsDlg: TImExportCompOptsDlg
CAPTION = 'ImExportCompOptsDlg'
CLIENTHEIGHT = 235
CLIENTWIDTH = 554
ONCLOSE = ImExportCompOptsDlgCLOSE
ONCREATE = ImExportCompOptsDlgCREATE
HORZSCROLLBAR.PAGE = 555
VERTSCROLLBAR.PAGE = 236
LEFT = 316
HEIGHT = 235
TOP = 212
WIDTH = 554
object OpenRecentGroupbox: TGROUPBOX
ANCHORS = [aktop, akleft, akright, akbottom]
CAPTION = 'OpenRecentGroupbox'
CLIENTHEIGHT = 159
CLIENTWIDTH = 532
PARENTCTL3D = False
TABORDER = 0
LEFT = 8
HEIGHT = 176
TOP = 8
WIDTH = 536
object RecentListbox: TLISTBOX
ALIGN = altop
ANCHORS = [aktop, akleft, akbottom]
ONCLICK = RecentListboxCLICK
ONDBLCLICK = RecentListboxDBLCLICK
TABORDER = 0
TABSTOP = True
TOPINDEX = -1
HEIGHT = 121
WIDTH = 532
Caption = 'ImExportCompOptsDlg'
ClientHeight = 235
ClientWidth = 554
OnClose = ImExportCompOptsDlgCLOSE
OnCreate = ImExportCompOptsDlgCREATE
PixelsPerInch = 90
HorzScrollBar.Page = 555
VertScrollBar.Page = 236
Left = 316
Height = 235
Top = 212
Width = 554
object OpenRecentGroupbox: TGroupBox
Anchors = [akTop, akLeft, akRight, akBottom]
Caption = 'OpenRecentGroupbox'
ClientHeight = 159
ClientWidth = 532
ParentColor = True
ParentCtl3D = False
TabOrder = 0
Left = 8
Height = 176
Top = 8
Width = 536
object RecentListbox: TListBox
Align = alTop
Anchors = [akTop, akLeft, akBottom]
ClickOnSelChange = False
OnClick = RecentListboxCLICK
OnDblClick = RecentListboxDBLCLICK
TabOrder = 0
TopIndex = 18446744073709551615
Height = 121
Width = 532
end
object OpenRecentButton: TBUTTON
ANCHORS = [akleft, akbottom]
CAPTION = 'OpenRecentButton'
TABSTOP = True
TABORDER = 1
ONCLICK = OpenRecentButtonCLICK
LEFT = 9
HEIGHT = 25
TOP = 129
WIDTH = 150
object OpenRecentButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'OpenRecentButton'
OnClick = OpenRecentButtonCLICK
TabOrder = 1
Left = 9
Height = 25
Top = 129
Width = 150
end
object SaveToRecentButton: TBUTTON
ANCHORS = [akleft, akbottom]
CAPTION = 'SaveToRecentButton'
TABSTOP = True
TABORDER = 2
ONCLICK = SaveToRecentButtonCLICK
LEFT = 182
HEIGHT = 25
TOP = 129
WIDTH = 150
object SaveToRecentButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'SaveToRecentButton'
OnClick = SaveToRecentButtonCLICK
TabOrder = 2
Left = 182
Height = 25
Top = 129
Width = 150
end
end
object OpenButton: TBUTTON
ANCHORS = [akleft, akbottom]
CAPTION = 'OpenButton'
TABSTOP = True
TABORDER = 1
ONCLICK = OpenButtonCLICK
LEFT = 8
HEIGHT = 25
TOP = 200
WIDTH = 167
object OpenButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'OpenButton'
OnClick = OpenButtonCLICK
TabOrder = 1
Left = 8
Height = 25
Top = 200
Width = 167
end
object CancelButton: TBUTTON
ANCHORS = [akleft, akbottom]
MODALRESULT = 2
CAPTION = 'CancelButton'
TABSTOP = True
TABORDER = 2
LEFT = 432
HEIGHT = 25
TOP = 200
WIDTH = 110
object CancelButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'CancelButton'
ModalResult = 2
TabOrder = 2
Left = 432
Height = 25
Top = 200
Width = 110
end
object SaveButton: TBUTTON
ANCHORS = [akleft, akbottom]
CAPTION = 'SaveButton'
TABSTOP = True
TABORDER = 3
ONCLICK = SaveButtonCLICK
LEFT = 214
HEIGHT = 25
TOP = 200
WIDTH = 167
object SaveButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'SaveButton'
OnClick = SaveButtonCLICK
TabOrder = 3
Left = 214
Height = 25
Top = 200
Width = 167
end
end

View File

@ -1,31 +1,31 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TImExportCompOptsDlg','FORMDATA',[
'TPF0'#20'TImExportCompOptsDlg'#19'ImExportCompOptsDlg'#7'CAPTION'#6#19'ImExp'
+'ortCompOptsDlg'#12'CLIENTHEIGHT'#3#235#0#11'CLIENTWIDTH'#3'*'#2#7'ONCLOSE'#7
+#24'ImExportCompOptsDlgCLOSE'#8'ONCREATE'#7#25'ImExportCompOptsDlgCREATE'#18
+'HORZSCROLLBAR.PAGE'#3'+'#2#18'VERTSCROLLBAR.PAGE'#3#236#0#4'LEFT'#3'<'#1#6
+'HEIGHT'#3#235#0#3'TOP'#3#212#0#5'WIDTH'#3'*'#2#0#9'TGROUPBOX'#18'OpenRecent'
+'Groupbox'#7'ANCHORS'#11#5'aktop'#6'akleft'#7'akright'#8'akbottom'#0#7'CAPTI'
+'ON'#6#18'OpenRecentGroupbox'#12'CLIENTHEIGHT'#3#159#0#11'CLIENTWIDTH'#3#20#2
+#11'PARENTCTL3D'#8#8'TABORDER'#2#0#4'LEFT'#2#8#6'HEIGHT'#3#176#0#3'TOP'#2#8#5
+'WIDTH'#3#24#2#0#8'TLISTBOX'#13'RecentListbox'#5'ALIGN'#7#5'altop'#7'ANCHORS'
+#11#5'aktop'#6'akleft'#8'akbottom'#0#7'ONCLICK'#7#18'RecentListboxCLICK'#10
+'ONDBLCLICK'#7#21'RecentListboxDBLCLICK'#8'TABORDER'#2#0#7'TABSTOP'#9#8'TOPI'
+'NDEX'#2#255#6'HEIGHT'#2'y'#5'WIDTH'#3#20#2#0#0#7'TBUTTON'#16'OpenRecentButt'
+'on'#7'ANCHORS'#11#6'akleft'#8'akbottom'#0#7'CAPTION'#6#16'OpenRecentButton'
+#7'TABSTOP'#9#8'TABORDER'#2#1#7'ONCLICK'#7#21'OpenRecentButtonCLICK'#4'LEFT'
+#2#9#6'HEIGHT'#2#25#3'TOP'#3#129#0#5'WIDTH'#3#150#0#0#0#7'TBUTTON'#18'SaveTo'
+'RecentButton'#7'ANCHORS'#11#6'akleft'#8'akbottom'#0#7'CAPTION'#6#18'SaveToR'
+'ecentButton'#7'TABSTOP'#9#8'TABORDER'#2#2#7'ONCLICK'#7#23'SaveToRecentButto'
+'nCLICK'#4'LEFT'#3#182#0#6'HEIGHT'#2#25#3'TOP'#3#129#0#5'WIDTH'#3#150#0#0#0#0
+#7'TBUTTON'#10'OpenButton'#7'ANCHORS'#11#6'akleft'#8'akbottom'#0#7'CAPTION'#6
+#10'OpenButton'#7'TABSTOP'#9#8'TABORDER'#2#1#7'ONCLICK'#7#15'OpenButtonCLICK'
+#4'LEFT'#2#8#6'HEIGHT'#2#25#3'TOP'#3#200#0#5'WIDTH'#3#167#0#0#0#7'TBUTTON'#12
+'CancelButton'#7'ANCHORS'#11#6'akleft'#8'akbottom'#0#11'MODALRESULT'#2#2#7'C'
+'APTION'#6#12'CancelButton'#7'TABSTOP'#9#8'TABORDER'#2#2#4'LEFT'#3#176#1#6'H'
+'EIGHT'#2#25#3'TOP'#3#200#0#5'WIDTH'#2'n'#0#0#7'TBUTTON'#10'SaveButton'#7'AN'
+'CHORS'#11#6'akleft'#8'akbottom'#0#7'CAPTION'#6#10'SaveButton'#7'TABSTOP'#9#8
+'TABORDER'#2#3#7'ONCLICK'#7#15'SaveButtonCLICK'#4'LEFT'#3#214#0#6'HEIGHT'#2
+#25#3'TOP'#3#200#0#5'WIDTH'#3#167#0#0#0#0
'TPF0'#20'TImExportCompOptsDlg'#19'ImExportCompOptsDlg'#7'Caption'#6#19'ImExp'
+'ortCompOptsDlg'#12'ClientHeight'#3#235#0#11'ClientWidth'#3'*'#2#7'OnClose'#7
+#24'ImExportCompOptsDlgCLOSE'#8'OnCreate'#7#25'ImExportCompOptsDlgCREATE'#13
+'PixelsPerInch'#2'Z'#18'HorzScrollBar.Page'#3'+'#2#18'VertScrollBar.Page'#3
+#236#0#4'Left'#3'<'#1#6'Height'#3#235#0#3'Top'#3#212#0#5'Width'#3'*'#2#0#9'T'
+'GroupBox'#18'OpenRecentGroupbox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
+#8'akBottom'#0#7'Caption'#6#18'OpenRecentGroupbox'#12'ClientHeight'#3#159#0
+#11'ClientWidth'#3#20#2#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#0#4
+'Left'#2#8#6'Height'#3#176#0#3'Top'#2#8#5'Width'#3#24#2#0#8'TListBox'#13'Rec'
+'entListbox'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'
+#0#16'ClickOnSelChange'#8#7'OnClick'#7#18'RecentListboxCLICK'#10'OnDblClick'
+#7#21'RecentListboxDBLCLICK'#8'TabOrder'#2#0#8'TopIndex'#2#255#6'Height'#2'y'
+#5'Width'#3#20#2#0#0#7'TButton'#16'OpenRecentButton'#7'Anchors'#11#6'akLeft'
+#8'akBottom'#0#7'Caption'#6#16'OpenRecentButton'#7'OnClick'#7#21'OpenRecentB'
+'uttonCLICK'#8'TabOrder'#2#1#4'Left'#2#9#6'Height'#2#25#3'Top'#3#129#0#5'Wid'
+'th'#3#150#0#0#0#7'TButton'#18'SaveToRecentButton'#7'Anchors'#11#6'akLeft'#8
+'akBottom'#0#7'Caption'#6#18'SaveToRecentButton'#7'OnClick'#7#23'SaveToRecen'
+'tButtonCLICK'#8'TabOrder'#2#2#4'Left'#3#182#0#6'Height'#2#25#3'Top'#3#129#0
+#5'Width'#3#150#0#0#0#0#7'TButton'#10'OpenButton'#7'Anchors'#11#6'akLeft'#8
+'akBottom'#0#7'Caption'#6#10'OpenButton'#7'OnClick'#7#15'OpenButtonCLICK'#8
+'TabOrder'#2#1#4'Left'#2#8#6'Height'#2#25#3'Top'#3#200#0#5'Width'#3#167#0#0#0
+#7'TButton'#12'CancelButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'
+#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#3#176#1#6'He'
+'ight'#2#25#3'Top'#3#200#0#5'Width'#2'n'#0#0#7'TButton'#10'SaveButton'#7'Anc'
+'hors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#10'SaveButton'#7'OnClick'#7#15
+'SaveButtonCLICK'#8'TabOrder'#2#3#4'Left'#3#214#0#6'Height'#2#25#3'Top'#3#200
+#0#5'Width'#3#167#0#0#0#0
]);

View File

@ -34,7 +34,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, FileCtrl, Laz_XMLCfg,
LazarusIDEStrConsts, InputHistory, CompilerOptions;
LazarusIDEStrConsts, InputHistory, CompilerOptions, CompilerOptionsDlg;
type
TImExportCompOptsResult = (

View File

@ -55,7 +55,7 @@ uses
{$IFDEF AddStaticPkgs}
{$I staticpackages.inc}
{$ENDIF}
MainBase;
MainBase, compileroptionsdlg;
begin
Application.Initialize;
@ -99,6 +99,11 @@ end.
{
$Log$
Revision 1.60 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.59 2004/08/08 18:02:44 mattias
splitted TMainIDE (main control instance) and TMainIDEBar (IDE menu and palette), added mainbase.pas and mainintf.pas

View File

@ -386,6 +386,8 @@ resourcestring
+'environment options,%syou can create new projects and build them at '
+'once.%sSave project?';
lisProjectSuccessfullyBuilt = 'Project %s%s%s successfully built. :)';
lisExecutingCommandBefore = 'Executing command befor';
lisExecutingCommandAfter = 'Executing command after';
lisNoProgramFileSFound = 'No program file %s%s%s found.';
lisErrorInitializingProgramSErrorS = 'Error initializing program%s%s%s%s%s'
+'Error: %s';
@ -927,8 +929,13 @@ resourcestring
dlgCOSources = 'Other Sources (.pp/.pas files, used only by IDE not by compiler)';
dlgCOLibraries = 'Libraries (-Fl):';
dlgCODebugPath = 'Debugger path addition (none):';
dlgToFPCPath = 'Path To Compiler:';
lisCompiler = 'Compiler';
lisToFPCPath = 'Path:';
lisCOSkipCallingCompiler = 'Skip calling Compiler';
lisCOCallOn = 'Call on:';
lisCOCallOnCompile = 'Compile';
lisCOCallOnBuild = 'Build';
lisCOCallOnRun = 'Run';
lisCOExecuteAfter = 'Execute after';
lisCOExecuteBefore = 'Execute before';
lisAdditionalCompilerOptionsInheritedFromPackages = 'Additional compiler '
@ -1818,6 +1825,12 @@ resourcestring
lisTheFileWasNotFoundDoYouWantToLocateItYourself = 'The file %s%s%s%swas '
+'not found.%sDo you want to locate it yourself ?%s';
lisRunToFailed = 'Run-to failed';
lisLaunchingApplicationInvalid = 'Launching application invalid';
lisTheLaunchingApplicationDoesNotExistsOrIsNotExecuta = 'The launching '
+'application %s%s%'
+'s%sdoes not exists or is not executable.%s%sSee Run -> Run parameters -> '
+'Local';
lisDebuggerInvalid = 'Debugger invalid';
lisTheDebuggerDoesNotExistsOrIsNotExecutableSeeEnviro = 'The debugger %s%s%'
+'s%sdoes not exists or is not executable.%s%sSee Environment -> Debugger '

View File

@ -69,7 +69,8 @@ uses
// synedit
SynEditKeyCmds,
// compile
Compiler, CompilerOptions, CheckCompilerOpts, ImExportCompilerOpts,
Compiler, CompilerOptions, CompilerOptionsDlg, CheckCompilerOpts,
ImExportCompilerOpts,
// projects
ProjectIntf, Project, ProjectDefs, NewProjectDlg, ProjectOpts,
PublishProjectDlg, ProjectInspector,
@ -565,7 +566,7 @@ type
function DoRemoveFromProjectDialog: TModalResult;
procedure DoWarnAmbigiousFiles;
function DoSaveForBuild: TModalResult; override;
function DoBuildProject(BuildAll: boolean): TModalResult;
function DoBuildProject(const AReason: TCompileReason): TModalResult;
function DoAbortBuild: TModalResult;
function DoInitProjectRun: TModalResult; override;
function DoRunProject: TModalResult;
@ -2016,10 +2017,10 @@ begin
and AnUnitInfo.BuildFileIfActive then
DoBuildFile
else
DoBuildProject(Command=ecBuildAll);
DoBuildProject(crCompile);
end;
ecBuildAll: DoBuildProject(Command=ecBuildAll);
ecBuildAll: DoBuildProject(crBuild);
ecAbortBuild: DoAbortBuild;
ecRun:
@ -2548,12 +2549,12 @@ end;
Procedure TMainIDE.mnuBuildProjectClicked(Sender : TObject);
Begin
DoBuildProject(false);
DoBuildProject(crCompile);
end;
Procedure TMainIDE.mnuBuildAllProjectClicked(Sender : TObject);
Begin
DoBuildProject(true);
DoBuildProject(crBuild);
end;
Procedure TMainIDE.mnuAbortBuildProjectClicked(Sender : TObject);
@ -2593,7 +2594,7 @@ end;
procedure TMainIDE.mnuProjectCompilerSettingsClicked(Sender : TObject);
var
frmCompilerOptions:TfrmCompilerOptions;
frmCompilerOptions: TfrmCompilerOptions;
NewCaption: String;
begin
frmCompilerOptions:=TfrmCompilerOptions.Create(Application);
@ -5947,7 +5948,7 @@ begin
end;
end;
function TMainIDE.DoBuildProject(BuildAll: boolean): TModalResult;
function TMainIDE.DoBuildProject(const AReason: TCompileReason): TModalResult;
var
DefaultFilename: string;
begin
@ -5981,12 +5982,16 @@ begin
DoWarnAmbigiousFiles;
// execute compilation tool 'Before'
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteBefore,
Project1.ProjectDirectory,
'Executing command before');
if (AReason in TProjectCompilationTool(Project1.CompilerOptions.ExecuteBefore).CompileReasons)
then begin
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteBefore,
Project1.ProjectDirectory,
lisExecutingCommandBefore);
end;
if (Result=mrOk)
and (not Project1.CompilerOptions.SkipCompiler) then begin
and (AReason in Project1.CompilerOptions.CompileReasons)
then begin
try
// change tool status
ToolStatus:=itBuilder;
@ -5995,7 +6000,7 @@ begin
TheOutputFilter.OnReadLine:=@MessagesView.AddProgress;
// compile
Result:=TheCompiler.Compile(Project1,BuildAll,DefaultFilename);
Result:=TheCompiler.Compile(Project1, AReason = crBuild, DefaultFilename);
if Result<>mrOk then
DoJumpToCompilerMessage(-1,true);
finally
@ -6004,14 +6009,17 @@ begin
end;
// execute compilation tool 'After'
if Result=mrOk then begin
if (Result = mrOk)
and (AReason in TProjectCompilationTool(Project1.CompilerOptions.ExecuteAfter).CompileReasons)
then begin
Result:=DoExecuteCompilationTool(Project1.CompilerOptions.ExecuteAfter,
Project1.ProjectDirectory,
'Executing command after');
lisExecutingCommandAfter);
end;
// add success message
if Result=mrOk then begin
if Result=mrOk
then begin
MessagesView.AddMsg(
Format(lisProjectSuccessfullyBuilt, ['"', Project1.Title, '"']),'');
end;
@ -6049,7 +6057,7 @@ begin
then Exit;
// Build project first
if DoBuildProject(false) <> mrOk
if DoBuildProject(crRun) <> mrOk
then Exit;
// Check project build
@ -6065,7 +6073,7 @@ begin
// Setup debugger
if EnvironmentOptions.DebuggerClass <> ''
then begin
if (DebugBoss.DoInitDebugger <> mrOk)
if not DebugBoss.InitDebugger
then Exit;
end
else begin
@ -10636,6 +10644,11 @@ end.
{ =============================================================================
$Log$
Revision 1.766 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.765 2004/09/01 10:25:58 mattias
added some project flags to start getting rid of TProjectType

View File

@ -227,26 +227,44 @@ type
//---------------------------------------------------------------------------
{ TProjectCompilationTool }
TProjectCompilationTool = class(TCompilationTool)
public
CompileReasons: TCompileReasons;
procedure Clear; override;
function IsEqual(Params: TCompilationTool): boolean; override;
procedure Assign(Src: TCompilationTool); override;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string;
DoSwitchPathDelims: boolean); override;
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
end;
{ TProjectCompilerOptions }
TProjectCompilerOptions = class(TCompilerOptions)
TProjectCompilerOptions = class(TBaseCompilerOptions)
private
FGlobals: TGlobalCompilerOptions;
FOwnerProject: TProject;
FCompileReasons: TCompileReasons;
protected
procedure LoadTheCompilerOptions(const APath: string); override;
procedure SaveTheCompilerOptions(const APath: string); override;
procedure SetTargetCPU(const AValue: string); override;
procedure SetTargetOS(const AValue: string); override;
procedure Assign(CompOpts: TBaseCompilerOptions); override;
procedure UpdateGlobals; virtual;
public
constructor Create(TheProject: TProject);
constructor Create(const AOwner: TObject); override;
destructor Destroy; override;
function GetOwnerName: string; override;
function GetDefaultMainSourceFileName: string; override;
procedure GetInheritedCompilerOptions(var OptionsList: TList); override;
procedure Assign(CompOpts: TBaseCompilerOptions); override;
function IsEqual(CompOpts: TBaseCompilerOptions): boolean; override;
public
property OwnerProject: TProject read FOwnerProject;
property Globals: TGlobalCompilerOptions read FGlobals;
property CompileReasons: TCompileReasons read FCompileReasons write FCompileReasons;
end;
@ -2653,9 +2671,64 @@ begin
AnUnitInfo.fPrev[ListType]:=nil;
end;
{ TProjectCompilationTool }
procedure TProjectCompilationTool.Clear;
begin
inherited Clear;
CompileReasons := crAll;
end;
function TProjectCompilationTool.IsEqual(Params: TCompilationTool): boolean;
begin
Result := (Params is TProjectCompilationTool)
and (CompileReasons = TProjectCompilationTool(Params).CompileReasons)
and inherited IsEqual(Params);
end;
procedure TProjectCompilationTool.Assign(Src: TCompilationTool);
begin
inherited Assign(Src);
if Src is TProjectCompilationTool
then begin
CompileReasons := TProjectCompilationTool(Src).CompileReasons;
end
else begin
CompileReasons := crAll;
end;
end;
procedure TProjectCompilationTool.LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string; DoSwitchPathDelims: boolean);
begin
inherited LoadFromXMLConfig(XMLConfig, Path, DoSwitchPathDelims);
CompileReasons := LoadXMLCompileReasons(XMLConfig, Path+'CompileReasons/');
end;
procedure TProjectCompilationTool.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
begin
inherited SaveToXMLConfig(XMLConfig, Path);
SaveXMLCompileReasons(XMLConfig, Path+'CompileReasons/', CompileReasons);
end;
{ TProjectCompilerOptions }
procedure TProjectCompilerOptions.LoadTheCompilerOptions(const APath: string);
begin
inherited LoadTheCompilerOptions(APath);
// old compatebility
if XMLConfigFile.GetValue(APAth+'SkipCompiler/Value',false)
then FCompileReasons := []
else FCompileReasons := LoadXMLCompileReasons(XMLConfigFile,APath+'CompileReasons/');
end;
procedure TProjectCompilerOptions.SaveTheCompilerOptions(const APath: string);
begin
inherited SaveTheCompilerOptions(APath);
SaveXMLCompileReasons(XMLConfigFile, APath+'CompileReasons/', FCompileReasons);
end;
procedure TProjectCompilerOptions.SetTargetCPU(const AValue: string);
begin
inherited SetTargetCPU(AValue);
@ -2671,21 +2744,34 @@ end;
procedure TProjectCompilerOptions.Assign(CompOpts: TBaseCompilerOptions);
begin
inherited Assign(CompOpts);
if CompOpts is TProjectCompilerOptions
then FCompileReasons := TProjectCompilerOptions(CompOpts).FCompileReasons
else FCompileReasons := [crCompile, crBuild, crRun];
UpdateGlobals;
end;
function TProjectCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions): boolean;
begin
Result := (CompOpts is TProjectCompilerOptions)
and (FCompileReasons = TProjectCompilerOptions(CompOpts).FCompileReasons)
and inherited IsEqual(CompOpts);
end;
procedure TProjectCompilerOptions.UpdateGlobals;
begin
FGlobals.TargetCPU:=TargetCPU;
FGlobals.TargetOS:=TargetOS;
end;
constructor TProjectCompilerOptions.Create(TheProject: TProject);
constructor TProjectCompilerOptions.Create(const AOwner: TObject);
begin
FGlobals:=TGlobalCompilerOptions.Create;
inherited Create(TheProject);
FGlobals := TGlobalCompilerOptions.Create;
FCompileReasons := [crCompile, crBuild, crRun];
inherited Create(AOwner, TProjectCompilationTool);
UpdateGlobals;
fOwnerProject:=TheProject;
if AOwner <> nil
then FOwnerProject := AOwner as TProject;
end;
destructor TProjectCompilerOptions.Destroy;
@ -2818,6 +2904,11 @@ end.
{
$Log$
Revision 1.161 2004/09/04 21:54:08 marc
+ Added option to skip compiler step on compile, build or run
* Fixed adding of runtime watches
* Fixed runnerror reporting (correct number and location is shown)
Revision 1.160 2004/09/01 10:25:58 mattias
added some project flags to start getting rid of TProjectType

View File

@ -321,7 +321,11 @@ type
TPkgCompilerOptions = class(TBaseCompilerOptions)
private
FLazPackage: TLazPackage;
FSkipCompiler: Boolean;
protected
procedure LoadTheCompilerOptions(const APath: string); override;
procedure SaveTheCompilerOptions(const APath: string); override;
procedure SetLazPackage(const AValue: TLazPackage);
procedure SetModified(const NewValue: boolean); override;
procedure SetCustomOptions(const AValue: string); override;
@ -333,15 +337,19 @@ type
procedure SetOtherUnitFiles(const AValue: string); override;
procedure SetUnitOutputDir(const AValue: string); override;
public
constructor Create(ThePackage: TLazPackage);
constructor Create(const AOwner: TObject); override;
procedure Clear; override;
procedure GetInheritedCompilerOptions(var OptionsList: TList); override;
function GetOwnerName: string; override;
procedure InvalidateOptions;
function GetDefaultMainSourceFileName: string; override;
function CreateTargetFilename(const MainSourceFileName: string): string; override;
procedure Assign(CompOpts: TBaseCompilerOptions); override;
function IsEqual(CompOpts: TBaseCompilerOptions): boolean; override;
public
property LazPackage: TLazPackage read FLazPackage write SetLazPackage;
property SkipCompiler: Boolean read FSkipCompiler write FSkipCompiler;
end;
@ -2883,6 +2891,20 @@ end;
{ TPkgCompilerOptions }
procedure TPkgCompilerOptions.LoadTheCompilerOptions(const APath: string);
begin
inherited LoadTheCompilerOptions(APath);
FSkipCompiler := XMLConfigFile.GetValue(APath+'SkipCompiler/Value', False);
end;
procedure TPkgCompilerOptions.SaveTheCompilerOptions(const APath: string);
begin
inherited SaveTheCompilerOptions(APath);
XMLConfigFile.SetDeleteValue(APath+'SkipCompiler/Value', FSkipCompiler, False);
end;
procedure TPkgCompilerOptions.SetLazPackage(const AValue: TLazPackage);
begin
if FLazPackage=AValue then exit;
@ -2953,10 +2975,11 @@ begin
LazPackage.DefineTemplates.OutputDirectoryChanged;
end;
constructor TPkgCompilerOptions.Create(ThePackage: TLazPackage);
constructor TPkgCompilerOptions.Create(const AOwner: TObject);
begin
inherited Create(ThePackage);
fLazPackage:=ThePackage;
inherited Create(AOwner);
if AOwner <> nil
then FLazPackage := AOwner as TLazPackage;
end;
procedure TPkgCompilerOptions.Clear;
@ -2993,6 +3016,25 @@ begin
Result:='';
end;
procedure TPkgCompilerOptions.Assign(CompOpts: TBaseCompilerOptions);
begin
inherited Assign(CompOpts);
if CompOpts is TPkgCompilerOptions
then begin
FSkipCompiler := TPkgCompilerOptions(CompOpts).FSkipCompiler;
end
else begin
FSkipCompiler := False;
end;
end;
function TPkgCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions): boolean;
begin
Result := (CompOpts is TPkgCompilerOptions)
and (FSkipCompiler = TPkgCompilerOptions(CompOpts).FSkipCompiler)
and inherited IsEqual(CompOpts);
end;
{ TPkgAdditionalCompilerOptions }
procedure TPkgAdditionalCompilerOptions.SetLazPackage(const AValue: TLazPackage

View File

@ -41,8 +41,8 @@ uses
Classes, SysUtils, Forms, Controls, StdCtrls, ComCtrls, Buttons, LResources,
Graphics, LCLType, Menus, Dialogs, FileCtrl, Laz_XMLCfg, AVL_Tree,
IDEProcs, LazConf, LazarusIDEStrConsts, IDEOptionDefs, IDEDefs,
CompilerOptions, ComponentReg, PackageDefs, PkgOptionsDlg, AddToPackageDlg,
PackageSystem;
CompilerOptions, CompilerOptionsDlg, ComponentReg, PackageDefs, PkgOptionsDlg,
AddToPackageDlg, PackageSystem;
type
TOnOpenFile =