mipsy icon indicating copy to clipboard operation
mipsy copied to clipboard

Errors when multiple files loaded should print the file name not just the line number.

Open Dylan-Brotherston opened this issue 3 years ago • 3 comments

error: your program tried to read uninitialised memory
the instruction that failed was:
0x00400150 34  [0x03e00008]    jr     $ra               #  jr  $ra

this happened because $ra was uninitialised.
>
| the instruction that caused $ra to become uninitialised was:
| 0x00400144 30  [0x8fbf0000]    lw     $ra, ($sp)        #  lw  $ra, ($sp)
| where:
|  $sp = 0x7ffffef8

Dylan-Brotherston avatar Nov 22 '21 09:11 Dylan-Brotherston

hmmm... compiler errors should currently handle these well, but definitely not runtime errors. any thoughts on introducing this without adding too much bloat to the diagnostics output?

insou22 avatar Nov 22 '21 12:11 insou22

It definitely can't be inline as

0x00400150 file.s 34 [0x03e00008] jr $ra

Could get ludicrously long.


Possibly change the first line from

error: your program tried to read uninitialised memory

To

error:
in file.s:
your program tried to read uninitialised memory

Dylan-Brotherston avatar Nov 22 '21 12:11 Dylan-Brotherston

And if this was caused by an instruction in another file

>
 | in file.s:
 | the instruction that caused $ra to become uninitialised was:
 | 0x00400144 30 [0x8fbf0000] lw $ra, ($sp) # lw $ra, ($sp) 
 | where:
 | $sp = 0x7ffffef8

But only of it's a different file to the one previously listed.

Dylan-Brotherston avatar Nov 22 '21 12:11 Dylan-Brotherston