flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Feature Request: Error message format

Author
Thread Post new topic Reply to topic
mike768



Joined: 29 Dec 2006
Posts: 2
mike768 29 Dec 2006, 02:42
It would be GREAT for those MSVC users to have FASM output error messages in the format recognized by Visual Studio:

See this post at the MSBuild Tem Blog for more information.

Now I realize FASM is designed to not need command-line options, although as this affects the STDOUT output rather than the binary output I think it doesn't violate the fasm philosopy.

[edit]
I hacked the source myself to produce the proper error message, but it is an all-or-nothing fix: either it uses MSVC-style output or it doesn't.

Also useful would be a -q option which would print only the error messages - ie. no FASM banner. Similar to the Microsoft /nologo option. I am trying to script a long build and want to get just the error messages in the output. Or else output errors to STDERR and the startup banner to STDOUT.
[/edit]

(I tried searching the fora beforehand, but didn't get any results. My apologies if this is an old question.)

Mike
Post 29 Dec 2006, 02:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7103
Location: Slovakia
vid 31 Dec 2006, 08:55
i find the commandline option for some standardized error output to be good idea. there was same problem with FASM usage in VIM for example, and hacking the source was needed too.
Post 31 Dec 2006, 08:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 01 Jan 2007, 19:06
Sounds like a god idea, I like the idea, but, I think this option might be a bit even better:
2 flags: -q and -v (I'll get to "the" problem later)
-q (Quiet) - supresses the banner as above
-v (Verbose) - prints errors in the present more detailed way
"the" problem would be that -q and -v could be used at the same time, basically 'breaking' the semantics, quiet and verbose usually are mutually exclusive. (the solution could be to rename -q to -n (No-logo), but it feels like looking up '-n' for the wrong option).
here's some examples of how it could look:
Code:
;# present:
$ fasm /tmp/illegal.asm
flat assembler  version 1.67.15  (16384 kilobytes memory)
/tmp/illegal.asm [1]:
mup_ins
error: illegal instruction.
;# proposed:
$ fasm /tmp/illegal.asm
flat assembler  version 1.67.15  (16384 kilobytes memory)
/tmp/illegal.asm(1): error #UD: illegal instruction.
$ fasm -q /tmp/illegal.asm
/tmp/illegal.asm(1): error #UD: illegal instruction.
$ fasm -v /tmp/illegal.asm
flat assembler  version 1.67.15  (16384 kilobytes memory)
/tmp/illegal.asm [1]:
mup_ins
error: illegal instruction.
$ fasm -q -v /tmp/illegal.asm
/tmp/illegal.asm [1]:
mup_ins
error: illegal instruction.    
Post 01 Jan 2007, 19:06
View user's profile Send private message Visit poster's website Reply with quote
mike768



Joined: 29 Dec 2006
Posts: 2
mike768 02 Jan 2007, 20:39
There's even an option to have VS print out multiple lines - so the VS format could maintain all the 'verbosity' of the original output.

Although now that I think about it, that would just be redundant. The fact that one is using the VS-format output probably indicates it is being run from VS, in which case a simple double-click or F8 will bring you right to the line of code.

The way I added the error numbers (without which VS fails to recognize it) was in the error include file (whatever it was - I don't have the source on this computer so I can't make any intelligent details...) like so:

Code:
error_jump_target:
    call assembler_error
    dw 1001
    db "error description", 0
    


I probably butchered that excample but it gets the point across.

Furthermore, I think FASM should not use the VS format by default - to avoid breaking any scripts that parse the output - if any should exist. I would suggest -m for Microsoft (but that's taken) or -v for Visual Studio, but -v is by convention verbose.

Mike
Post 02 Jan 2007, 20:39
View user's profile Send private message Reply with quote
tantrikwizard



Joined: 13 Dec 2006
Posts: 142
tantrikwizard 02 Jan 2007, 23:49
Though I'm not a FASM developer, it would seem to be a large undertaking to accomidate the multitude of IDEs out there. One could easily do this in a batch file or script if you're using windows (or linux for that matter):
Code:
build.bat:
@echo off
fasm myfile.asm >> asmerrfile.txt
cscript parseouterror.cs
parseouterrors.cs:
ofs = CreateObject("FileSystemObject")
ofile = ofs.OpenFile("asmerrfile.txt")
...skip the fasm header...
while not oFile.EOF
    ...parse the error line for what VS is looking for...
    console.print(strStudioRecognizedErrorFormat)
loop
    

This code will (obviously) need to be modified, but is much easier than modifying the FASM source.
I use UltraEdit studio which has built in fasm support, it works great, no need to modify FASM.
Post 02 Jan 2007, 23:49
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
dazzit



Joined: 07 Jan 2007
Posts: 9
Location: Devon, UK
dazzit 08 Jan 2007, 10:29
I think the whole point of FASM is that it is a quick and easy all in one solution. I find the concept of an external helper program to process error messages personally a messy solution.
I've found error messages a problem when using FASM with CodeBlocks and TinyCC which has quite configurable and powerful regular expression matching to parse error lines. Unfortunately on only one line I can either get the line or the error. Not both. I modified TCC to stop it padding out the start of pure binary builds so as I could build a boot loader but kind of baulked at modifying CodeBlocks.
Post 08 Jan 2007, 10:29
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.