IDE: fpc msg pasrser: show OS X assembler error unsupported directive

git-svn-id: trunk@50109 -
This commit is contained in:
mattias 2015-10-18 17:43:07 +00:00
parent d3d122a6ee
commit 003ebea47a
2 changed files with 27 additions and 1 deletions

View File

@ -23,6 +23,7 @@ const
SubToolFPCLinker = 'FPCLinker';
SubToolFPCRes = 'FPCRes';
SubToolFPCWindRes = 'FPCWindRes';
SubToolFPCAssembler = 'FPCAssembler';
SubToolMake = 'make';
SubToolMakePriority = 1000; // higher than FPC

View File

@ -182,7 +182,7 @@ type
function CheckForMsgId(p: PChar): boolean; // (MsgId) message
function CheckForFileLineColMessage(p: PChar): boolean; // the normal messages: filename(y,x): Hint: ..
function CheckForGeneralMessage(p: PChar): boolean; // Fatal: .., Error: ..., Panic: ..
function CheckForInfos(p: PChar): boolean;
function CheckForInfos(p: PChar): boolean; // e.g. Free Pascal Compiler version 2.6.4 [2014/02/26] for i386
function CheckForCompilingState(p: PChar): boolean; // Compiling ..
function CheckForAssemblingState(p: PChar): boolean; // Assembling ..
function CheckForLinesCompiled(p: PChar): boolean; // ..lines compiled..
@ -190,6 +190,7 @@ type
function CheckForLineProgress(p: PChar): boolean; // 600 206.521/231.648 Kb Used
function CheckForLoadFromUnit(p: PChar): Boolean;
function CheckForWindresErrors(p: PChar): boolean;
function CheckForAssemblerErrors(p: PChar): boolean;
function CreateMsgLine: TMessageLine;
procedure AddLinkingMessages;
procedure AddResourceMessages;
@ -1473,6 +1474,28 @@ begin
AddMsgLine(MsgLine);
end;
function TIDEFPCParser.CheckForAssemblerErrors(p: PChar): boolean;
// example:
// <stdin>:227:9: error: unsupported directive '.stabs'
var
APos: PChar;
s: string;
MsgLine: TMessageLine;
begin
Result:=false;
APos:=FindSubStrI('error: unsupported directive',p);
if APos=nil then exit;
Result:=true;
MsgLine:=CreateMsgLine;
MsgLine.SubTool:=SubToolFPCWindRes;
MsgLine.Urgency:=mluError;
s:=APos;
if Pos('.stabs',s)>0 then
s+='. Hint: Use another type of debug info.';
MsgLine.Msg:='assembler: '+s;
AddMsgLine(MsgLine);
end;
function TIDEFPCParser.CheckForInfos(p: PChar): boolean;
function ReadFPCLogo(PatternItem: PPatternToMsgID;
@ -2826,6 +2849,8 @@ begin
if CheckForLoadFromUnit(p) then exit;
// check for windres errors
if CheckForWindresErrors(p) then exit;
// check for linker errors
if CheckForAssemblerErrors(p) then exit;
{$IFDEF VerboseFPCParser}
debugln('TFPCParser.ReadLine UNKNOWN: ',Line);