Author Topic: Error parser for JWasm?  (Read 6289 times)

Offline Binarus

  • Single posting newcomer
  • *
  • Posts: 3
Error parser for JWasm?
« on: March 07, 2013, 02:21:16 pm »
Hi all,

at first, I wanted to say "thank you" to all developers of Code::Blocks.

I was using CB with the OpenWatcom toolchain, which was working like a charm. Even the errors from the assembler (wasm) were visible in the "Build messages" windows, and clicking on a line in that window made CB show the respective source code line in the respective assembler source file.

For certain reasons, I now have to use JWasm instead of Wasm. Unfortunately, I am seeing JWasm's messages only in the "Build log" (and not the "Build messages") window, and clicking on a message doesn't make CB show the source code line or jump to the assembler source file.

Hence my question: What could I do about that? I am working a lot with assembler sources ... I think what I'd like to have is called an error parser (please correct me if I am wrong).

Thank you very much,

Binarus
« Last Edit: March 07, 2013, 06:14:37 pm by Binarus »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: Error parser for JWasm?
« Reply #1 on: March 07, 2013, 06:28:04 pm »
IIRC, The error message parser is under advanced compiler options  under Global Compiler settings.

Quote
Under menu "Settings" -> "Compiler" -> Global compiler settings -> [the compiler you use] -> "Other Setting" tab

"Advanced Options" on tab "Other Settings"
Then look at "Output Parsing" tab

Tim S.
« Last Edit: March 07, 2013, 06:32:08 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Binarus

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error parser for JWasm?
« Reply #2 on: March 08, 2013, 01:17:42 pm »
IIRC, The error message parser is under advanced compiler options  under Global Compiler settings.

Quote
Under menu "Settings" -> "Compiler" -> Global compiler settings -> [the compiler you use] -> "Other Setting" tab

"Advanced Options" on tab "Other Settings"
Then look at "Output Parsing" tab

Tim S.

Tim, thank you VERY much!

After having found the right place thanks to your hint I was able to add three new entries based on the original ones, but with slightly changed regular expressions. Now the output of JWasm is handled as desired with full comfort.

The whole thing took me about 10 minutes. Great!

Regards,

Binarus
« Last Edit: March 08, 2013, 01:23:17 pm by Binarus »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Error parser for JWasm?
« Reply #3 on: March 08, 2013, 01:23:35 pm »
Do the new regexes conflict with the old ones or can both work "side by side" ?

Can you share the new regexes, so they can probably make it into our sources ?

Offline Binarus

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error parser for JWasm?
« Reply #4 on: March 08, 2013, 01:49:46 pm »
Do the new regexes conflict with the old ones or can both work "side by side" ?

Can you share the new regexes, so they can probably make it into our sources ?

They can live side by side, but this was just a quick and dirty "hack" for me. I think it might be better to merge the expressions. Let's look into an example for an error message (as output at the command line!):
Wasm: dio.asm(251): Error! E516: Invalid qualified type
JWasm: dio.asm(678) : Error A2071: Invalid operand size for instruction

So, basically, JWasm seems to add an additional space char before the colon, and it does not use the exclamation mark. I made three new entries with regexes which have been changed accordingly, i.e. your original / Wasm was
([][{}() \t#%$~[:alnum:]&_:+/\.-]+)\(([0-9]+)\): Error! (.+)

and it became (JWasm)
([][{}() \t#%$~[:alnum:]&_:+/\.-]+)\(([0-9]+)\) : Error (.+)

A few remarks, though:

1) I think it would be more elegant to merge the expressions.

- You could make the exclamation mark optional:
Error!?
instead of
Error!

- You could allow (an arbitrary number of) spaces before the colon:
)\ *:
instead of
):

2) Please note that this has to be tested. I am not absolutely sure how many spaces JWasm inserts before the colon and if it does insert spaces in absolutely every case. It *seems* to be sure that it doesn't use the exclamation mark, but please don't kill me if I am wrong here.

3) Until now, I had only the chance to test error messages, not warning messages or notes. I would be willing to try to make JWasm throw warnings (my code doesn't produce any yet), but I doubt that it's possible to get notes from JWasm (at least, I did not run into one yet).

But if you could merge the regexes as shown above, I think 2) and 3) should be solved by design.

Please let me know what you are thinking about it and if you need further assistance. I am glad to be able to give a little bit help for such a great project.

Regards,

Binarus


« Last Edit: March 08, 2013, 04:56:45 pm by Binarus »