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.

240 lines
11KB

  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>OS Information (Debugging with GDB)</title>
  17. <meta name="description" content="OS Information (Debugging with GDB)">
  18. <meta name="keywords" content="OS Information (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="Data.html#Data" rel="up" title="Data">
  26. <link href="Memory-Region-Attributes.html#Memory-Region-Attributes" rel="next" title="Memory Region Attributes">
  27. <link href="Vector-Unit.html#Vector-Unit" rel="prev" title="Vector Unit">
  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="OS-Information"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Memory-Region-Attributes.html#Memory-Region-Attributes" accesskey="n" rel="next">Memory Region Attributes</a>, Previous: <a href="Vector-Unit.html#Vector-Unit" accesskey="p" rel="prev">Vector Unit</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</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="Operating-System-Auxiliary-Information"></a>
  64. <h3 class="section">10.16 Operating System Auxiliary Information</h3>
  65. <a name="index-OS-information"></a>
  66. <p><small>GDB</small> provides interfaces to useful OS facilities that can help
  67. you debug your program.
  68. </p>
  69. <a name="index-auxiliary-vector"></a>
  70. <a name="index-vector_002c-auxiliary"></a>
  71. <p>Some operating systems supply an <em>auxiliary vector</em> to programs at
  72. startup. This is akin to the arguments and environment that you
  73. specify for a program, but contains a system-dependent variety of
  74. binary values that tell system libraries important details about the
  75. hardware, operating system, and process. Each value&rsquo;s purpose is
  76. identified by an integer tag; the meanings are well-known but system-specific.
  77. Depending on the configuration and operating system facilities,
  78. <small>GDB</small> may be able to show you this information. For remote
  79. targets, this functionality may further depend on the remote stub&rsquo;s
  80. support of the &lsquo;<samp>qXfer:auxv:read</samp>&rsquo; packet, see
  81. <a href="General-Query-Packets.html#qXfer-auxiliary-vector-read">qXfer auxiliary vector read</a>.
  82. </p>
  83. <dl compact="compact">
  84. <dd><a name="index-info-auxv"></a>
  85. </dd>
  86. <dt><code>info auxv</code></dt>
  87. <dd><p>Display the auxiliary vector of the inferior, which can be either a
  88. live process or a core dump file. <small>GDB</small> prints each tag value
  89. numerically, and also shows names and text descriptions for recognized
  90. tags. Some values in the vector are numbers, some bit masks, and some
  91. pointers to strings or other data. <small>GDB</small> displays each value in the
  92. most appropriate form for a recognized tag, and in hexadecimal for
  93. an unrecognized tag.
  94. </p></dd>
  95. </dl>
  96. <p>On some targets, <small>GDB</small> can access operating system-specific
  97. information and show it to you. The types of information available
  98. will differ depending on the type of operating system running on the
  99. target. The mechanism used to fetch the data is described in
  100. <a href="Operating-System-Information.html#Operating-System-Information">Operating System Information</a>. For remote targets, this
  101. functionality depends on the remote stub&rsquo;s support of the
  102. &lsquo;<samp>qXfer:osdata:read</samp>&rsquo; packet, see <a href="General-Query-Packets.html#qXfer-osdata-read">qXfer osdata read</a>.
  103. </p>
  104. <dl compact="compact">
  105. <dd><a name="index-info-os"></a>
  106. </dd>
  107. <dt><code>info os <var>infotype</var></code></dt>
  108. <dd>
  109. <p>Display OS information of the requested type.
  110. </p>
  111. <p>On <small>GNU</small>/Linux, the following values of <var>infotype</var> are valid:
  112. </p>
  113. <a name="linux-info-os-infotypes"></a><dl compact="compact">
  114. <dd><a name="index-info-os-cpus"></a>
  115. </dd>
  116. <dt><code>cpus</code></dt>
  117. <dd><p>Display the list of all CPUs/cores. For each CPU/core, <small>GDB</small> prints
  118. the available fields from /proc/cpuinfo. For each supported architecture
  119. different fields are available. Two common entries are processor which gives
  120. CPU number and bogomips; a system constant that is calculated during
  121. kernel initialization.
  122. </p>
  123. <a name="index-info-os-files"></a>
  124. </dd>
  125. <dt><code>files</code></dt>
  126. <dd><p>Display the list of open file descriptors on the target. For each
  127. file descriptor, <small>GDB</small> prints the identifier of the process
  128. owning the descriptor, the command of the owning process, the value
  129. of the descriptor, and the target of the descriptor.
  130. </p>
  131. <a name="index-info-os-modules"></a>
  132. </dd>
  133. <dt><code>modules</code></dt>
  134. <dd><p>Display the list of all loaded kernel modules on the target. For each
  135. module, <small>GDB</small> prints the module name, the size of the module in
  136. bytes, the number of times the module is used, the dependencies of the
  137. module, the status of the module, and the address of the loaded module
  138. in memory.
  139. </p>
  140. <a name="index-info-os-msg"></a>
  141. </dd>
  142. <dt><code>msg</code></dt>
  143. <dd><p>Display the list of all System V message queues on the target. For each
  144. message queue, <small>GDB</small> prints the message queue key, the message
  145. queue identifier, the access permissions, the current number of bytes
  146. on the queue, the current number of messages on the queue, the processes
  147. that last sent and received a message on the queue, the user and group
  148. of the owner and creator of the message queue, the times at which a
  149. message was last sent and received on the queue, and the time at which
  150. the message queue was last changed.
  151. </p>
  152. <a name="index-info-os-processes"></a>
  153. </dd>
  154. <dt><code>processes</code></dt>
  155. <dd><p>Display the list of processes on the target. For each process,
  156. <small>GDB</small> prints the process identifier, the name of the user, the
  157. command corresponding to the process, and the list of processor cores
  158. that the process is currently running on. (To understand what these
  159. properties mean, for this and the following info types, please consult
  160. the general <small>GNU</small>/Linux documentation.)
  161. </p>
  162. <a name="index-info-os-procgroups"></a>
  163. </dd>
  164. <dt><code>procgroups</code></dt>
  165. <dd><p>Display the list of process groups on the target. For each process,
  166. <small>GDB</small> prints the identifier of the process group that it belongs
  167. to, the command corresponding to the process group leader, the process
  168. identifier, and the command line of the process. The list is sorted
  169. first by the process group identifier, then by the process identifier,
  170. so that processes belonging to the same process group are grouped together
  171. and the process group leader is listed first.
  172. </p>
  173. <a name="index-info-os-semaphores"></a>
  174. </dd>
  175. <dt><code>semaphores</code></dt>
  176. <dd><p>Display the list of all System V semaphore sets on the target. For each
  177. semaphore set, <small>GDB</small> prints the semaphore set key, the semaphore
  178. set identifier, the access permissions, the number of semaphores in the
  179. set, the user and group of the owner and creator of the semaphore set,
  180. and the times at which the semaphore set was operated upon and changed.
  181. </p>
  182. <a name="index-info-os-shm"></a>
  183. </dd>
  184. <dt><code>shm</code></dt>
  185. <dd><p>Display the list of all System V shared-memory regions on the target.
  186. For each shared-memory region, <small>GDB</small> prints the region key,
  187. the shared-memory identifier, the access permissions, the size of the
  188. region, the process that created the region, the process that last
  189. attached to or detached from the region, the current number of live
  190. attaches to the region, and the times at which the region was last
  191. attached to, detach from, and changed.
  192. </p>
  193. <a name="index-info-os-sockets"></a>
  194. </dd>
  195. <dt><code>sockets</code></dt>
  196. <dd><p>Display the list of Internet-domain sockets on the target. For each
  197. socket, <small>GDB</small> prints the address and port of the local and
  198. remote endpoints, the current state of the connection, the creator of
  199. the socket, the IP address family of the socket, and the type of the
  200. connection.
  201. </p>
  202. <a name="index-info-os-threads"></a>
  203. </dd>
  204. <dt><code>threads</code></dt>
  205. <dd><p>Display the list of threads running on the target. For each thread,
  206. <small>GDB</small> prints the identifier of the process that the thread
  207. belongs to, the command of the process, the thread identifier, and the
  208. processor core that it is currently running on. The main thread of a
  209. process is not listed.
  210. </p></dd>
  211. </dl>
  212. </dd>
  213. <dt><code>info os</code></dt>
  214. <dd><p>If <var>infotype</var> is omitted, then list the possible values for
  215. <var>infotype</var> and the kind of OS information available for each
  216. <var>infotype</var>. If the target does not return a list of possible
  217. types, this command will report an error.
  218. </p></dd>
  219. </dl>
  220. <hr>
  221. <div class="header">
  222. <p>
  223. Next: <a href="Memory-Region-Attributes.html#Memory-Region-Attributes" accesskey="n" rel="next">Memory Region Attributes</a>, Previous: <a href="Vector-Unit.html#Vector-Unit" accesskey="p" rel="prev">Vector Unit</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</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>
  224. </div>
  225. </body>
  226. </html>