Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Help Please - Improvements to Arduino Compiler Error Messages (Read 3110 times)
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Help Please - Improvements to Arduino Compiler Error Messages
Oct 23rd, 2012 at 12:33am
Print Post  
Can anyone help with avr-g++ compiler the errors? 

I don't really understand how to convert them cleanly, is there a structure to them that I can't see? Are there some switches that output a format that can be processed more easily.

We really need to be able to distinguish file names and paths, error text, warning/error, line number, column number and related messages.

I would love to improve the error display and also improve the existing drill down into source capability

Thanks!
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #1 - Oct 23rd, 2012 at 5:49am
Print Post  
Tim
I think you are at the point of discovering why the Atmel boys decided to make use of their own compiler in the Atmel Studio. The error messaging has been a an issue with IDE's for a long time. I was just not meant to be used this way although many do it. I looked at the error coding a long time ago and decided it was not worth the effort for me but you have other means to achieve proper reporting.
There are some documents that have the error codes but they do not follow a certain structure or pattern. The compiler has them hard coded and they are as the coders created them at the time. No real structure unfortunately.
Having said that, Eclipse does have a way to extract line number and source file info. Maybe you should have a look at how they achieve that.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #2 - Oct 23rd, 2012 at 4:19pm
Print Post  
Thanks for confirming the situation with this. I can make a better job of the messages but whenever I look at the code I see what a hack it is (some parts based on Arduino IDE source)

So it sounds like a good hack considering the state of things so I will hack some more  Smiley
« Last Edit: Oct 23rd, 2012 at 4:20pm by Tim@Visual Micro »  
Back to top
IP Logged
 
CapnBry
Junior Member
**
Offline


Posts: 32
Joined: Nov 4th, 2011
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #3 - Oct 23rd, 2012 at 8:12pm
Print Post  
I would agree that the only thing I don't love about VM is searching through the compiler messages (I always use verbose) to find the actual error. If that could be improved it would be awesome-o. You might want to look at vim's "errorformat" system. They parse gcc single and multiline error messages using some scanf-like pattern matching strings. 

Their secret is not trying to parse everything with a single expression, but rather using multiple expressions and using the first that returns a value for all variables in the expression.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #4 - Oct 24th, 2012 at 12:23am
Print Post  
Approx how often does the double click drill down from error to source get the correct line of code?
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #5 - Oct 24th, 2012 at 5:30am
Print Post  
I am used to finding the error myself so what is offered in VM at the moment works great. It does miss the error from time to time but I cant quantify at the moment. Maybe someone else has better feedback.
  
Back to top
IP Logged
 
CapnBry
Junior Member
**
Offline


Posts: 32
Joined: Nov 4th, 2011
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #6 - Oct 24th, 2012 at 2:52pm
Print Post  
Tim@Visual Micro wrote on Oct 24th, 2012 at 12:23am:
Approx how often does the double click drill down from error to source get the correct line of code?

I think I've had an error that didn't drill back to the code, but I can't remember what the syntax of the error message was. It works at least 99% of the time I think. I'll keep my eyes open.

The lines from the compiler output of the form "fcmenu.cpp : In function 'state_t menuCutInDifferential(button_t)'" end up becoming lines in the Error List that just say "Sketch (filepath)" on line -1 aren't helpful though. I suppose you're erring on the side of caution so a message with no line number won't be missed. I really look forward to seeing the Error List getting an overhaul, it is the only thing that makes me remember I'm not doing regular win32 C++ work-- digging through the output text looking for warnings/errors.

EDIT: Aha I found a click-to-source that didn't work like I expected.
Code
Select All
config.h : too many arguments to function 'void configReset()'
fcmenu.cpp : at this point in file
 


The error was in fcmenu.cpp, but the error message points to config.h. Clicking the fcmenu.cpp item jumps to the error. This is one of those pain in the butt error messages, where the error is reported in the header and the actual location is an addendum. Maybe the trend is that errors in source get normal messages, errors that reference #includes get multi-line errors?
« Last Edit: Oct 24th, 2012 at 8:01pm by CapnBry »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Help Please - Improvements to Arduino Compiler Error Messages
Reply #7 - Oct 24th, 2012 at 9:23pm
Print Post  
There is a new version on codeplex with some overdue fixes. I hope it installs okay, one of my next jobs is to dump the windows msi installer system. I hate it and it wastes so much time!!

As soon as the version is tested I'll look at improving these errors. 

I thought it might also make sense to show the gcc file name that is being compiled in messages that do not contain a file name reference. Hopefully this should mean that users don't need to turn on the verbose compile.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint