gdb/riscv: Write 4-byte nop to dummy code region before inferior calls
When making inferior function calls GDB sets up a dummy code region on
the stack, and places a breakpoint within that region. If the random
stack contents appear to be a compressed instruction then GDB will
place a compressed breakpoint, which can cause problems if the target
doesn't support compressed instructions.
This commit prevents this issue by writing a 4-byte nop instruction to
the dummy region at the time the region is allocated. With this nop
instruction in place, when we come to insert the breakpoint then an
uncompressed breakpoint will be used.
This is similar to other targets, for example mips.
gdb/ChangeLog:
* riscv-tdep.c (riscv_push_dummy_code): Write a 4-byte nop
instruction to the dummy code region.
gdb/testsuite/ChangeLog:
* gdb.arch/riscv-bp-infcall.c: New file.
* gdb.arch/riscv-bp-infcall.exp: New file.