RISC-V: Don't allow unaligned breakpoints.
authorJim Wilson <jimw@sifive.com>
Fri, 2 Nov 2018 00:25:15 +0000 (17:25 -0700)
committerJim Wilson <jimw@sifive.com>
Fri, 2 Nov 2018 00:25:15 +0000 (17:25 -0700)
commit3ba2ee38a648b7f52e77700325b26137f6332fe2
treefb04918d8e7684a2fece7df6366ad238c7d0527b
parentc175004a5380168cf16b489d58c9402ff3d75039
RISC-V: Don't allow unaligned breakpoints.

Some hardware doesn't support unaligned accesses, and a bare metal target
may not have an unaligned access trap handler.  So if the PC is 2-byte
aligned, then use a 2-byte breakpoint to avoid unaligned accesses.

Tested on native RV64GC Linux with gdb testsuite and cross on spike
simulator and openocd with riscv-tests/debug.

gdb/
* riscv-tdep.c (riscv_breakpoint_kind_from_pc): New local unaligned_p.
Set if pcptr if unaligned.  Return 2 if unaligned_p true.  Update
debugging messages.
gdb/ChangeLog
gdb/riscv-tdep.c
This page took 0.037373 seconds and 4 git commands to generate.