Define and use ud2 instruction instead of int3
For x86 it would be useful to define the UD2
(undefined) instruction instead of int3 for handling errors in lisp. (This is used for signaling invalid number of args or invalid arg types, among other things.)
This is closer to how the other ports handle this (sparc uses
ILLTRAP
). The ud2 instruction has a mod r/m byte, that we can use
to store the trap code, just like how ILLTRAP
works on sparc.
Since breakpoints are not part of the lisp code and only inserted when breakpoints are defined, we can use int3 (without the code) to handle breakpoints. This simplifies things quite a bit since we only replace a single byte now.
This also makes working with gdb easier because we're not using int3 except for breakpoints.
Edited by Raymond Toy