The Wikipedia page on the MOS 6502 mentions a hardware device called the Trap65 which apparently sat between the 6502 and its socket to trap any undocumented opcodes. The wiki page has the usual `citation needed` so I suppose it could be a lie.

Assuming such a device existed, how did that work? Does the 6502 have a split I/D memory? How else could the Trap65 detect if the byte being read was an instruction or something else?