From 4985171d4c20caa0c984d0dda51476d9480e0cc3 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 14 May 2006 19:56:31 +0000 Subject: [PATCH] CreateCompilerTestPascalFilename now catches exceptions git-svn-id: trunk@9282 - --- ide/include/unix/lazbaseconf.inc | 25 +++++++++++++++++++------ ide/outputfilter.pas | 12 ++++++++++++ lcl/lazhelphtml.pas | 2 ++ lcl/lazhelpintf.pas | 4 ++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/ide/include/unix/lazbaseconf.inc b/ide/include/unix/lazbaseconf.inc index 9f2470c599..2667ab6608 100644 --- a/ide/include/unix/lazbaseconf.inc +++ b/ide/include/unix/lazbaseconf.inc @@ -102,14 +102,27 @@ end; function CreateCompilerTestPascalFilename: string; ---------------------------------------------------------------------------} function CreateCompilerTestPascalFilename: string; -var - fs: TFileStream; + + function CreateFile(const Filename: string): boolean; + var + fs: TFileStream; + begin + if FileExists(Filename) then exit(true); + Result:=false; + try + fs:=TFileStream.Create(Filename,fmCreate); + fs.Free; + Result:=true; + except + end; + end; + begin Result:=AppendPathDelim(GetPrimaryConfigPath)+'compilertest.pas'; - if not FileExists(Result) then begin - fs:=TFileStream.Create(Result,fmCreate); - fs.Free; - end; + if CreateFile(Result) then exit; + Result:=AppendPathDelim(GetTempDir)+'compilertest1.pas'; + if CreateFile(Result) then exit; + writeln('unable to create temporay file ',Result); end; {--------------------------------------------------------------------------- diff --git a/ide/outputfilter.pas b/ide/outputfilter.pas index b5209847a8..f48cf76b5d 100644 --- a/ide/outputfilter.pas +++ b/ide/outputfilter.pas @@ -529,6 +529,15 @@ var i, j, FilenameEndPos: integer; and (CompilerOptions.ShowAll or CompilerOptions.ShowExecInfo) then DoAddFilteredLine(s); end; + + { For example: + linkerror.o(.text$_main+0x9):linkerror.pas: undefined reference to `NonExistingFunction' + } + function CheckForLinkingErrors: boolean; + begin + + Result:=false; + end; begin Result:=false; @@ -554,6 +563,9 @@ begin // check for -vx output Result:=CheckForExecutableInfo; if Result then exit; + // check for linking errors + Result:=CheckForLinkingErrors; + if Result then exit; // search for round bracket open i:=1; diff --git a/lcl/lazhelphtml.pas b/lcl/lazhelphtml.pas index becebaa985..e5dce91965 100644 --- a/lcl/lazhelphtml.pas +++ b/lcl/lazhelphtml.pas @@ -293,6 +293,8 @@ begin end; CommandLine:=CommandLine+' '+Params; + debugln('THTMLBrowserHelpViewer.ShowNode CommandLine=',CommandLine); + // run try BrowserProcess:=TProcess.Create(nil); diff --git a/lcl/lazhelpintf.pas b/lcl/lazhelpintf.pas index e3dc9523a0..b547b3a60a 100644 --- a/lcl/lazhelpintf.pas +++ b/lcl/lazhelpintf.pas @@ -332,7 +332,7 @@ type var ListOfNodes: THelpNodeQueryList; var ErrMsg: string): TShowHelpResult; virtual; function FindViewer(const MimeType: string; var ErrMsg: string; - var Viewer: THelpViewer): TShowHelpResult; virtual; + out Viewer: THelpViewer): TShowHelpResult; virtual; public // registration procedure RegisterItem(NewItem: THelpDBItem); @@ -981,7 +981,7 @@ begin end; function THelpDatabase.FindViewer(const MimeType: string; var ErrMsg: string; - var Viewer: THelpViewer): TShowHelpResult; + out Viewer: THelpViewer): TShowHelpResult; var Viewers: TList; begin