manpagez: man pages & more
info gdb
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

D.9.1 File-I/O Overview

The File I/O remote protocol extension (short: File-I/O) allows the target to use the host's file system and console I/O to perform 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 a response packet to the target system. This simulates file system operations even on targets that lack file systems.

The protocol is defined to be independent of both the host and target systems. It uses its own internal representation of datatypes and values. Both No value for GDBN and the target's No value for GDBN stub are responsible for translating the system-dependent value representations into the internal protocol representations when data is transmitted.

The communication is synchronous. A system call is possible only when No value for GDBN is waiting for a response from the ‘C’, ‘c’, ‘S’ or ‘s’ packets. While No value for GDBN 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 interruptible by target signals. On the other hand, it is possible to interrupt File-I/O by a user interrupt (‘Ctrl-C’) within No value for GDBN.

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 No value for GDBN is required.

(No value for GDBP) continue
  <- target requests 'system call X'
  target is stopped, No value for GDBN executes system call
  -> No value for GDBN returns result
  ... target continues, No value for GDBN returns to wait for the target
  <- target hits breakpoint and sends a Txx packet

The protocol only supports I/O on the console and to regular files on the host file system. Character or block special devices, pipes, named pipes, sockets or any other communication method on the host system are not supported by this protocol.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© 2000-2017
Individual documents may contain additional copyright information.