Open hackaugusto opened 3 months ago
I think this would be better solved by having proper source-level debug information associated with a program, which I think should be a pretty high priority in general because of how critical it is to user experience (and for us, in terms of efficient troubleshooting/debugging). To implement this as requested, we'd need to implement the same kind of auxiliary structure as would be needed for debug info anyway, so I see it as essentially the same amount of effort involved.
Source-level debug info also works equally well for code generated by the compiler. The vast majority of our users are more than likely going to be working in a higher-level language, not MASM, so we want to be able to emit errors/diagnostics that speak in terms the user understands. By using source spans, we can show the snippet of code associated with a particular error in whatever language it was actually written (assuming a program was distributed with debug info), whereas an error specific to MASM/MAST is not going to be particularly helpful.
I've been wanting to write up a proposal for debug info, but haven't been able to get to it, but this is a reminder to do that sooner rather than later I think.
We are using
assert.err=<code>
to give context for a given error.<code>
may be a integer or a constant, a failing assert likeassert.err=ERR_INVALID_NOTE_TYPE
will then result in an error similar to:There are a few issues with the above:
131140
in the code base will give no results0x20044
may not give a hit, for the example above the value was defined as0x00020044
The above makes it unnecessarily convoluted to find the corresponding error. A simple fix for this is to add the string
<code>
in the error message. So the error above would be:If defined with a hex directly, i.e.
assert.err=0x00020044
:And if defined with a number, i.e.
assert.err=131140
: