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.

Frame-Info.html 8.9KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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>Frame Info (Debugging with GDB)</title>
  17. <meta name="description" content="Frame Info (Debugging with GDB)">
  18. <meta name="keywords" content="Frame Info (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="Stack.html#Stack" rel="up" title="Stack">
  26. <link href="Frame-Apply.html#Frame-Apply" rel="next" title="Frame Apply">
  27. <link href="Selection.html#Selection" rel="prev" title="Selection">
  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="Frame-Info"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Frame-Apply.html#Frame-Apply" accesskey="n" rel="next">Frame Apply</a>, Previous: <a href="Selection.html#Selection" accesskey="p" rel="prev">Selection</a>, Up: <a href="Stack.html#Stack" accesskey="u" rel="up">Stack</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="Information-About-a-Frame"></a>
  64. <h3 class="section">8.4 Information About a Frame</h3>
  65. <p>There are several other commands to print information about the selected
  66. stack frame.
  67. </p>
  68. <dl compact="compact">
  69. <dt><code>frame</code></dt>
  70. <dt><code>f</code></dt>
  71. <dd><p>When used without any argument, this command does not change which
  72. frame is selected, but prints a brief description of the currently
  73. selected stack frame. It can be abbreviated <code>f</code>. With an
  74. argument, this command is used to select a stack frame.
  75. See <a href="Selection.html#Selection">Selecting a Frame</a>.
  76. </p>
  77. <a name="index-info-frame"></a>
  78. <a name="index-info-f-_0028info-frame_0029"></a>
  79. </dd>
  80. <dt><code>info frame</code></dt>
  81. <dt><code>info f</code></dt>
  82. <dd><p>This command prints a verbose description of the selected stack frame,
  83. including:
  84. </p>
  85. <ul>
  86. <li> the address of the frame
  87. </li><li> the address of the next frame down (called by this frame)
  88. </li><li> the address of the next frame up (caller of this frame)
  89. </li><li> the language in which the source code corresponding to this frame is written
  90. </li><li> the address of the frame&rsquo;s arguments
  91. </li><li> the address of the frame&rsquo;s local variables
  92. </li><li> the program counter saved in it (the address of execution in the caller frame)
  93. </li><li> which registers were saved in the frame
  94. </li></ul>
  95. <p>The verbose description is useful when
  96. something has gone wrong that has made the stack format fail to fit
  97. the usual conventions.
  98. </p>
  99. </dd>
  100. <dt><code>info frame <span class="roman">[</span> <var>frame-selection-spec</var> <span class="roman">]</span></code></dt>
  101. <dt><code>info f <span class="roman">[</span> <var>frame-selection-spec</var> <span class="roman">]</span></code></dt>
  102. <dd><p>Print a verbose description of the frame selected by
  103. <var>frame-selection-spec</var>. The <var>frame-selection-spec</var> is the
  104. same as for the <code>frame</code> command (see <a href="Selection.html#Selection">Selecting
  105. a Frame</a>). The selected frame remains unchanged by this command.
  106. </p>
  107. <a name="index-info-args"></a>
  108. </dd>
  109. <dt><code>info args [-q]</code></dt>
  110. <dd><p>Print the arguments of the selected frame, each on a separate line.
  111. </p>
  112. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  113. printing header information and messages explaining why no argument
  114. have been printed.
  115. </p>
  116. </dd>
  117. <dt><code>info args [-q] [-t <var>type_regexp</var>] [<var>regexp</var>]</code></dt>
  118. <dd><p>Like <kbd>info args</kbd>, but only print the arguments selected
  119. with the provided regexp(s).
  120. </p>
  121. <p>If <var>regexp</var> is provided, print only the arguments whose names
  122. match the regular expression <var>regexp</var>.
  123. </p>
  124. <p>If <var>type_regexp</var> is provided, print only the arguments whose
  125. types, as printed by the <code>whatis</code> command, match
  126. the regular expression <var>type_regexp</var>.
  127. If <var>type_regexp</var> contains space(s), it should be enclosed in
  128. quote characters. If needed, use backslash to escape the meaning
  129. of special characters or quotes.
  130. </p>
  131. <p>If both <var>regexp</var> and <var>type_regexp</var> are provided, an argument
  132. is printed only if its name matches <var>regexp</var> and its type matches
  133. <var>type_regexp</var>.
  134. </p>
  135. </dd>
  136. <dt><code>info locals [-q]</code></dt>
  137. <dd><a name="index-info-locals"></a>
  138. <p>Print the local variables of the selected frame, each on a separate
  139. line. These are all variables (declared either static or automatic)
  140. accessible at the point of execution of the selected frame.
  141. </p>
  142. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  143. printing header information and messages explaining why no local variables
  144. have been printed.
  145. </p>
  146. </dd>
  147. <dt><code>info locals [-q] [-t <var>type_regexp</var>] [<var>regexp</var>]</code></dt>
  148. <dd><p>Like <kbd>info locals</kbd>, but only print the local variables selected
  149. with the provided regexp(s).
  150. </p>
  151. <p>If <var>regexp</var> is provided, print only the local variables whose names
  152. match the regular expression <var>regexp</var>.
  153. </p>
  154. <p>If <var>type_regexp</var> is provided, print only the local variables whose
  155. types, as printed by the <code>whatis</code> command, match
  156. the regular expression <var>type_regexp</var>.
  157. If <var>type_regexp</var> contains space(s), it should be enclosed in
  158. quote characters. If needed, use backslash to escape the meaning
  159. of special characters or quotes.
  160. </p>
  161. <p>If both <var>regexp</var> and <var>type_regexp</var> are provided, a local variable
  162. is printed only if its name matches <var>regexp</var> and its type matches
  163. <var>type_regexp</var>.
  164. </p>
  165. <p>The command <kbd>info locals -q -t <var>type_regexp</var></kbd> can usefully be
  166. combined with the commands <kbd>frame apply</kbd> and <kbd>thread apply</kbd>.
  167. For example, your program might use Resource Acquisition Is
  168. Initialization types (RAII) such as <code>lock_something_t</code>: each
  169. local variable of type <code>lock_something_t</code> automatically places a
  170. lock that is destroyed when the variable goes out of scope. You can
  171. then list all acquired locks in your program by doing
  172. </p><div class="smallexample">
  173. <pre class="smallexample">thread apply all -s frame apply all -s info locals -q -t lock_something_t
  174. </pre></div>
  175. <p>or the equivalent shorter form
  176. </p><div class="smallexample">
  177. <pre class="smallexample">tfaas i lo -q -t lock_something_t
  178. </pre></div>
  179. </dd>
  180. </dl>
  181. <hr>
  182. <div class="header">
  183. <p>
  184. Next: <a href="Frame-Apply.html#Frame-Apply" accesskey="n" rel="next">Frame Apply</a>, Previous: <a href="Selection.html#Selection" accesskey="p" rel="prev">Selection</a>, Up: <a href="Stack.html#Stack" accesskey="u" rel="up">Stack</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>
  185. </div>
  186. </body>
  187. </html>