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.

144 line
6.7KB

  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>Command Options (Debugging with GDB)</title>
  17. <meta name="description" content="Command Options (Debugging with GDB)">
  18. <meta name="keywords" content="Command Options (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="Commands.html#Commands" rel="up" title="Commands">
  26. <link href="Command-aliases-default-args.html#Command-aliases-default-args" rel="next" title="Command aliases default args">
  27. <link href="Completion.html#Completion" rel="prev" title="Completion">
  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="Command-Options"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Command-aliases-default-args.html#Command-aliases-default-args" accesskey="n" rel="next">Command aliases default args</a>, Previous: <a href="Completion.html#Completion" accesskey="p" rel="prev">Completion</a>, Up: <a href="Commands.html#Commands" accesskey="u" rel="up">Commands</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="Command-options"></a>
  64. <h3 class="section">3.4 Command options</h3>
  65. <a name="index-command-options"></a>
  66. <p>Some commands accept options starting with a leading dash. For
  67. example, <code>print -pretty</code>. Similarly to command names, you can
  68. abbreviate a <small>GDB</small> option to the first few letters of the
  69. option name, if that abbreviation is unambiguous, and you can also use
  70. the <tt class="key">TAB</tt> key to get <small>GDB</small> to fill out the rest of a word
  71. in an option (or to show you the alternatives available, if there is
  72. more than one possibility).
  73. </p>
  74. <a name="index-command-options_002c-raw-input"></a>
  75. <p>Some commands take raw input as argument. For example, the print
  76. command processes arbitrary expressions in any of the languages
  77. supported by <small>GDB</small>. With such commands, because raw input may
  78. start with a leading dash that would be confused with an option or any
  79. of its abbreviations, e.g. <code>print -p</code> (short for <code>print
  80. -pretty</code> or printing negative <code>p</code>?), if you specify any command
  81. option, then you must use a double-dash (<code>--</code>) delimiter to
  82. indicate the end of options.
  83. </p>
  84. <a name="index-command-options_002c-boolean"></a>
  85. <p>Some options are described as accepting an argument which can be
  86. either <code>on</code> or <code>off</code>. These are known as <em>boolean
  87. options</em>. Similarly to boolean settings commands&mdash;<code>on</code> and
  88. <code>off</code> are the typical values, but any of <code>1</code>, <code>yes</code> and
  89. <code>enable</code> can also be used as &ldquo;true&rdquo; value, and any of <code>0</code>,
  90. <code>no</code> and <code>disable</code> can also be used as &ldquo;false&rdquo; value. You
  91. can also omit a &ldquo;true&rdquo; value, as it is implied by default.
  92. </p>
  93. <p>For example, these are equivalent:
  94. </p>
  95. <div class="smallexample">
  96. <pre class="smallexample">(gdb) print -object on -pretty off -element unlimited -- *myptr
  97. (gdb) p -o -p 0 -e u -- *myptr
  98. </pre></div>
  99. <p>You can discover the set of options some command accepts by completing
  100. on <code>-</code> after the command name. For example:
  101. </p>
  102. <div class="smallexample">
  103. <pre class="smallexample">(gdb) print -<span class="key">TAB</span><span class="key">TAB</span>
  104. -address -max-depth -raw-values -union
  105. -array -null-stop -repeats -vtbl
  106. -array-indexes -object -static-members
  107. -elements -pretty -symbol
  108. </pre></div>
  109. <p>Completion will in some cases guide you with a suggestion of what kind
  110. of argument an option expects. For example:
  111. </p>
  112. <div class="smallexample">
  113. <pre class="smallexample">(gdb) print -elements <span class="key">TAB</span><span class="key">TAB</span>
  114. NUMBER unlimited
  115. </pre></div>
  116. <p>Here, the option expects a number (e.g., <code>100</code>), not literal
  117. <code>NUMBER</code>. Such metasyntactical arguments are always presented in
  118. uppercase.
  119. </p>
  120. <p>(For more on using the <code>print</code> command, see <a href="Data.html#Data">Examining
  121. Data</a>.)
  122. </p>
  123. <hr>
  124. <div class="header">
  125. <p>
  126. Next: <a href="Command-aliases-default-args.html#Command-aliases-default-args" accesskey="n" rel="next">Command aliases default args</a>, Previous: <a href="Completion.html#Completion" accesskey="p" rel="prev">Completion</a>, Up: <a href="Commands.html#Commands" accesskey="u" rel="up">Commands</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>
  127. </div>
  128. </body>
  129. </html>