This patch adds an interface GetLastInstrSize to get information about the size of last tried to be decoded instruction and uses it to set software breakpoint if the memory can be decoded as instruction. RISC-V architecture instruction format specifies the length of instruction in first bits, so we can set a breakpoint for these cases. This is needed as RISCV have a lot of extensions, that are not supported by `EmulateInstructionRISCV`.
8 lines
229 B
C
8 lines
229 B
C
int main() {
|
|
// This instruction is not valid, but we have an ability to set
|
|
// software breakpoint.
|
|
// This results in illegal instruction during execution, not fail to set
|
|
// breakpoint
|
|
asm volatile(".2byte 0xaf");
|
|
}
|