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