CreateCompilerTestPascalFilename now catches exceptions

git-svn-id: trunk@9282 -
This commit is contained in:
mattias 2006-05-14 19:56:31 +00:00
parent 336c22deda
commit 4985171d4c
4 changed files with 35 additions and 8 deletions

View File

@ -102,14 +102,27 @@ end;
function CreateCompilerTestPascalFilename: string; function CreateCompilerTestPascalFilename: string;
---------------------------------------------------------------------------} ---------------------------------------------------------------------------}
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 begin
Result:=AppendPathDelim(GetPrimaryConfigPath)+'compilertest.pas'; Result:=AppendPathDelim(GetPrimaryConfigPath)+'compilertest.pas';
if not FileExists(Result) then begin if CreateFile(Result) then exit;
fs:=TFileStream.Create(Result,fmCreate); Result:=AppendPathDelim(GetTempDir)+'compilertest1.pas';
fs.Free; if CreateFile(Result) then exit;
end; writeln('unable to create temporay file ',Result);
end; end;
{--------------------------------------------------------------------------- {---------------------------------------------------------------------------

View File

@ -529,6 +529,15 @@ var i, j, FilenameEndPos: integer;
and (CompilerOptions.ShowAll or CompilerOptions.ShowExecInfo) then and (CompilerOptions.ShowAll or CompilerOptions.ShowExecInfo) then
DoAddFilteredLine(s); DoAddFilteredLine(s);
end; end;
{ For example:
linkerror.o(.text$_main+0x9):linkerror.pas: undefined reference to `NonExistingFunction'
}
function CheckForLinkingErrors: boolean;
begin
Result:=false;
end;
begin begin
Result:=false; Result:=false;
@ -554,6 +563,9 @@ begin
// check for -vx output // check for -vx output
Result:=CheckForExecutableInfo; Result:=CheckForExecutableInfo;
if Result then exit; if Result then exit;
// check for linking errors
Result:=CheckForLinkingErrors;
if Result then exit;
// search for round bracket open // search for round bracket open
i:=1; i:=1;

View File

@ -293,6 +293,8 @@ begin
end; end;
CommandLine:=CommandLine+' '+Params; CommandLine:=CommandLine+' '+Params;
debugln('THTMLBrowserHelpViewer.ShowNode CommandLine=',CommandLine);
// run // run
try try
BrowserProcess:=TProcess.Create(nil); BrowserProcess:=TProcess.Create(nil);

View File

@ -332,7 +332,7 @@ type
var ListOfNodes: THelpNodeQueryList; var ListOfNodes: THelpNodeQueryList;
var ErrMsg: string): TShowHelpResult; virtual; var ErrMsg: string): TShowHelpResult; virtual;
function FindViewer(const MimeType: string; var ErrMsg: string; function FindViewer(const MimeType: string; var ErrMsg: string;
var Viewer: THelpViewer): TShowHelpResult; virtual; out Viewer: THelpViewer): TShowHelpResult; virtual;
public public
// registration // registration
procedure RegisterItem(NewItem: THelpDBItem); procedure RegisterItem(NewItem: THelpDBItem);
@ -981,7 +981,7 @@ begin
end; end;
function THelpDatabase.FindViewer(const MimeType: string; var ErrMsg: string; function THelpDatabase.FindViewer(const MimeType: string; var ErrMsg: string;
var Viewer: THelpViewer): TShowHelpResult; out Viewer: THelpViewer): TShowHelpResult;
var var
Viewers: TList; Viewers: TList;
begin begin