mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-29 19:02:52 +02:00
MG: assembler errors are now shown in output
git-svn-id: trunk@1780 -
This commit is contained in:
parent
a8838bdc2d
commit
10df9bb62e
@ -105,7 +105,7 @@ begin
|
||||
ProjectDir:=ExtractFilePath(ProjectFilename);
|
||||
if not SetCurrentDir(ProjectDir) then exit;
|
||||
try
|
||||
CmdLine := ConvertSpecialFileChars(AProject.CompilerOptions.CompilerPath);
|
||||
CmdLine := AProject.CompilerOptions.CompilerPath;
|
||||
|
||||
if Assigned(FOnCmdLineCreate) then begin
|
||||
Abort:=false;
|
||||
@ -189,6 +189,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.32 2002/07/05 12:34:08 lazarus
|
||||
MG: assembler errors are now shown in output
|
||||
|
||||
Revision 1.31 2002/07/05 10:53:25 lazarus
|
||||
MG: fixed compiling for invalid programnames
|
||||
|
||||
|
@ -42,7 +42,7 @@ interface
|
||||
|
||||
uses
|
||||
Forms, Classes, SysUtils, ComCtrls, Buttons, StdCtrls, ExtCtrls, LazConf,
|
||||
XMLCfg, FileCtrl, Dialogs, Controls, PathEditorDlg;
|
||||
XMLCfg, FileCtrl, Dialogs, Controls, PathEditorDlg, IDEProcs;
|
||||
|
||||
type
|
||||
{ Compiler Options object used to hold the compiler options }
|
||||
@ -948,7 +948,7 @@ begin
|
||||
if (UseLineInfoUnit) then
|
||||
switches := switches + ' -gl';
|
||||
|
||||
{ Use Heaptrc Unix }
|
||||
{ Use Heaptrc Unit }
|
||||
if (UseHeaptrc) then
|
||||
switches := switches + ' -gh';
|
||||
|
||||
@ -967,7 +967,7 @@ begin
|
||||
}
|
||||
case (LinkStyle) of
|
||||
1: switches := switches + ' -XD';
|
||||
2: ; // this is the default switches := switches + ' -XS';
|
||||
2: switches := switches + ' -XS';
|
||||
3: switches := switches + ' -XX';
|
||||
end;
|
||||
|
||||
@ -1033,7 +1033,7 @@ begin
|
||||
|
||||
{ Use Additional Config File @ = yes and path }
|
||||
if (AdditionalConfigFile) and (ConfigFilePath<>'') then
|
||||
switches := switches + ' ' + '@' + ConfigFilePath;
|
||||
switches := switches + ' ' + PrepareCmdLineOption('@' + ConfigFilePath);
|
||||
|
||||
{ ------------- Search Paths Tab ---------------- }
|
||||
if (IncludeFiles <> '') then
|
||||
@ -1049,7 +1049,7 @@ begin
|
||||
|
||||
{ Unit output directory }
|
||||
if UnitOutputDirectory<>'' then
|
||||
switches := switches + ' -FU' + UnitOutputDirectory;
|
||||
switches := switches + ' '+PrepareCmdLineOption('-FU'+UnitOutputDirectory);
|
||||
|
||||
{ TODO: Implement the following switches. They need to be added
|
||||
to the dialog. }
|
||||
@ -1102,7 +1102,7 @@ begin
|
||||
tempsw:=CreateTargetFilename(MainSourceFilename);
|
||||
if (tempsw <> ChangeFileExt(MainSourceFilename,''))
|
||||
or (UnitOutputDirectory<>'') then
|
||||
switches := switches + ' -o' + tempsw;
|
||||
switches := switches + ' '+PrepareCmdLineOption('-o' + tempsw);
|
||||
end;
|
||||
|
||||
fOptionsString := switches;
|
||||
@ -1135,7 +1135,7 @@ begin
|
||||
begin
|
||||
if (tempsw <> '') then
|
||||
tempsw := tempsw + ' ';
|
||||
tempsw := tempsw + switch + SS;
|
||||
tempsw := tempsw + PrepareCmdLineOption(switch + SS);
|
||||
Break;
|
||||
end
|
||||
else if (M = 1) then
|
||||
@ -1147,7 +1147,7 @@ begin
|
||||
begin
|
||||
if (tempsw <> '') then
|
||||
tempsw := tempsw + ' ';
|
||||
tempsw := tempsw + switch + Copy (SS, 1, M - 1);
|
||||
tempsw := tempsw + PrepareCmdLineOption(switch + Copy (SS, 1, M - 1));
|
||||
SS := Copy (SS, M + 1, Length(SS));
|
||||
end;
|
||||
until (SS = '') or (M = 0);
|
||||
|
@ -62,6 +62,7 @@ type
|
||||
fPrgSourceFilename: string;
|
||||
procedure DoAddFilteredLine(const s: string);
|
||||
procedure DoAddLastLinkerMessages;
|
||||
procedure DoAddLastAssemblerMessages;
|
||||
function SearchIncludeFile(const ShortIncFilename: string): string;
|
||||
public
|
||||
procedure Execute(TheProcess: TProcess);
|
||||
@ -206,6 +207,8 @@ function TOutputFilter.ReadFPCompilerLine(const s: string): boolean;
|
||||
<filename>(123) <ErrorType>: <some text>
|
||||
<filename>(456) <ErrorType>: <some text> in line (123)
|
||||
}
|
||||
const
|
||||
AsmError = 'Error while assembling';
|
||||
var i, j, FilenameEndPos: integer;
|
||||
MsgTypeName, Filename, Msg: string;
|
||||
MsgType: TErrorType;
|
||||
@ -309,6 +312,9 @@ begin
|
||||
or Project.CompilerOptions.ShowAll);
|
||||
if copy(s,j+2,length(s)-j-1)='Error while linking' then begin
|
||||
DoAddLastLinkerMessages;
|
||||
end
|
||||
else if copy(s,j+2,length(AsmError))=AsmError then begin
|
||||
DoAddLastAssemblerMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -477,6 +483,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOutputFilter.DoAddLastAssemblerMessages;
|
||||
const
|
||||
AsmStartMsg = 'Assembler messages:';
|
||||
var i: integer;
|
||||
begin
|
||||
// read back to 'Assembler messages:' message
|
||||
i:=fOutput.Count-1;
|
||||
while (i>=0) and (LeftStr(fOutput[i],length(AsmStartMsg))<>AsmStartMsg) do
|
||||
dec(i);
|
||||
while (i<fOutput.Count-1) do begin
|
||||
if (fOutput[i]<>'') then
|
||||
DoAddFilteredLine(fOutput[i]);
|
||||
inc(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TOutputFilter.SearchIncludeFile(const ShortIncFilename: string
|
||||
): string;
|
||||
// search the include file and make it relative to the current start directory
|
||||
|
Loading…
Reference in New Issue
Block a user