336
Appendix D. gdb Remote Serial Protocol
D.7.2. Protocol basics
The File-I/O protocol uses the
F
packet, as request as well as as reply packet. Since a File-I/O system
call can only occur when gdb is waiting for the continuing or stepping target, the File-I/O request is
a reply that gdb has to expect as a result of a former
C
,
c
,
S
or
s
packet. This
F
packet contains all
information needed to allow gdb to call the appropriate host system call:
•
A unique identifier for the requested system call.
•
All parameters to the system call. Pointers are given as addresses in the target memory address
space. Pointers to strings are given as pointer/length pair. Numerical values are given as they are.
Numerical control values are given in a protocol specific representation.
At that point gdb has to perform the following actions.
•
If parameter pointer values are given, which point to data needed as input to a system call, gdb
requests this data from the target with a standard
m
packet request. This additional communication
has to be expected by the target implementation and is handled as any other
m
packet.
•
gdb translates all value from protocol representation to host representation as needed. Datatypes are
coerced into the host types.
•
gdb calls the system call
•
It then coerces datatypes back to protocol representation.
•
If pointer parameters in the request packet point to buffer space in which a system call is expected
to copy data to, the data is transmitted to the target using a
M
or
X
packet. This packet has to be
expected by the target implementation and is handled as any other
M
or
X
packet.
Eventually gdb replies with another
F
packet which contains all necessary information for the target
to continue. This at least contains
•
Return value.
•
errno
, if has been changed by the system call.
•
"Ctrl-C" flag.
After having done the needed type and value coercion, the target continues the latest continue or step
action.
D.7.3. The
F
request packet
The
F
request packet has the following format:
Fcall-id,parameter...
call-id
is the identifier to indicate the host system call to be called. This is just the name of the
function.
parameter...
are the parameters to the system call.
Parameters are hexadecimal integer values, either the real values in caseof scalar datatypes, as pointers
to target buffer space in case of compounddatatypes and unspecified memory areas or as pointer/length
pairs in caseof string parameters. These are appended to the call-id, each separatedfrom its predecessor
by a comma. All values are transmitted in ASCIIstring representation, pointer/length pairs separated
by a slash.
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......