xiver77
xiver77

Reputation: 2322

Is there a one byte "trap" instruction in x86?

I'm looking for a trap instruction that raises a hardware exception so that the program will stop abruptly and the debugger can show where this point is.

ud2 seems to do the job, but is there a one byte option?

Upvotes: 0

Views: 919

Answers (1)

fuz
fuz

Reputation: 93082

Use the int3 instruction with opcode cc. When debugging the program, this instruction causes a breakpoint. When not debugging the program, it usually causes some sort of trap.

Upvotes: 4

Related Questions