I am using lldb (version: 12.0.0) and openOCD (version: 0.11.0-rc2) for remote debugging but I struggle in setting breakpoints. When I connect and set a breakpoint by:
target create example target modules load --file example -s 0x80000000 gdb-remote localhost:3333 breakpoint set -f example -l34
I receive a warning from lldb and still no breakpoint has been set:
warning: failed to set breakpoint site at 0x800001ea for breakpoint 1.1: error: 14 sending the breakpoint request Breakpoint 1: where = example`foo() + 50 at example.foo.cpp:34:32, address = 0x800001ea
OpenOCD is receiving a packet ‘Z0,800001ea,0’ which seems to be the problem because openOCD needs to know if it is a 4 Byte or a 2 Byte (normal or compressed) instruction to set a breakpoint the right way:
Debug: 465 2741 gdb_server.c:3272 gdb_input_inner(): received packet: 'Z0,800001ea,0' Debug: 466 2741 gdb_server.c:1662 gdb_breakpoint_watchpoint_packet(): [riscv.cpu] Debug: 467 2741 riscv.c:696 riscv_add_breakpoint():  @0x800001ea Error: 468 2741 riscv.c:701 riscv_add_breakpoint(): Invalid breakpoint length 0 Error: 469 2741 breakpoints.c:94 breakpoint_add_internal(): can't add breakpoint: unknown reason Debug: 470 2741 gdb_server.c:1422 gdb_error(): Reporting -4 to GDB as generic error
Is there a way to tell lldb which instructions (compressed or normal) the remote target uses or is there a other way to set the length of breakpoints?
Thanks in advance for your help!