tl;dr, a macro like this:
when invoked from the same file it is defined, it will report the error line and filename correctly. But when called from a different file, it reports the macro's line correctly but displays the current filename. D'oh!
This required quite a big of jiggling to get working. I thought it'd be really easy but the way macros are defined (i.e. SYM) made it not that trivial. Also sadly I had to add yet another member to SYM type, but it is what it is - I couldn't find an easier way to do it.
I'd be gladly proven wrong though :)
Created attachment 148 [details]
So actually this is a continuation of bug #50 - tomb raidering!
So after speaking to a couple of people about this, we agreed that what should happen when a macro errors out is to report the erroneous line of the macro, as well as the caller site. This can help tremendously if one is trying to suss out errors from invalid macro invocation. Plus, you can never have too much helping info, right? :)
I'm really not very confident in submitting a new patch because my dev folder is a bit messy, but if the above patch is applied and the sprintf replaced with the following, we should be fine.
sprintf(buf1, "%s %d: Error: %s\nCalled from: %s %d\n", filename, cur_inobj->inobj.imacro->im_macro->lineList->lineno, buf,
This really isn't all that bad, considering. :-) Thanks for the patch!