Appendix D. gdb Remote Serial Protocol
335
b
-
T001:1234123412341234
-
c
+
Example sequence of a target being stepped by a single instruction:
-
c
G1445...
b
-
+
-
c
s
b
-
+
time passes
b
-
T001:1234123412341234
-
c
+
-
c
g
b
-
+
b
-
1455...
-
c
+
D.7. File-I/O remote protocol extension
D.7.1. File-I/O Overview
The File I/O remote protocol extension (short: File-I/O) allows the target to use the hosts file system
and console I/O when calling various system calls. System calls on the target system are translated
into a remote protocol packet to the host system which then performs the needed actions and returns
with an adequate response packet to the target system. This simulates file system operations even on
targets that lack file systems.
The protocol is defined host- and target-system independent. It uses it’s own independent represen-
tation of datatypes and values. Both, gdb and the target’s gdb stub are responsible for translating the
system dependent values into the unified protocol values when data is transmitted.
The communication is synchronous. A system call is possible only when GDB is waiting for the
C
,
c
,
S
or
s
packets. While gdb handles the request for a system call, the target is stopped to allow
deterministic access to the target’s memory. Therefore File-I/O is not interuptible by target signals. It
is possible to interrupt File-I/O by a user interrupt (Ctrl-C), though.
The target’s request to perform a host system call does not finish the latest
C
,
c
,
S
or
s
action. That
means, after finishing the system call, the target returns to continuing the previous activity (continue,
step). No additional continue or step request from gdb is required.
(gdb) continue
b
- target requests ’system call X’
target is stopped, gdb executes system call
-
c
GDB returns result
... target continues, GDB returns to wait for the target
b
- target hits breakpoint and sends a Txx packet
The protocol is only used for files on the host file system and for I/O on the console. Character or
block special devices, pipes, named pipes or sockets or any other communication method on the host
system are not supported by this protocol.
Summary of Contents for ENTERPRISE LINUX 3 - SECURITY GUIDE
Page 1: ...Red Hat Enterprise Linux 3 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......