fpcompil.pas 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Compiler call routines for the IDE
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$i globdir.inc}
  13. unit FPCompil;
  14. interface
  15. { don't redir under linux, because all stdout (also from the ide!) will
  16. then be redired (PFV) }
  17. { this should work now correctly because
  18. RedirDisableAll and RedirEnableAll function are added in fpredir (PM) }
  19. { $define VERBOSETXT}
  20. {$mode objfpc}
  21. uses
  22. Objects,
  23. FInput,
  24. Drivers,Views,Dialogs,
  25. WUtils,WViews,WCEdit,
  26. FPSymbol,
  27. FPViews;
  28. type
  29. TCompileMode = (cBuild,cMake,cCompile,cRun);
  30. type
  31. PCompilerMessage = ^TCompilerMessage;
  32. TCompilerMessage = object(TMessageItem)
  33. function GetText(MaxLen: Sw_Integer): String; virtual;
  34. end;
  35. PCompilerMessageListBox = ^TCompilerMessageListBox;
  36. TCompilerMessageListBox = object(TMessageListBox)
  37. function GetPalette: PPalette; virtual;
  38. procedure SelectFirstError;
  39. end;
  40. PCompilerMessageWindow = ^TCompilerMessageWindow;
  41. TCompilerMessageWindow = object(TFPWindow)
  42. constructor Init;
  43. procedure HandleEvent(var Event: TEvent); virtual;
  44. function GetPalette: PPalette; virtual;
  45. procedure Close;virtual;
  46. destructor Done; virtual;
  47. procedure SizeLimits(var Min, Max: TPoint); virtual;
  48. procedure AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  49. procedure ClearMessages;
  50. constructor Load(var S: TStream);
  51. procedure Store(var S: TStream);
  52. procedure SetState(AState: Word; Enable: Boolean); virtual;
  53. procedure UpdateCommands; virtual;
  54. private
  55. {CompileShowed : boolean;}
  56. {Mode : TCompileMode;}
  57. MsgLB : PCompilerMessageListBox;
  58. {CurrST,
  59. InfoST : PColorStaticText;}
  60. end;
  61. PCompilerStatusDialog = ^TCompilerStatusDialog;
  62. TCompilerStatusDialog = object(TCenterDialog)
  63. ST : PAdvancedStaticText;
  64. KeyST : PColorStaticText;
  65. constructor Init;
  66. destructor Done;virtual;
  67. procedure Update;
  68. end;
  69. TFPInputFile = class(tinputfile)
  70. constructor Create(AEditor: PFileEditor);
  71. protected
  72. function fileopen(const filename: string): boolean; override;
  73. function fileseek(pos: longint): boolean; override;
  74. function fileread(var databuf; maxsize: longint): longint; override;
  75. function fileeof: boolean; override;
  76. function fileclose: boolean; override;
  77. private
  78. Editor: PFileEditor;
  79. S: PStream;
  80. end;
  81. const
  82. CompilerMessageWindow : PCompilerMessageWindow = nil;
  83. CompilerStatusDialog : PCompilerStatusDialog = nil;
  84. CompileStamp : longint = 0;
  85. RestartingDebugger : boolean = false;
  86. procedure DoCompile(Mode: TCompileMode);
  87. function NeedRecompile(Mode :TCompileMode; verbose : boolean): boolean;
  88. procedure ParseUserScreen;
  89. procedure RegisterFPCompile;
  90. const
  91. CompilingHiddenFile : PSourceWindow = nil;
  92. implementation
  93. uses
  94. {$ifdef Unix}
  95. {$ifdef VER1_0}
  96. Linux,
  97. {$else}
  98. Unix, BaseUnix,
  99. {$endif}
  100. {$endif}
  101. {$ifdef go32v2}
  102. dpmiexcp,
  103. {$endif}
  104. {$ifdef win32}
  105. signals,
  106. {$endif}
  107. {$ifdef HasSignal}
  108. fpcatch,
  109. {$endif HasSignal}
  110. Dos,
  111. {$ifdef fpc}
  112. Video,
  113. {$endif fpc}
  114. StdDlg,App,tokens,
  115. FVConsts,
  116. CompHook, Compiler, systems, browcol,
  117. WEditor,
  118. FPString,FPRedir,FPDesk,
  119. FPUsrScr,FPHelp,
  120. {$ifndef NODEBUG}FPDebug,{$endif}
  121. FPConst,FPVars,FPUtils,
  122. FPCodCmp,FPIntf,FPSwitch;
  123. {$ifndef NOOBJREG}
  124. const
  125. RCompilerMessageListBox: TStreamRec = (
  126. ObjType: 1211;
  127. VmtLink: Ofs(TypeOf(TCompilerMessageListBox)^);
  128. Load: @TCompilerMessageListBox.Load;
  129. Store: @TCompilerMessageListBox.Store
  130. );
  131. RCompilerMessageWindow: TStreamRec = (
  132. ObjType: 1212;
  133. VmtLink: Ofs(TypeOf(TCompilerMessageWindow)^);
  134. Load: @TCompilerMessageWindow.Load;
  135. Store: @TCompilerMessageWindow.Store
  136. );
  137. {$endif}
  138. procedure ParseUserScreen;
  139. var
  140. y : longint;
  141. Text,Attr : String;
  142. DisplayCompilerWindow : boolean;
  143. cc: integer;
  144. procedure SearchBackTrace;
  145. var AText,ModuleName,st : String;
  146. row : longint;
  147. begin
  148. if pos(' 0x',Text)=1 then
  149. begin
  150. AText:=Text;
  151. Delete(Text,1,10);
  152. While pos(' ',Text)=1 do
  153. Delete(Text,1,1);
  154. if pos('of ',Text)>0 then
  155. begin
  156. ModuleName:=Copy(Text,pos('of ',Text)+3,255);
  157. While ModuleName[Length(ModuleName)]=' ' do
  158. Delete(ModuleName,Length(ModuleName),1);
  159. end
  160. else
  161. ModuleName:='';
  162. if pos('line ',Text)>0 then
  163. begin
  164. Text:=Copy(Text,Pos('line ',Text)+5,255);
  165. st:=Copy(Text,1,Pos(' ',Text)-1);
  166. Val(st,row,cc);
  167. end
  168. else
  169. row:=0;
  170. CompilerMessageWindow^.AddMessage(V_Fatal,AText
  171. ,ModuleName,row,1);
  172. DisplayCompilerWindow:=true;
  173. end;
  174. end;
  175. procedure InsertInMessages(Const TypeStr : String;_Type : longint;EnableDisplay : boolean);
  176. var p,p2,col,row : longint;
  177. St,ModuleName : string;
  178. begin
  179. p:=pos(TypeStr,Text);
  180. p2:=Pos('(',Text);
  181. if (p>0) and (p2>0) and (p2<p) then
  182. begin
  183. ModuleName:=Copy(Text,1,p2-1);
  184. st:=Copy(Text,p2+1,255);
  185. Val(Copy(st,1,pos(',',st)-1),row,cc);
  186. st:=Copy(st,Pos(',',st)+1,255);
  187. Val(Copy(st,1,pos(')',st)-1),col,cc);
  188. CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
  189. ,ModuleName,row,col);
  190. If EnableDisplay then
  191. DisplayCompilerWindow:=true;
  192. end;
  193. end;
  194. begin
  195. if not assigned(UserScreen) then
  196. exit;
  197. DisplayCompilerWindow:=false;
  198. PushStatus('Parsing User Screen');
  199. CompilerMessageWindow^.Lock;
  200. for Y:=0 to UserScreen^.GetHeight do
  201. begin
  202. UserScreen^.GetLine(Y,Text,Attr);
  203. SearchBackTrace;
  204. InsertInMessages(' Fatal:',v_Fatal,true);
  205. InsertInMessages(' Error:',v_Error,true);
  206. InsertInMessages(' Warning:',v_Warning,false);
  207. InsertInMessages(' Note:',v_Note,false);
  208. InsertInMessages(' Info:',v_Info,false);
  209. InsertInMessages(' Hint:',v_Hint,false);
  210. end;
  211. if DisplayCompilerWindow then
  212. begin
  213. if not CompilerMessageWindow^.GetState(sfVisible) then
  214. CompilerMessageWindow^.Show;
  215. CompilerMessageWindow^.MakeFirst;
  216. CompilerMessageWindow^.MsgLB^.SelectFirstError;
  217. end;
  218. CompilerMessageWindow^.UnLock;
  219. PopStatus;
  220. end;
  221. {*****************************************************************************
  222. TCompilerMessage
  223. *****************************************************************************}
  224. function TCompilerMessage.GetText(MaxLen: Sw_Integer): String;
  225. var
  226. ClassS: string[20];
  227. S: string;
  228. begin
  229. case TClass and V_LevelMask of
  230. V_Fatal : ClassS:=msg_class_Fatal;
  231. V_Error : ClassS:=msg_class_Error;
  232. V_Normal : ClassS:=msg_class_Normal;
  233. V_Warning : ClassS:=msg_class_Warning;
  234. V_Note : ClassS:=msg_class_Note;
  235. V_Hint : ClassS:=msg_class_Hint;
  236. {$ifdef VERBOSETXT}
  237. V_Conditional : ClassS:=msg_class_conditional;
  238. V_Info : ClassS:=msg_class_info;
  239. V_Status : ClassS:=msg_class_status;
  240. V_Used : ClassS:=msg_class_used;
  241. V_Tried : ClassS:=msg_class_tried;
  242. V_Debug : ClassS:=msg_class_debug;
  243. else
  244. ClassS:='???';
  245. {$endif}
  246. else
  247. ClassS:='';
  248. end;
  249. if ClassS<>'' then
  250. ClassS:=RExpand(ClassS,0)+': ';
  251. if assigned(Module) and
  252. ((TClass and V_LineInfo)=V_LineInfo) then
  253. begin
  254. if Row>0 then
  255. begin
  256. if Col>0 then
  257. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+','+IntToStr(Col)+') '+ClassS
  258. else
  259. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS;
  260. end
  261. else
  262. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS
  263. end
  264. else
  265. S:=ClassS;
  266. if assigned(Text) then
  267. S:=S+Text^;
  268. if length(S)>MaxLen then
  269. S:=copy(S,1,MaxLen-2)+'..';
  270. GetText:=S;
  271. end;
  272. {*****************************************************************************
  273. TCompilerMessageListBox
  274. *****************************************************************************}
  275. function TCompilerMessageListBox.GetPalette: PPalette;
  276. const
  277. P: string[length(CBrowserListBox)] = CBrowserListBox;
  278. begin
  279. GetPalette:=@P;
  280. end;
  281. procedure TCompilerMessageListBox.SelectFirstError;
  282. function IsError(P : PCompilerMessage) : boolean;
  283. begin
  284. IsError:=(P^.TClass and (V_Fatal or V_Error))<>0;
  285. end;
  286. var
  287. P : PCompilerMessage;
  288. begin
  289. P:=List^.FirstThat(@IsError);
  290. If Assigned(P) then
  291. Begin
  292. FocusItem(List^.IndexOf(P));
  293. DrawView;
  294. End;
  295. end;
  296. {*****************************************************************************
  297. TCompilerMessageWindow
  298. *****************************************************************************}
  299. constructor TCompilerMessageWindow.Init;
  300. var R: TRect;
  301. HSB,VSB: PScrollBar;
  302. begin
  303. Desktop^.GetExtent(R);
  304. R.A.Y:=R.B.Y-7;
  305. inherited Init(R,dialog_compilermessages,{SearchFreeWindowNo}wnNoNumber);
  306. HelpCtx:=hcCompilerMessagesWindow;
  307. AutoNumber:=true;
  308. HSB:=StandardScrollBar(sbHorizontal+sbHandleKeyboard);
  309. HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  310. Insert(HSB);
  311. VSB:=StandardScrollBar(sbVertical+sbHandleKeyboard);
  312. VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
  313. Insert(VSB);
  314. GetExtent(R);
  315. R.Grow(-1,-1);
  316. New(MsgLB, Init(R, HSB, VSB));
  317. MsgLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
  318. Insert(MsgLB);
  319. CompilerMessageWindow:=@self;
  320. end;
  321. procedure TCompilerMessageWindow.AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  322. begin
  323. if (AClass and V_LineInfo)<>V_LineInfo then
  324. Line:=0;
  325. MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
  326. if (@Self=CompilerMessageWindow) and ((AClass = V_fatal) or (AClass = V_Error)) then
  327. begin
  328. if not GetState(sfVisible) then
  329. Show;
  330. if Desktop^.First<>PView(CompilerMessageWindow) then
  331. MakeFirst;
  332. end;
  333. end;
  334. procedure TCompilerMessageWindow.ClearMessages;
  335. begin
  336. MsgLB^.Clear;
  337. ReDraw;
  338. end;
  339. {procedure TCompilerMessageWindow.Updateinfo;
  340. begin
  341. if CompileShowed then
  342. begin
  343. InfoST^.SetText(
  344. RExpand(' Main file : '#1#$7f+Copy(SmartPath(MainFile),1,39),40)+#2+
  345. 'Total lines : '#1#$7e+IntToStr(Status.CompiledLines)+#2#13+
  346. RExpand(' Target : '#1#$7f+KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)),40)+#2+
  347. 'Total errors : '#1#$7e+IntToStr(Status.ErrorCount)
  348. );
  349. if status.currentline>0 then
  350. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+'('+IntToStr(status.currentline)+')'#2)
  351. else
  352. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+#2);
  353. end;
  354. ReDraw;
  355. end;}
  356. procedure TCompilerMessageWindow.HandleEvent(var Event: TEvent);
  357. begin
  358. case Event.What of
  359. evBroadcast :
  360. case Event.Command of
  361. cmListFocusChanged :
  362. if Event.InfoPtr=MsgLB then
  363. Message(Application,evBroadcast,cmClearLineHighlights,@Self);
  364. end;
  365. end;
  366. inherited HandleEvent(Event);
  367. end;
  368. procedure TCompilerMessageWindow.SizeLimits(var Min, Max: TPoint);
  369. begin
  370. inherited SizeLimits(Min,Max);
  371. Min.X:=20;
  372. Min.Y:=4;
  373. end;
  374. procedure TCompilerMessageWindow.Close;
  375. begin
  376. Hide;
  377. end;
  378. function TCompilerMessageWindow.GetPalette: PPalette;
  379. const
  380. S : string[length(CBrowserWindow)] = CBrowserWindow;
  381. begin
  382. GetPalette:=@S;
  383. end;
  384. constructor TCompilerMessageWindow.Load(var S: TStream);
  385. begin
  386. inherited Load(S);
  387. GetSubViewPtr(S,MsgLB);
  388. end;
  389. procedure TCompilerMessageWindow.Store(var S: TStream);
  390. begin
  391. if MsgLB^.List=nil then
  392. MsgLB^.NewList(New(PCollection, Init(100,100)));
  393. inherited Store(S);
  394. PutSubViewPtr(S,MsgLB);
  395. end;
  396. procedure TCompilerMessageWindow.UpdateCommands;
  397. var Active: boolean;
  398. begin
  399. Active:=GetState(sfActive);
  400. SetCmdState(CompileCmds,Active);
  401. Message(Application,evBroadcast,cmCommandSetChanged,nil);
  402. end;
  403. procedure TCompilerMessageWindow.SetState(AState: Word; Enable: Boolean);
  404. var OldState: word;
  405. begin
  406. OldState:=State;
  407. inherited SetState(AState,Enable);
  408. if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
  409. UpdateCommands;
  410. end;
  411. destructor TCompilerMessageWindow.Done;
  412. begin
  413. CompilerMessageWindow:=nil;
  414. inherited Done;
  415. end;
  416. {****************************************************************************
  417. CompilerStatusDialog
  418. ****************************************************************************}
  419. constructor TCompilerStatusDialog.Init;
  420. var R: TRect;
  421. begin
  422. R.Assign(0,0,56,11);
  423. ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
  424. inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
  425. GetExtent(R); R.B.Y:=11;
  426. R.Grow(-3,-2);
  427. New(ST, Init(R, ''));
  428. Insert(ST);
  429. GetExtent(R); R.B.Y:=11;
  430. R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
  431. New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256,true));
  432. Insert(KeyST);
  433. { Reset Status infos see bug 1585 }
  434. Fillchar(Status,SizeOf(Status),#0);
  435. end;
  436. destructor TCompilerStatusDialog.Done;
  437. begin
  438. if @Self=CompilerStatusDialog then
  439. CompilerStatusDialog:=nil;
  440. Inherited Done;
  441. end;
  442. procedure TCompilerStatusDialog.Update;
  443. var
  444. StatusS,KeyS: string;
  445. const
  446. MaxFileNameSize = 46;
  447. begin
  448. case CompilationPhase of
  449. cpCompiling :
  450. begin
  451. ClearFormatParams;
  452. if Status.Compiling_current then
  453. begin
  454. AddFormatParamStr(ShrinkPath(SmartPath(Status.Currentsourcepath+Status.CurrentSource),
  455. MaxFileNameSize - Length(msg_compilingfile)));
  456. StatusS:=FormatStrF(msg_compilingfile,FormatParams);
  457. end
  458. else
  459. begin
  460. if Status.CurrentSource='' then
  461. StatusS:=''
  462. else
  463. begin
  464. StatusS:=ShrinkPath(SmartPath(DirAndNameOf(Status.Currentsourcepath+Status.CurrentSource)),
  465. MaxFileNameSize-Length(msg_loadingunit));
  466. AddFormatParamStr(StatusS);
  467. StatusS:=FormatStrF(msg_loadingunit,FormatParams);
  468. end;
  469. end;
  470. KeyS:=msg_hint_pressesctocancel;
  471. end;
  472. cpLinking :
  473. begin
  474. ClearFormatParams;
  475. AddFormatParamStr(ShrinkPath(ExeFile,
  476. MaxFileNameSize-Length(msg_linkingfile)));
  477. StatusS:=FormatStrF(msg_linkingfile,FormatParams);
  478. KeyS:=msg_hint_pleasewait;
  479. end;
  480. cpDone :
  481. begin
  482. StatusS:=msg_compiledone;
  483. KeyS:=msg_hint_compilesuccessfulpressenter;
  484. end;
  485. cpFailed :
  486. begin
  487. StatusS:=msg_failedtocompile;
  488. KeyS:=msg_hint_compilefailed;
  489. end;
  490. cpAborted :
  491. begin
  492. StatusS:=msg_compilationaborted;
  493. KeyS:=msg_hint_compileaborted;
  494. end;
  495. end;
  496. ClearFormatParams;
  497. AddFormatParamStr(ShrinkPath(SmartPath(MainFile),
  498. MaxFileNameSize-Length('Main file: %s')));
  499. AddFormatParamStr(StatusS);
  500. AddFormatParamStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
  501. AddFormatParamInt(Status.CurrentLine);
  502. AddFormatParamInt(Status.CompiledLines);
  503. AddFormatParamInt((Heapsize-MemAvail) div 1024);
  504. AddFormatParamInt(Heapsize div 1024);
  505. AddFormatParamInt(Status.ErrorCount);
  506. ST^.SetText(
  507. FormatStrF(
  508. 'Main file: %s'#13+
  509. '%s'+#13#13+
  510. 'Target: %s'#13+
  511. 'Line number: %6d '+'Total lines: %6d'+#13+
  512. 'Used memory: %6dK '+'Allocated memory: %6dK'#13+
  513. 'Total errors: %5d',
  514. FormatParams)
  515. );
  516. KeyST^.SetText(^C+KeyS);
  517. end;
  518. {****************************************************************************
  519. Compiler Hooks
  520. ****************************************************************************}
  521. function CompilerStatus: boolean; {$ifndef FPC}far;{$endif}
  522. var
  523. event : tevent;
  524. begin
  525. GetKeyEvent(Event);
  526. if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
  527. begin
  528. CompilationPhase:=cpAborted;
  529. { update info messages }
  530. if assigned(CompilerStatusDialog) then
  531. begin
  532. {$ifdef redircompiler}
  533. RedirDisableAll;
  534. {$endif}
  535. CompilerStatusDialog^.Update;
  536. {$ifdef redircompiler}
  537. RedirEnableAll;
  538. {$endif}
  539. end;
  540. CompilerStatus:=true;
  541. exit;
  542. end;
  543. { only display line info every 100 lines, ofcourse all other messages
  544. will be displayed directly }
  545. if (status.currentline mod 100=0) then
  546. begin
  547. { update info messages }
  548. {$ifdef redircompiler}
  549. RedirDisableAll;
  550. {$endif}
  551. if assigned(CompilerStatusDialog) then
  552. CompilerStatusDialog^.Update;
  553. {$ifdef redircompiler}
  554. RedirEnableAll;
  555. {$endif}
  556. { update memory usage }
  557. { HeapView^.Update; }
  558. end;
  559. CompilerStatus:=false;
  560. end;
  561. const
  562. LONGJMPCALLED = -1;
  563. procedure CompilerStop(err: longint); {$ifndef FPC}far;{$endif}
  564. begin
  565. {$ifdef HasSignal}
  566. if StopJmpValid then
  567. Longjmp(StopJmp,LONGJMPCALLED)
  568. else
  569. Halt(err);
  570. {$endif}
  571. end;
  572. Function CompilerGetNamedFileTime(const filename : string) : Longint; {$ifndef FPC}far;{$endif}
  573. var t: longint;
  574. W: PSourceWindow;
  575. begin
  576. W:=EditorWindowFile(FExpand(filename));
  577. if Assigned(W) and (W^.Editor^.GetModified) then
  578. t:=Now
  579. else
  580. t:=def_getnamedfiletime(filename);
  581. CompilerGetNamedFileTime:=t;
  582. end;
  583. function CompilerOpenInputFile(const filename: string): tinputfile; {$ifndef FPC}far;{$endif}
  584. var f: tinputfile;
  585. W: PSourceWindow;
  586. begin
  587. if assigned(CompilingHiddenFile) and
  588. (NameandExtof(filename)=CompilingHiddenFile^.Editor^.Filename) then
  589. W:=CompilingHiddenFile
  590. else
  591. W:=EditorWindowFile(FExpand(filename));
  592. if Assigned(W) and (W^.Editor^.GetModified) then
  593. f:=TFPInputFile.Create(W^.Editor)
  594. else
  595. f:=def_openinputfile(filename);
  596. if assigned(W) then
  597. W^.Editor^.CompileStamp:=CompileStamp;
  598. CompilerOpenInputFile:=f;
  599. end;
  600. function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif}
  601. begin
  602. CompilerComment:=false;
  603. if (status.verbosity and Level)<>0 then
  604. begin
  605. {$ifdef redircompiler}
  606. RedirDisableAll;
  607. {$endif}
  608. if not CompilerMessageWindow^.GetState(sfVisible) then
  609. CompilerMessageWindow^.Show;
  610. if Desktop^.First<>PView(CompilerMessageWindow) then
  611. CompilerMessageWindow^.MakeFirst;
  612. CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
  613. status.currentline,status.currentcolumn);
  614. { update info messages }
  615. if assigned(CompilerStatusDialog) then
  616. CompilerStatusDialog^.Update;
  617. {$ifdef DEBUG}
  618. {$ifndef NODEBUG}
  619. // def_gdb_stop(level);
  620. {$endif}
  621. {$endif DEBUG}
  622. {$ifdef redircompiler}
  623. RedirEnableAll;
  624. {$endif}
  625. { update memory usage }
  626. { HeapView^.Update; }
  627. end;
  628. end;
  629. {****************************************************************************
  630. DoCompile
  631. ****************************************************************************}
  632. { This function must return '' if
  633. "Options|Directories|Exe and PPU directory" is empty }
  634. function GetExePath: string;
  635. var Path: string;
  636. I: Sw_integer;
  637. begin
  638. Path:='';
  639. if DirectorySwitches<>nil then
  640. with DirectorySwitches^ do
  641. for I:=0 to ItemCount-1 do
  642. begin
  643. if ItemParam(I)='-FE' then
  644. begin
  645. Path:=GetStringItem(I);
  646. Break;
  647. end;
  648. end;
  649. if Path<>'' then
  650. GetExePath:=CompleteDir(FExpand(Path))
  651. else
  652. GetExePath:='';
  653. end;
  654. function GetMainFile(Mode: TCompileMode): string;
  655. var FileName: string;
  656. P : PSourceWindow;
  657. begin
  658. if assigned(CompilingHiddenFile) then
  659. P:=CompilingHiddenFile
  660. else
  661. P:=Message(Desktop,evBroadcast,cmSearchWindow,nil);
  662. if (PrimaryFileMain='') and (P=nil) then
  663. FileName:='' { nothing to compile }
  664. else
  665. begin
  666. if (PrimaryFileMain<>'') and (Mode<>cCompile) then
  667. FileName:=PrimaryFileMain
  668. else if assigned(P) then
  669. begin
  670. FileName:=P^.Editor^.FileName;
  671. if FileName='' then
  672. begin
  673. P^.Editor^.SaveAsk(true);
  674. FileName:=P^.Editor^.FileName;
  675. end;
  676. end
  677. else
  678. FileName:='';
  679. end;
  680. If (FileName<>'') then
  681. FileName:=FixFileName(FExpand(FileName));
  682. GetMainFile:=FileName;
  683. end;
  684. procedure ResetErrorMessages;
  685. procedure ResetErrorLine(P: PView); {$ifndef FPC}far;{$endif}
  686. begin
  687. if assigned(P) and
  688. (TypeOf(P^)=TypeOf(TSourceWindow)) then
  689. PSourceWindow(P)^.Editor^.SetErrorMessage('');
  690. end;
  691. begin
  692. Desktop^.ForEach(@ResetErrorLine);
  693. end;
  694. procedure DoCompile(Mode: TCompileMode);
  695. function IsExitEvent(E: TEvent): boolean;
  696. begin
  697. { following suggestion by Harsha Senanayake }
  698. IsExitEvent:=(E.What=evKeyDown);
  699. end;
  700. function GetTargetExeExt : string;
  701. begin
  702. GetTargetExeExt:=target_info.exeext;
  703. end;
  704. var
  705. s,FileName: string;
  706. ErrFile : Text;
  707. MustRestartDebugger,
  708. StoreStopJumpValid : boolean;
  709. StoreStopJmp : Jmp_buf;
  710. StoreExitProc : pointer;
  711. JmpRet,Error,LinkErrorCount : longint;
  712. E : TEvent;
  713. DummyView: PView;
  714. PPasFile : string[64];
  715. begin
  716. AskRecompileIfModifiedFlag:=true;
  717. { Get FileName }
  718. FileName:=GetMainFile(Mode);
  719. if FileName='' then
  720. begin
  721. ErrorBox(msg_nothingtocompile,nil);
  722. Exit;
  723. end else
  724. { THis is not longer necessary as unsaved files are loaded from a memorystream,
  725. and with the file as primaryfile set it is already incompatible with itself
  726. if FileName='*' then
  727. begin
  728. ErrorBox(msg_cantcompileunsavedfile,nil);
  729. Exit;
  730. end; }
  731. PushStatus('Beginning compilation...');
  732. { Show Compiler Messages Window }
  733. { if not CompilerMessageWindow^.GetState(sfVisible) then
  734. CompilerMessageWindow^.Show;
  735. CompilerMessageWindow^.MakeFirst;}
  736. CompilerMessageWindow^.ClearMessages;
  737. { Tell why we compile }
  738. NeedRecompile(Mode,true);
  739. MainFile:=FileName;
  740. SetStatus('Writing switches to file...');
  741. WriteSwitches(SwitchesPath);
  742. { leaving open browsers leads to crashes !! (PM) }
  743. SetStatus('Preparing symbol info...');
  744. CloseAllBrowsers;
  745. if ((DesktopFileFlags and dfSymbolInformation)<>0) then
  746. WriteSymbolsFile(BrowserName);
  747. { MainFile:=FixFileName(FExpand(FileName));}
  748. SetStatus('Preparing to compile...'+NameOf(MainFile));
  749. { Reset }
  750. CtrlBreakHit:=false;
  751. { Create Compiler Status Dialog }
  752. CompilationPhase:=cpCompiling;
  753. if not assigned(CompilingHiddenFile) then
  754. begin
  755. New(CompilerStatusDialog, Init);
  756. CompilerStatusDialog^.SetState(sfModal,true);
  757. { disable window closing }
  758. CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags and not wfclose;
  759. Application^.Insert(CompilerStatusDialog);
  760. CompilerStatusDialog^.Update;
  761. end;
  762. { Restore dir that could be changed during debugging }
  763. {$I-}
  764. ChDir(StartUpDir);
  765. {$I+}
  766. EatIO;
  767. { hook compiler output }
  768. do_status:=@CompilerStatus;
  769. do_stop:=@CompilerStop;
  770. do_comment:=@CompilerComment;
  771. do_openinputfile:=@CompilerOpenInputFile;
  772. do_getnamedfiletime:=@CompilerGetNamedFileTime;
  773. do_initsymbolinfo:=@InitBrowserCol;
  774. do_donesymbolinfo:=@DoneBrowserCol;
  775. do_extractsymbolinfo:=@CreateBrowserCol;
  776. { Compile ! }
  777. {$ifdef redircompiler}
  778. ChangeRedirOut(FPOutFileName,false);
  779. ChangeRedirError(FPErrFileName,false);
  780. {$endif}
  781. { insert "" around name so that spaces are allowed }
  782. { only supported in compiler after 2000/01/14 PM }
  783. if pos(' ',FileName)>0 then
  784. FileName:='"'+FileName+'"';
  785. if mode=cBuild then
  786. FileName:='-B '+FileName;
  787. { tokens are created and distroed by compiler.compile !! PM }
  788. DoneTokens;
  789. PPasFile:='ppas'+source_info.scriptext;
  790. WUtils.DeleteFile(GetExePath+PpasFile);
  791. SetStatus('Compiling...');
  792. {$ifdef HasSignal}
  793. StoreStopJumpValid:=StopJmpValid;
  794. StoreStopJmp:=StopJmp;
  795. {$endif HasSignal}
  796. StoreExitProc:=ExitProc;
  797. {$ifdef HasSignal}
  798. StopJmpValid:=true;
  799. JmpRet:=SetJmp(StopJmp);
  800. {$else}
  801. JmpRet:=0;
  802. {$endif HasSignal}
  803. if JmpRet=0 then
  804. begin
  805. inc(CompileStamp);
  806. ResetErrorMessages;
  807. {$ifndef NODEBUG}
  808. MustRestartDebugger:=false;
  809. if assigned(Debugger) then
  810. if Debugger^.HasExe then
  811. begin
  812. Debugger^.Reset;
  813. MustRestartDebugger:=true;
  814. end;
  815. {$endif NODEBUG}
  816. FpIntF.Compile(FileName,SwitchesPath);
  817. SetStatus('Finished compiling...');
  818. end
  819. else
  820. begin
  821. { We need to restore Exitproc to the value
  822. it was before calling FPintF.compile PM }
  823. ExitProc:=StoreExitProc;
  824. Inc(status.errorCount);
  825. {$ifdef HasSignal}
  826. Case JmpRet of
  827. LONGJMPCALLED : s:='Error';
  828. SIGINT : s := 'Interrupted by Ctrl-C';
  829. SIGILL : s := 'Illegal instruction';
  830. SIGSEGV : s := 'Signal Segmentation violation';
  831. SIGFPE : s:='Floating point signal';
  832. else
  833. s:='Undetermined signal '+inttostr(JmpRet);
  834. end;
  835. CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0);
  836. {$endif HasSignal}
  837. if JmpRet<>LONGJMPCALLED then
  838. begin
  839. CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
  840. SetStatus('Long jumped out of compilation...');
  841. end;
  842. end;
  843. {$ifdef HasSignal}
  844. StopJmpValid:=StoreStopJumpValid;
  845. StopJmp:=StoreStopJmp;
  846. {$endif HasSignal}
  847. { Retrieve created exefile }
  848. If GetEXEPath<>'' then
  849. EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+GetTargetExeExt)
  850. else
  851. EXEFile:=DirOf(MainFile)+NameOf(MainFile)+GetTargetExeExt;
  852. { tokens are created and distroyed by compiler.compile !! PM }
  853. InitTokens;
  854. if LinkAfter and
  855. ExistsFile(GetExePath+PpasFile) and
  856. (CompilationPhase<>cpAborted) and
  857. (status.errorCount=0) then
  858. begin
  859. CompilationPhase:=cpLinking;
  860. if assigned(CompilerStatusDialog) then
  861. CompilerStatusDialog^.Update;
  862. SetStatus('Assembling and/or linking...');
  863. {$ifndef redircompiler}
  864. { At least here we want to catch output
  865. of batch file PM }
  866. ChangeRedirOut(FPOutFileName,false);
  867. ChangeRedirError(FPErrFileName,false);
  868. {$endif}
  869. {$ifdef Unix}
  870. {$ifdef ver1_0}
  871. Shell(GetExePath+PpasFile);
  872. Error:=LinuxError;
  873. {$else}
  874. error:=0;
  875. If Shell(GetExePath+PpasFile)=-1 Then
  876. Error:=fpgeterrno;
  877. {$endif}
  878. {$else}
  879. DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile);
  880. Error:=DosError;
  881. {$endif}
  882. SetStatus('Finished linking...');
  883. RestoreRedirOut;
  884. RestoreRedirError;
  885. if Error<>0 then
  886. Inc(status.errorCount);
  887. if Status.IsExe and not Status.IsLibrary and not ExistsFile(EXEFile) then
  888. begin
  889. Inc(status.errorCount);
  890. ClearFormatParams; AddFormatParamStr(ExeFile);
  891. CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
  892. {$I-}
  893. Assign(ErrFile,FPErrFileName);
  894. Reset(ErrFile);
  895. if EatIO<>0 then
  896. ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
  897. else
  898. begin
  899. LinkErrorCount:=0;
  900. While not eof(ErrFile) and (LinkErrorCount<25) do
  901. begin
  902. readln(ErrFile,s);
  903. CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
  904. inc(LinkErrorCount);
  905. end;
  906. if not eof(ErrFile) then
  907. begin
  908. ClearFormatParams; AddFormatParamStr(FPErrFileName);
  909. CompilerMessageWindow^.AddMessage(V_error,
  910. FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
  911. end;
  912. Close(ErrFile);
  913. end;
  914. EatIO;
  915. {$I+}
  916. end
  917. else if error=0 then
  918. WUtils.DeleteFile(GetExePath+PpasFile);
  919. end;
  920. {$ifdef redircompiler}
  921. RestoreRedirOut;
  922. RestoreRedirError;
  923. {$endif}
  924. PopStatus;
  925. { Set end status }
  926. if not (CompilationPhase in [cpAborted,cpFailed]) then
  927. if (status.errorCount=0) then
  928. begin
  929. CompilationPhase:=cpDone;
  930. LastCompileTime := cardinal(Now);
  931. end
  932. else
  933. CompilationPhase:=cpFailed;
  934. { Show end status }
  935. { reenable window closing }
  936. if assigned(CompilerStatusDialog) then
  937. begin
  938. CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags or wfclose;
  939. CompilerStatusDialog^.Update;
  940. CompilerStatusDialog^.ReDraw;
  941. CompilerStatusDialog^.SetState(sfModal,false);
  942. if ((CompilationPhase in [cpAborted,cpDone,cpFailed]) or (ShowStatusOnError))
  943. and ((Mode<>cRun) or (CompilationPhase<>cpDone)) then
  944. repeat
  945. CompilerStatusDialog^.GetEvent(E);
  946. if IsExitEvent(E)=false then
  947. CompilerStatusDialog^.HandleEvent(E);
  948. until IsExitEvent(E) or not assigned(CompilerStatusDialog);
  949. {if IsExitEvent(E) then
  950. Application^.PutEvent(E);}
  951. if assigned(CompilerStatusDialog) then
  952. begin
  953. Application^.Delete(CompilerStatusDialog);
  954. Dispose(CompilerStatusDialog, Done);
  955. end;
  956. end;
  957. CompilerStatusDialog:=nil;
  958. { end compilation returns true if the messagewindow should be removed }
  959. if CompilationPhase=cpDone then
  960. begin
  961. CompilerMessageWindow^.Hide;
  962. { This is the last compiled main file }
  963. PrevMainFile:=MainFile;
  964. MainHasDebugInfo:=DebugInfoSwitches^.GetCurrSelParam<>'-';
  965. end;
  966. { Update the app }
  967. Message(Application,evCommand,cmUpdate,nil);
  968. DummyView:=Desktop^.First;
  969. while (DummyView<>nil) and (DummyView^.GetState(sfVisible)=false) do
  970. begin
  971. DummyView:=DummyView^.NextView;
  972. end;
  973. with DummyView^ do
  974. if GetState(sfVisible) then
  975. begin
  976. SetState(sfSelected,false);
  977. SetState(sfSelected,true);
  978. end;
  979. if Assigned(CompilerMessageWindow) then
  980. with CompilerMessageWindow^ do
  981. begin
  982. if GetState(sfVisible) then
  983. begin
  984. SetState(sfSelected,false);
  985. SetState(sfSelected,true);
  986. end;
  987. if (status.errorCount>0) then
  988. MsgLB^.SelectFirstError;
  989. end;
  990. { ^^^ we need this trick to reactivate the desktop }
  991. EditorModified:=false;
  992. {$ifndef NODEBUG}
  993. if MustRestartDebugger then
  994. InitDebugger;
  995. {$endif NODEBUG}
  996. { In case we have something that the compiler touched }
  997. AskToReloadAllModifiedFiles;
  998. { Try to read Browser info in again if compilation failure !! }
  999. if Not Assigned(Modules) and (CompilationPhase<>cpDone) and
  1000. ((DesktopFileFlags and dfSymbolInformation)<>0) then
  1001. ReadSymbolsFile(BrowserName);
  1002. if UseAllUnitsInCodeComplete and not assigned(CompilingHiddenFile) then
  1003. AddAvailableUnitsToCodeComplete(false);
  1004. end;
  1005. function NeedRecompile(Mode :TCompileMode; verbose : boolean): boolean;
  1006. var Need: boolean;
  1007. I: sw_integer;
  1008. SF: PSourceFile;
  1009. SourceTime,PPUTime,ObjTime: longint;
  1010. W: PSourceWindow;
  1011. begin
  1012. if Assigned(SourceFiles)=false then
  1013. Need:={(EditorModified=true)}true
  1014. else
  1015. begin
  1016. Need:=(PrevMainFile<>GetMainFile(Mode)) and (PrevMainFile<>'');
  1017. if Need then
  1018. begin
  1019. if verbose then
  1020. begin
  1021. ClearFormatParams; AddFormatParamStr(GetMainFile(Mode));
  1022. CompilerMessageWindow^.AddMessage(V_info,
  1023. FormatStrF(msg_firstcompilationof,FormatParams),
  1024. '',0,0);
  1025. end;
  1026. end
  1027. else
  1028. for I:=0 to SourceFiles^.Count-1 do
  1029. begin
  1030. SF:=SourceFiles^.At(I);
  1031. SourceTime:=GetFileTime(SF^.GetSourceFileName);
  1032. PPUTime:=GetFileTime(SF^.GetPPUFileName);
  1033. ObjTime:=GetFileTime(SF^.GetObjFileName);
  1034. { writeln('S: ',SF^.GetSourceFileName,' - ',SourceTime);
  1035. writeln('P: ',SF^.GetPPUFileName,' - ',PPUTime);
  1036. writeln('O: ',SF^.GetObjFileName,' - ',ObjTime);
  1037. writeln('------');}
  1038. { some units don't generate object files }
  1039. W:=EditorWindowFile(SF^.GetSourceFileName);
  1040. if (SourceTime<>-1) then
  1041. if ((SourceTime>PPUTime) or
  1042. ((SourceTime>ObjTime) and
  1043. (ObjTime<>-1))) or
  1044. (assigned(W) and (W^.Editor^.CompileStamp<0)) then
  1045. begin
  1046. Need:=true;
  1047. if verbose then
  1048. begin
  1049. ClearFormatParams; AddFormatParamStr(SF^.GetSourceFileName);
  1050. CompilerMessageWindow^.AddMessage(V_info,
  1051. FormatStrF(msg_recompilingbecauseof,FormatParams),
  1052. SF^.GetSourceFileName,1,1);
  1053. end;
  1054. Break;
  1055. end;
  1056. end;
  1057. { writeln('Need?', Need); system.readln;}
  1058. end;
  1059. NeedRecompile:=Need;
  1060. end;
  1061. constructor TFPInputFile.Create(AEditor: PFileEditor);
  1062. begin
  1063. if not Assigned(AEditor) then Fail;
  1064. if inherited Create(AEditor^.FileName)=nil then
  1065. Fail;
  1066. Editor:=AEditor;
  1067. end;
  1068. function TFPInputFile.fileopen(const filename: string): boolean;
  1069. var OK: boolean;
  1070. begin
  1071. S:=New(PMemoryStream, Init(0,0));
  1072. OK:=Assigned(S) and (S^.Status=stOK);
  1073. if OK then OK:=Editor^.SaveToStream(S);
  1074. if OK then
  1075. S^.Seek(0)
  1076. else
  1077. begin
  1078. if Assigned(S) then Dispose(S, Done);
  1079. S:=nil;
  1080. end;
  1081. fileopen:=OK;
  1082. end;
  1083. function TFPInputFile.fileseek(pos: longint): boolean;
  1084. var OK: boolean;
  1085. begin
  1086. OK:=assigned(S);
  1087. if OK then
  1088. begin
  1089. S^.Reset;
  1090. S^.Seek(pos);
  1091. OK:=(S^.Status=stOK);
  1092. end;
  1093. fileseek:=OK;
  1094. end;
  1095. function TFPInputFile.fileread(var databuf; maxsize: longint): longint;
  1096. var
  1097. size: longint;
  1098. begin
  1099. if not assigned(S) then size:=0 else
  1100. begin
  1101. size:=min(maxsize,(S^.GetSize-S^.GetPos));
  1102. S^.Read(databuf,size);
  1103. if S^.Status<>stOK then size:=0;
  1104. end;
  1105. fileread:=size;
  1106. end;
  1107. function TFPInputFile.fileeof: boolean;
  1108. var EOF: boolean;
  1109. begin
  1110. EOF:=not assigned(S);
  1111. if not EOF then
  1112. EOF:=(S^.Status<>stOK) or (S^.GetPos=S^.GetSize);
  1113. fileeof:=EOF;
  1114. end;
  1115. function TFPInputFile.fileclose: boolean;
  1116. var OK: boolean;
  1117. begin
  1118. OK:=assigned(S);
  1119. if OK then
  1120. begin
  1121. S^.Reset;
  1122. Dispose(S, Done);
  1123. S:=nil;
  1124. OK:=true;
  1125. end;
  1126. fileclose:=OK;
  1127. end;
  1128. procedure RegisterFPCompile;
  1129. begin
  1130. {$ifndef NOOBJREG}
  1131. RegisterType(RCompilerMessageListBox);
  1132. RegisterType(RCompilerMessageWindow);
  1133. {$endif}
  1134. end;
  1135. end.
  1136. {
  1137. $Log$
  1138. Revision 1.30 2004-11-14 21:45:28 florian
  1139. * fixed non working mouse after tools call
  1140. * better handling of source/target info
  1141. * more info in about dialog
  1142. * better info in compiler status dialiog
  1143. Revision 1.29 2004/11/08 20:28:26 peter
  1144. * Breakpoints are now deleted when removed from source, disabling is
  1145. still possible from the breakpoint list
  1146. * COMPILER_1_0, FVISION, GABOR defines removed, only support new
  1147. FV and 1.9.x compilers
  1148. * Run directory added to Run menu
  1149. * Useless programinfo window removed
  1150. Revision 1.28 2004/11/06 22:02:48 peter
  1151. * fixed resize helptext
  1152. Revision 1.27 2004/11/06 17:22:52 peter
  1153. * fixes for new fv
  1154. Revision 1.26 2004/11/05 00:00:33 peter
  1155. set exefile after compilation, before the target_info is not filled
  1156. Revision 1.25 2004/11/02 23:53:19 peter
  1157. * fixed crashes with ide and 1.9.x
  1158. Revision 1.24 2004/09/09 20:33:00 jonas
  1159. * made CompilerStop declaration compliant to new tstopprocedure type in
  1160. compiler
  1161. Revision 1.23 2003/11/14 17:29:38 marco
  1162. * linuxerrorcide
  1163. Revision 1.22 2003/03/28 09:55:46 armin
  1164. * Fixed TCompilerMessageWindow.AddMessage to see line numbers with 1.1
  1165. Revision 1.21 2003/03/27 14:11:53 pierre
  1166. * fix problem in CompilerComment procedure
  1167. Revision 1.20 2003/01/13 09:05:18 pierre
  1168. * fix error in last commit
  1169. Revision 1.19 2003/01/11 15:52:54 peter
  1170. * adapted for new 1.1 compiler verbosity
  1171. Revision 1.18 2002/12/02 13:58:29 pierre
  1172. * avoid longjmp messages if quitting after compilation error
  1173. Revision 1.17 2002/11/20 17:35:00 pierre
  1174. * use target_os.ExeExt for compiled executable
  1175. Revision 1.16 2002/10/23 19:19:40 hajny
  1176. * another bunch of missing HasSignal conditionals
  1177. Revision 1.15 2002/09/26 15:00:35 pierre
  1178. * fix problems with system unit is not present for __fp__ compilation
  1179. Revision 1.14 2002/09/13 22:30:50 pierre
  1180. * only fpc uses video unit
  1181. Revision 1.13 2002/09/09 06:53:54 pierre
  1182. * avoid to save file used by codecomplete
  1183. Revision 1.12 2002/09/07 15:40:42 peter
  1184. * old logs removed and tabs fixed
  1185. Revision 1.11 2002/09/05 08:45:40 pierre
  1186. * try to fix recompilation on changes problems
  1187. Revision 1.10 2002/09/04 14:07:12 pierre
  1188. + Enhance code complete by inserting unit symbols
  1189. Revision 1.9 2002/08/26 13:03:14 pierre
  1190. + add a lock to speed up parsing of userscreen
  1191. Revision 1.8 2002/04/10 22:37:37 pierre
  1192. * save and restore Exitproc if LongJmp called
  1193. Revision 1.7 2002/03/20 14:48:27 pierre
  1194. * moved StopJmp buffer to fpcatch unit
  1195. }