You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Cygwin-Native.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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>Cygwin Native (Debugging with GDB)</title>
  17. <meta name="description" content="Cygwin Native (Debugging with GDB)">
  18. <meta name="keywords" content="Cygwin Native (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="Native.html#Native" rel="up" title="Native">
  26. <link href="Non_002ddebug-DLL-Symbols.html#Non_002ddebug-DLL-Symbols" rel="next" title="Non-debug DLL Symbols">
  27. <link href="DJGPP-Native.html#DJGPP-Native" rel="prev" title="DJGPP Native">
  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="Cygwin-Native"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Hurd-Native.html#Hurd-Native" accesskey="n" rel="next">Hurd Native</a>, Previous: <a href="DJGPP-Native.html#DJGPP-Native" accesskey="p" rel="prev">DJGPP Native</a>, Up: <a href="Native.html#Native" accesskey="u" rel="up">Native</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="Features-for-Debugging-MS-Windows-PE-Executables"></a>
  64. <h4 class="subsection">21.1.4 Features for Debugging MS Windows PE Executables</h4>
  65. <a name="index-MS-Windows-debugging"></a>
  66. <a name="index-native-Cygwin-debugging"></a>
  67. <a name="index-Cygwin_002dspecific-commands"></a>
  68. <p><small>GDB</small> supports native debugging of MS Windows programs, including
  69. DLLs with and without symbolic debugging information.
  70. </p>
  71. <a name="index-Ctrl_002dBREAK_002c-MS_002dWindows"></a>
  72. <a name="index-interrupt-debuggee-on-MS_002dWindows"></a>
  73. <p>MS-Windows programs that call <code>SetConsoleMode</code> to switch off the
  74. special meaning of the &lsquo;<samp>Ctrl-C</samp>&rsquo; keystroke cannot be interrupted
  75. by typing <kbd>C-c</kbd>. For this reason, <small>GDB</small> on MS-Windows
  76. supports <kbd>C-<span class="key">BREAK</span></kbd> as an alternative interrupt key
  77. sequence, which can be used to interrupt the debuggee even if it
  78. ignores <kbd>C-c</kbd>.
  79. </p>
  80. <p>There are various additional Cygwin-specific commands, described in
  81. this section. Working with DLLs that have no debugging symbols is
  82. described in <a href="Non_002ddebug-DLL-Symbols.html#Non_002ddebug-DLL-Symbols">Non-debug DLL Symbols</a>.
  83. </p>
  84. <dl compact="compact">
  85. <dd><a name="index-info-w32"></a>
  86. </dd>
  87. <dt><code>info w32</code></dt>
  88. <dd><p>This is a prefix of MS Windows-specific commands which print
  89. information about the target system and important OS structures.
  90. </p>
  91. </dd>
  92. <dt><code>info w32 selector</code></dt>
  93. <dd><p>This command displays information returned by
  94. the Win32 API <code>GetThreadSelectorEntry</code> function.
  95. It takes an optional argument that is evaluated to
  96. a long value to give the information about this given selector.
  97. Without argument, this command displays information
  98. about the six segment registers.
  99. </p>
  100. </dd>
  101. <dt><code>info w32 thread-information-block</code></dt>
  102. <dd><p>This command displays thread specific information stored in the
  103. Thread Information Block (readable on the X86 CPU family using <code>$fs</code>
  104. selector for 32-bit programs and <code>$gs</code> for 64-bit programs).
  105. </p>
  106. <a name="index-signal_002devent"></a>
  107. </dd>
  108. <dt><code>signal-event <var>id</var></code></dt>
  109. <dd><p>This command signals an event with user-provided <var>id</var>. Used to resume
  110. crashing process when attached to it using MS-Windows JIT debugging (AeDebug).
  111. </p>
  112. <p>To use it, create or edit the following keys in
  113. <code>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug</code> and/or
  114. <code>HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug</code>
  115. (for x86_64 versions):
  116. </p>
  117. <ul class="no-bullet">
  118. <li>- <code>Debugger</code> (REG_SZ) &mdash; a command to launch the debugger.
  119. Suggested command is: <code><var>fully-qualified-path-to-gdb.exe</var> -ex
  120. &quot;attach %ld&quot; -ex &quot;signal-event %ld&quot; -ex &quot;continue&quot;</code>.
  121. <p>The first <code>%ld</code> will be replaced by the process ID of the
  122. crashing process, the second <code>%ld</code> will be replaced by the ID of
  123. the event that blocks the crashing process, waiting for <small>GDB</small>
  124. to attach.
  125. </p>
  126. </li><li>- <code>Auto</code> (REG_SZ) &mdash; either <code>1</code> or <code>0</code>. <code>1</code> will
  127. make the system run debugger specified by the Debugger key
  128. automatically, <code>0</code> will cause a dialog box with &ldquo;OK&rdquo; and
  129. &ldquo;Cancel&rdquo; buttons to appear, which allows the user to either
  130. terminate the crashing process (OK) or debug it (Cancel).
  131. </li></ul>
  132. <a name="index-set-cygwin_002dexceptions"></a>
  133. <a name="index-debugging-the-Cygwin-DLL"></a>
  134. <a name="index-Cygwin-DLL_002c-debugging"></a>
  135. </dd>
  136. <dt><code>set cygwin-exceptions <var>mode</var></code></dt>
  137. <dd><p>If <var>mode</var> is <code>on</code>, <small>GDB</small> will break on exceptions that
  138. happen inside the Cygwin DLL. If <var>mode</var> is <code>off</code>,
  139. <small>GDB</small> will delay recognition of exceptions, and may ignore some
  140. exceptions which seem to be caused by internal Cygwin DLL
  141. &ldquo;bookkeeping&rdquo;. This option is meant primarily for debugging the
  142. Cygwin DLL itself; the default value is <code>off</code> to avoid annoying
  143. <small>GDB</small> users with false <code>SIGSEGV</code> signals.
  144. </p>
  145. <a name="index-show-cygwin_002dexceptions"></a>
  146. </dd>
  147. <dt><code>show cygwin-exceptions</code></dt>
  148. <dd><p>Displays whether <small>GDB</small> will break on exceptions that happen
  149. inside the Cygwin DLL itself.
  150. </p>
  151. <a name="index-set-new_002dconsole"></a>
  152. </dd>
  153. <dt><code>set new-console <var>mode</var></code></dt>
  154. <dd><p>If <var>mode</var> is <code>on</code> the debuggee will
  155. be started in a new console on next start.
  156. If <var>mode</var> is <code>off</code>, the debuggee will
  157. be started in the same console as the debugger.
  158. </p>
  159. <a name="index-show-new_002dconsole"></a>
  160. </dd>
  161. <dt><code>show new-console</code></dt>
  162. <dd><p>Displays whether a new console is used
  163. when the debuggee is started.
  164. </p>
  165. <a name="index-set-new_002dgroup"></a>
  166. </dd>
  167. <dt><code>set new-group <var>mode</var></code></dt>
  168. <dd><p>This boolean value controls whether the debuggee should
  169. start a new group or stay in the same group as the debugger.
  170. This affects the way the Windows OS handles
  171. &lsquo;<samp>Ctrl-C</samp>&rsquo;.
  172. </p>
  173. <a name="index-show-new_002dgroup"></a>
  174. </dd>
  175. <dt><code>show new-group</code></dt>
  176. <dd><p>Displays current value of new-group boolean.
  177. </p>
  178. <a name="index-set-debugevents"></a>
  179. </dd>
  180. <dt><code>set debugevents</code></dt>
  181. <dd><p>This boolean value adds debug output concerning kernel events related
  182. to the debuggee seen by the debugger. This includes events that
  183. signal thread and process creation and exit, DLL loading and
  184. unloading, console interrupts, and debugging messages produced by the
  185. Windows <code>OutputDebugString</code> API call.
  186. </p>
  187. <a name="index-set-debugexec"></a>
  188. </dd>
  189. <dt><code>set debugexec</code></dt>
  190. <dd><p>This boolean value adds debug output concerning execute events
  191. (such as resume thread) seen by the debugger.
  192. </p>
  193. <a name="index-set-debugexceptions"></a>
  194. </dd>
  195. <dt><code>set debugexceptions</code></dt>
  196. <dd><p>This boolean value adds debug output concerning exceptions in the
  197. debuggee seen by the debugger.
  198. </p>
  199. <a name="index-set-debugmemory"></a>
  200. </dd>
  201. <dt><code>set debugmemory</code></dt>
  202. <dd><p>This boolean value adds debug output concerning debuggee memory reads
  203. and writes by the debugger.
  204. </p>
  205. <a name="index-set-shell"></a>
  206. </dd>
  207. <dt><code>set shell</code></dt>
  208. <dd><p>This boolean values specifies whether the debuggee is called
  209. via a shell or directly (default value is on).
  210. </p>
  211. <a name="index-show-shell"></a>
  212. </dd>
  213. <dt><code>show shell</code></dt>
  214. <dd><p>Displays if the debuggee will be started with a shell.
  215. </p>
  216. </dd>
  217. </dl>
  218. <table class="menu" border="0" cellspacing="0">
  219. <tr><td align="left" valign="top">&bull; <a href="Non_002ddebug-DLL-Symbols.html#Non_002ddebug-DLL-Symbols" accesskey="1">Non-debug DLL Symbols</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Support for DLLs without debugging symbols
  220. </td></tr>
  221. </table>
  222. <hr>
  223. <div class="header">
  224. <p>
  225. Next: <a href="Hurd-Native.html#Hurd-Native" accesskey="n" rel="next">Hurd Native</a>, Previous: <a href="DJGPP-Native.html#DJGPP-Native" accesskey="p" rel="prev">DJGPP Native</a>, Up: <a href="Native.html#Native" accesskey="u" rel="up">Native</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>
  226. </div>
  227. </body>
  228. </html>