OS_Write0 returns a pointer
[riscose.git] / DEBUGGING.md
blob2053bb3a09c3f9531a3fb0fc23b562a6749acdbe
1 # Debugging
3 riscose provides a remote gdb interface for debugging code running on the
4 emulated ARM. It supports;
6  * Hardware breakpoints
7  * Simple watchpoints
8  * Read and writing memory
9  * Faking a CPSR so 26 bit ARM code can be debugged without debugger support.
11 It announces itself as much as the protocol allows, although your debugger is
12 probably expecting an ELF executable, not raw 26 bit ARM code that ignores
13 APCS.
15 To run the debugger, supply `-g`, and it will listen for a connection on port
16 53415.
18 ## gdb
20 riscose not appear to work with the gdb distributed by Ubuntu 22.04, but does work
21 with current git master branch. (Version 12.1 attempts to use software
22 breakpoints for single stepping, which are not implemented.)
24 To connect type the command, `target remote tcp:127.0.0.1:53415`. Breakpoints
25 default to software breakpoints, you need to explicitly use hardware
26 breakpoints. eg., `hb *0x8000`.
28 ## lldb
30 lldb can connect to riscose, but is slow due to unimplemented commands. To
31 connect use `gdb-remote 127.0.0.1:53415`. lldb ignores software breakpoints
32 being disavowed so you to type
33 `settings set target.require-hardware-breakpoint true` before using
34 breakpoints.
36 # Future support
38  * Breakpointing SWIs.
39  * Presenting ELF executables to gdb as such.
40  * Translating ASD debug tables into something gdb can follow.