您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

116 行
5.9KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>The Ctrl-C Message (Debugging with GDB)</title>
  17. <meta name="description" content="The Ctrl-C Message (Debugging with GDB)">
  18. <meta name="keywords" content="The Ctrl-C Message (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension" rel="up" title="File-I/O Remote Protocol Extension">
  26. <link href="Console-I_002fO.html#Console-I_002fO" rel="next" title="Console I/O">
  27. <link href="The-F-Reply-Packet.html#The-F-Reply-Packet" rel="prev" title="The F Reply Packet">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style: oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="The-Ctrl_002dC-Message"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Console-I_002fO.html#Console-I_002fO" accesskey="n" rel="next">Console I/O</a>, Previous: <a href="The-F-Reply-Packet.html#The-F-Reply-Packet" accesskey="p" rel="prev">The F Reply Packet</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> &nbsp; [<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>
  61. </div>
  62. <hr>
  63. <a name="The-Ctrl_002dC-Message-1"></a>
  64. <h4 class="subsection">E.13.5 The &lsquo;<samp>Ctrl-C</samp>&rsquo; Message</h4>
  65. <a name="index-ctrl_002dc-message_002c-in-file_002di_002fo-protocol"></a>
  66. <p>If the &lsquo;<samp>Ctrl-C</samp>&rsquo; flag is set in the <small>GDB</small>
  67. reply packet (see <a href="The-F-Reply-Packet.html#The-F-Reply-Packet">The F Reply Packet</a>),
  68. the target should behave as if it had
  69. gotten a break message. The meaning for the target is &ldquo;system call
  70. interrupted by <code>SIGINT</code>&rdquo;. Consequentially, the target should actually stop
  71. (as with a break message) and return to <small>GDB</small> with a <code>T02</code>
  72. packet.
  73. </p>
  74. <p>It&rsquo;s important for the target to know in which
  75. state the system call was interrupted. There are two possible cases:
  76. </p>
  77. <ul>
  78. <li> The system call hasn&rsquo;t been performed on the host yet.
  79. </li><li> The system call on the host has been finished.
  80. </li></ul>
  81. <p>These two states can be distinguished by the target by the value of the
  82. returned <code>errno</code>. If it&rsquo;s the protocol representation of <code>EINTR</code>, the system
  83. call hasn&rsquo;t been performed. This is equivalent to the <code>EINTR</code> handling
  84. on POSIX systems. In any other case, the target may presume that the
  85. system call has been finished &mdash; successfully or not &mdash; and should behave
  86. as if the break message arrived right after the system call.
  87. </p>
  88. <p><small>GDB</small> must behave reliably. If the system call has not been called
  89. yet, <small>GDB</small> may send the <code>F</code> reply immediately, setting <code>EINTR</code> as
  90. <code>errno</code> in the packet. If the system call on the host has been finished
  91. before the user requests a break, the full action must be finished by
  92. <small>GDB</small>. This requires sending <code>M</code> or <code>X</code> packets as necessary.
  93. The <code>F</code> packet may only be sent when either nothing has happened
  94. or the full action has been completed.
  95. </p>
  96. <hr>
  97. <div class="header">
  98. <p>
  99. Next: <a href="Console-I_002fO.html#Console-I_002fO" accesskey="n" rel="next">Console I/O</a>, Previous: <a href="The-F-Reply-Packet.html#The-F-Reply-Packet" accesskey="p" rel="prev">The F Reply Packet</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> &nbsp; [<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>
  100. </div>
  101. </body>
  102. </html>