Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1435

Report column numbers and source text in error messages

Added by Todd Strader 2 months ago. Updated 7 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Lint
% Done:

0%


Description

Re: Wilson's suggestion in issue #1305, we should report column numbers and source text in error messages like gcc does:

%Error: project/fc/fx.v:1234:23: Illegal bit or array select; type does not have a bit range, or bad dimension: type is real
   source_error_line = realvar[bad_select];
                              ^~~~
%Error:                        : In instance top.fc.roc.foowrap.foo.ctl.csr.shim

History

#1 Updated by Wilson Snyder 2 months ago

  • Category set to Lint
  • Status changed from New to Feature

Are you interested in making the column/source printing change? Here's some notes.

I'd think two separate patch sets, one for source printing and one for columns, probably source printing first unless only one interests you.

For source printing FileLineSingleton tracks language and filename for each file letter, probably refactor that into each letter tracking a class and have the filename/language/lines as an array in that class. Then add appropriate accessors. We'd save the results out of the preprocessed code.

Might need some cleanup needed in the preprocessor and elsewhere to preserve columns where it can (i.e. amount of whitespace).

For columns this describes getting columns out of flex: https://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly

we'd then spit the lex'ed columns into the FileLine and rest is easyish.

#2 Updated by Todd Strader 2 months ago

Sure, sign me up. However, I've got a lot of irons in the Verilator fire right now so this may take a while to get to. Also, I suspect this is related to issue #1439. So I'd like to make sure whatever I'm doing will service both issues.

#3 Updated by Wilson Snyder 7 days ago

Fixed in git towards 4.017. Also added suggestions, which are arguably even more useful.

 %Error: t/t_var_suggest_bad.v:12: Can't find definition of variable: 'foobat'
                                 : ... Suggested alternative: 'foobar'
      if (foobat) $stop;
          ^~~~~~

#4 Updated by Wilson Snyder 7 days ago

  • Status changed from Feature to Resolved

Also available in: Atom