ghidra icon indicating copy to clipboard operation
ghidra copied to clipboard

Improve sleigh error reporting

Open kkaempf opened this issue 2 years ago • 2 comments

This improves error reporting from the sleigh language parser.

  • making the calc_mask() size parameter unsigned prevents sleigh from just crashing with
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
Aborted (core dumped)
  • the other commit adds location information to sleigh error messages, improving the above error to
vax.slaspec:379 - ERROR Error: Pattern size cannot vary (missing '...'?): for table "instruction" constructor starting at line 373

No output produced

kkaempf avatar Sep 13 '22 18:09 kkaempf

Thanks for submitting this, I'll take a look.

One thing to note is that there is also a java sleigh compiler ghidra.pcodeCPort.slgh_compile.SleighCompile which should also have the new error messages.

If java's not your thing I can add them myself.

ghidracadabra avatar Oct 21 '22 15:10 ghidracadabra

Oh, two sleigh compiler implementations 🙈 Time to drop one ? 🤔 I'll see what I can do but I'm not a Java programmer.

kkaempf avatar Nov 02 '22 15:11 kkaempf