RISC-V EBREAK Instruction Details
Instruction ManualI-typeTransfer control back to the debugging environment; generates a breakpoint exception
Instruction Syntax
Instruction Encoding
EBREAK uses opcode 1110011 (0x73), funct3 000, funct12 000000000001. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.
Instruction Behavior
EBREAK (I-type encoding with imm=1, rs1=x0, funct3=000, rd=x0, opcode=SYSTEM=1110011) generates a breakpoint exception, returning control to the debugger. Primary uses: debugger breakpoints, marking unreachable code paths (GCC __builtin_unreachable), and semihosting (service calls via EBREAK sequence). Previously named SBREAK.
Common Usage Scenarios
Understand this scenario with real code like «ebreak # transfer control to debugger».
Understand this scenario with real code like «ebreak # transfer control to debugger».
Pre-Use Checklist
- Confirm the current instruction format is I-type.
- Confirm the operand order matches the example.
- Ensure the destination register usage is compatible with the calling convention.
- Confirm this is not the lower-level form of a pseudo-instruction expansion.