[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
D.9.2 Protocol Basics
The File-I/O protocol uses the F
packet as the request as well
as reply packet. Since a File-I/O system call can only occur when
No value for GDBN is waiting for a response from the continuing or stepping target,
the File-I/O request is a reply that No value for GDBN has to expect as a result
of a previous ‘C’, ‘c’, ‘S’ or ‘s’ packet.
This F
packet contains all information needed to allow No value for GDBN
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 flags are given in a protocol-specific representation.
At this point, No value for GDBN has to perform the following actions.
-
If the parameters include pointer values to data needed as input to a
system call, No value for GDBN 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 otherm
packet. - No value for GDBN translates all value from protocol representation to host representation as needed. Datatypes are coerced into the host types.
- No value for GDBN calls the system call.
- It then coerces datatypes back to protocol representation.
-
If the system call is expected to return data in buffer space specified
by pointer parameters to the call, the data is transmitted to the
target using a
M
orX
packet. This packet has to be expected by the target implementation and is handled as any otherM
orX
packet.
Eventually No value for GDBN 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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |