You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 02b9c28
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: doc/gdb.md
+53-19Lines changed: 53 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,32 +35,66 @@ Supported Commands
35
35
36
36
- read registers
37
37
38
-
Reading registers is currently implemented through the <g> packet of the gdb protocol.
39
-
It returns the whole register profile at once.
38
+
Reading registers is currently implemented through the `g` packet of the gdb protocol.
39
+
It returns the whole register profile at once.
40
40
41
41
- write registers
42
42
43
-
There are two ways of writing registers. The first one is through the P packet.
43
+
There are two ways of writing registers. The first one is through the `P` packet.
44
44
It works like this: `P<register_index>=<register_value>`
45
-
The second one is the G packet, that writes the whole register Profile at once.
46
-
The implementation first tries to use the newer P packet and if it receives a $00# packet (that says not implemented), it tries to write through the G packet.
45
+
The second one is the `G` packet, that writes the whole register profile at once.
46
+
The implementation first tries to use the newer `P` packet and if it receives a `$00#`
47
+
packet (not implemented), it falls back to the `G` packet.
47
48
48
-
-- stepping (but this is still the softstep mode and for an unknown reason it still does not call the gdb_write_register function)
49
+
- stepping
49
50
50
-
Supported Packets:
51
+
Single-stepping is implemented through the `vCont;s` packet when vCont is supported,
52
+
falling back to the `s` packet otherwise.
51
53
52
-
-`g` : Reads the whole register Profile at once
53
-
-`G` : Writes the whole register Profile at once
54
-
-`m` : Reads memory
55
-
-`M` : Writes memory
56
-
-`vCont,v` : continues execution of the binary
57
-
-`P` : Write one register
54
+
- breakpoints
58
55
59
-
TODO
60
-
----
56
+
Software breakpoints are set and removed using the `Z0`/`z0` packets.
57
+
Hardware breakpoints use `Z1`/`z1`. Watchpoints (read, write, access) use
58
+
`Z2`/`z2`, `Z3`/`z3`, and `Z4`/`z4` respectively.
61
59
62
-
- Implement GDBserver to allow other apps use rizin debugger
63
-
- Fix that uses the gdb internal stepping version
64
-
- Fix softstep, that it finally recoils correct (it just have to reset the eip/rip)
65
-
- Add Breakpoints (should be an easy add of the function, because its already implemented in the gdb lib)
60
+
- attach/detach
66
61
62
+
Attaching to a running process uses the `vAttach` packet. Detaching uses the `D` packet.
63
+
Multiprocess detach uses `D;<pid>`.
64
+
65
+
- file access
66
+
67
+
Remote file operations (open, read, close) are supported through the `vFile` packet,
68
+
allowing rizin to read files (e.g. `/proc/<pid>/maps`) directly from the remote target.
69
+
70
+
- thread and process listing
71
+
72
+
Thread and process enumeration is supported via XML target descriptions and the
73
+
`qXfer:threads:read` packet.
74
+
75
+
Supported Packets
76
+
-----------------
77
+
78
+
-`?` : Query stop reason
79
+
-`g` : Read all registers at once
80
+
-`G` : Write all registers at once
81
+
-`p` : Read a single register
82
+
-`P` : Write a single register
83
+
-`m` : Read memory
84
+
-`M` : Write memory
85
+
-`s` : Single step
86
+
-`c` : Continue execution
87
+
-`vCont` : Continue or step with optional signal, per-thread control
88
+
-`vAttach` : Attach to a process by PID
89
+
-`D` : Detach from target
90
+
-`k` : Kill the remote process
91
+
-`Z0`/`z0` : Set/remove software breakpoint
92
+
-`Z1`/`z1` : Set/remove hardware breakpoint
93
+
-`Z2`/`z2` : Set/remove write watchpoint
94
+
-`Z3`/`z3` : Set/remove read watchpoint
95
+
-`Z4`/`z4` : Set/remove access watchpoint
96
+
-`qSupported` : Query supported features
97
+
-`qRcmd` : Send a command to the remote target's interpreter
0 commit comments