|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
-
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3 or
- any later version published by the Free Software Foundation; with the
- Invariant Sections being "Free Software" and "Free Software Needs
- Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
- and with the Back-Cover Texts as in (a) below.
-
- (a) The FSF's Back-Cover Text is: "You are free to copy and modify
- this GNU Manual. Buying copies from GNU Press supports the FSF in
- developing GNU and promoting software freedom." -->
- <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>File-I/O Overview (Debugging with GDB)</title>
-
- <meta name="description" content="File-I/O Overview (Debugging with GDB)">
- <meta name="keywords" content="File-I/O Overview (Debugging with GDB)">
- <meta name="resource-type" content="document">
- <meta name="distribution" content="global">
- <meta name="Generator" content="makeinfo">
- <link href="index.html#Top" rel="start" title="Top">
- <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
- <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
- <link href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension" rel="up" title="File-I/O Remote Protocol Extension">
- <link href="Protocol-Basics.html#Protocol-Basics" rel="next" title="Protocol Basics">
- <link href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension" rel="prev" title="File-I/O Remote Protocol Extension">
- <style type="text/css">
- <!--
- a.summary-letter {text-decoration: none}
- blockquote.indentedblock {margin-right: 0em}
- blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
- blockquote.smallquotation {font-size: smaller}
- div.display {margin-left: 3.2em}
- div.example {margin-left: 3.2em}
- div.lisp {margin-left: 3.2em}
- div.smalldisplay {margin-left: 3.2em}
- div.smallexample {margin-left: 3.2em}
- div.smalllisp {margin-left: 3.2em}
- kbd {font-style: oblique}
- pre.display {font-family: inherit}
- pre.format {font-family: inherit}
- pre.menu-comment {font-family: serif}
- pre.menu-preformatted {font-family: serif}
- pre.smalldisplay {font-family: inherit; font-size: smaller}
- pre.smallexample {font-size: smaller}
- pre.smallformat {font-family: inherit; font-size: smaller}
- pre.smalllisp {font-size: smaller}
- span.nolinebreak {white-space: nowrap}
- span.roman {font-family: initial; font-weight: normal}
- span.sansserif {font-family: sans-serif; font-weight: normal}
- ul.no-bullet {list-style: none}
- -->
- </style>
-
-
- </head>
-
- <body lang="en">
- <a name="File_002dI_002fO-Overview"></a>
- <div class="header">
- <p>
- Next: <a href="Protocol-Basics.html#Protocol-Basics" accesskey="n" rel="next">Protocol Basics</a>, Up: <a href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension" accesskey="u" rel="up">File-I/O Remote Protocol Extension</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <hr>
- <a name="File_002dI_002fO-Overview-1"></a>
- <h4 class="subsection">E.13.1 File-I/O Overview</h4>
- <a name="index-file_002di_002fo-overview"></a>
-
- <p>The <em>File I/O remote protocol extension</em> (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.
- </p>
- <p>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
- <small>GDB</small> and the target’s <small>GDB</small> stub are responsible for
- translating the system-dependent value representations into the internal
- protocol representations when data is transmitted.
- </p>
- <p>The communication is synchronous. A system call is possible only when
- <small>GDB</small> is waiting for a response from the ‘<samp>C</samp>’, ‘<samp>c</samp>’, ‘<samp>S</samp>’
- or ‘<samp>s</samp>’ packets. While <small>GDB</small> 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
- (‘<samp>Ctrl-C</samp>’) within <small>GDB</small>.
- </p>
- <p>The target’s request to perform a host system call does not finish
- the latest ‘<samp>C</samp>’, ‘<samp>c</samp>’, ‘<samp>S</samp>’ or ‘<samp>s</samp>’ 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 <small>GDB</small> is required.
- </p>
- <div class="smallexample">
- <pre class="smallexample">(gdb) continue
- <- target requests 'system call X'
- target is stopped, GDB executes system call
- -> GDB returns result
- ... target continues, GDB returns to wait for the target
- <- target hits breakpoint and sends a Txx packet
- </pre></div>
-
- <p>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.
- </p>
- <p>File I/O is not supported in non-stop mode.
- </p>
- <hr>
- <div class="header">
- <p>
- Next: <a href="Protocol-Basics.html#Protocol-Basics" accesskey="n" rel="next">Protocol Basics</a>, Up: <a href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension" accesskey="u" rel="up">File-I/O Remote Protocol Extension</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
- </div>
-
-
-
- </body>
- </html>
|