toolchain/share/doc/gdb/Maintenance-Commands.html

527 lines
38 KiB
HTML

<html lang="en">
<head>
<title>Maintenance Commands - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Installing-GDB.html#Installing-GDB" title="Installing GDB">
<link rel="next" href="Remote-Protocol.html#Remote-Protocol" title="Remote Protocol">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Maintenance-Commands"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Remote-Protocol.html#Remote-Protocol">Remote Protocol</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Installing-GDB.html#Installing-GDB">Installing GDB</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="appendix">Appendix D Maintenance Commands</h2>
<p><a name="index-maintenance-commands-3309"></a><a name="index-internal-commands-3310"></a>
In addition to commands intended for <span class="sc">gdb</span> users, <span class="sc">gdb</span>
includes a number of commands intended for <span class="sc">gdb</span> developers,
that are not documented elsewhere in this manual. These commands are
provided here for reference. (For commands that turn on debugging
messages, see <a href="Debugging-Output.html#Debugging-Output">Debugging Output</a>.)
<a name="index-maint-agent-3311"></a>
<a name="index-maint-agent_002deval-3312"></a>
<dl><dt><code>maint agent </code><span class="roman">[</span><code>-at </code><var>location</var><span class="roman">,</span><span class="roman">]</span> <var>expression</var><dt><code>maint agent-eval </code><span class="roman">[</span><code>-at </code><var>location</var><span class="roman">,</span><span class="roman">]</span> <var>expression</var><dd>Translate the given <var>expression</var> into remote agent bytecodes.
This command is useful for debugging the Agent Expression mechanism
(see <a href="Agent-Expressions.html#Agent-Expressions">Agent Expressions</a>). The &lsquo;<samp><span class="samp">agent</span></samp>&rsquo; version produces an
expression useful for data collection, such as by tracepoints, while
&lsquo;<samp><span class="samp">maint agent-eval</span></samp>&rsquo; produces an expression that evaluates directly
to a result. For instance, a collection expression for <code>globa +
globb</code> will include bytecodes to record four bytes of memory at each
of the addresses of <code>globa</code> and <code>globb</code>, while discarding
the result of the addition, while an evaluation expression will do the
addition and return the sum.
If <code>-at</code> is given, generate remote agent bytecode for <var>location</var>.
If not, generate remote agent bytecode for current frame PC address.
<p><a name="index-maint-agent_002dprintf-3313"></a><br><dt><code>maint agent-printf </code><var>format</var><code>,</code><var>expr</var><code>,...</code><dd>Translate the given format string and list of argument expressions
into remote agent bytecodes and display them as a disassembled list.
This command is useful for debugging the agent version of dynamic
printf (see <a href="Dynamic-Printf.html#Dynamic-Printf">Dynamic Printf</a>).
<p><a name="index-maint-info-breakpoints-3314"></a><br><dt><code><a name="maint-info-breakpoints"></a>maint info breakpoints</code><dd>Using the same format as &lsquo;<samp><span class="samp">info breakpoints</span></samp>&rsquo;, display both the
breakpoints you've set explicitly, and those <span class="sc">gdb</span> is using for
internal purposes. Internal breakpoints are shown with negative
breakpoint numbers. The type column identifies what kind of breakpoint
is shown:
<dl>
<dt><code>breakpoint</code><dd>Normal, explicitly set breakpoint.
<br><dt><code>watchpoint</code><dd>Normal, explicitly set watchpoint.
<br><dt><code>longjmp</code><dd>Internal breakpoint, used to handle correctly stepping through
<code>longjmp</code> calls.
<br><dt><code>longjmp resume</code><dd>Internal breakpoint at the target of a <code>longjmp</code>.
<br><dt><code>until</code><dd>Temporary internal breakpoint used by the <span class="sc">gdb</span> <code>until</code> command.
<br><dt><code>finish</code><dd>Temporary internal breakpoint used by the <span class="sc">gdb</span> <code>finish</code> command.
<br><dt><code>shlib events</code><dd>Shared library events.
</dl>
<p><a name="index-maint-info-btrace-3315"></a><br><dt><code>maint info btrace</code><dd>Pint information about raw branch tracing data.
<p><a name="index-maint-btrace-packet_002dhistory-3316"></a><br><dt><code>maint btrace packet-history</code><dd>Print the raw branch trace packets that are used to compute the
execution history for the &lsquo;<samp><span class="samp">record btrace</span></samp>&rsquo; command. Both the
information and the format in which it is printed depend on the btrace
recording format.
<dl>
<dt><code>bts</code><dd>For the BTS recording format, print a list of blocks of sequential
code. For each block, the following information is printed:
<dl>
<dt>Block number<dd>Newer blocks have higher numbers. The oldest block has number zero.
<br><dt>Lowest &lsquo;<samp><span class="samp">PC</span></samp>&rsquo;<br><dt>Highest &lsquo;<samp><span class="samp">PC</span></samp>&rsquo;<dd></dl>
<br><dt><code>pt</code><dd>For the Intel Processor Trace recording format, print a list of
Intel Processor Trace packets. For each packet, the following
information is printed:
<dl>
<dt>Packet number<dd>Newer packets have higher numbers. The oldest packet has number zero.
<br><dt>Trace offset<dd>The packet's offset in the trace stream.
<br><dt>Packet opcode and payload<dd></dl>
</dl>
<p><a name="index-maint-btrace-clear_002dpacket_002dhistory-3317"></a><br><dt><code>maint btrace clear-packet-history</code><dd>Discards the cached packet history printed by the &lsquo;<samp><span class="samp">maint btrace
packet-history</span></samp>&rsquo; command. The history will be computed again when
needed.
<p><a name="index-maint-btrace-clear-3318"></a><br><dt><code>maint btrace clear</code><dd>Discard the branch trace data. The data will be fetched anew and the
branch trace will be recomputed when needed.
<p>This implicitly truncates the branch trace to a single branch trace
buffer. When updating branch trace incrementally, the branch trace
available to <span class="sc">gdb</span> may be bigger than a single branch trace
buffer.
<p><a name="index-maint-set-btrace-pt-skip_002dpad-3319"></a><br><dt><code>maint set btrace pt skip-pad</code><dd><a name="index-maint-show-btrace-pt-skip_002dpad-3320"></a><br><dt><code>maint show btrace pt skip-pad</code><dd>Control whether <span class="sc">gdb</span> will skip PAD packets when computing the
packet history.
<p><a name="index-set-displaced_002dstepping-3321"></a><a name="index-show-displaced_002dstepping-3322"></a><a name="index-displaced-stepping-support-3323"></a><a name="index-out_002dof_002dline-single_002dstepping-3324"></a><br><dt><code>set displaced-stepping</code><dt><code>show displaced-stepping</code><dd>Control whether or not <span class="sc">gdb</span> will do <dfn>displaced stepping</dfn>
if the target supports it. Displaced stepping is a way to single-step
over breakpoints without removing them from the inferior, by executing
an out-of-line copy of the instruction that was originally at the
breakpoint location. It is also known as out-of-line single-stepping.
<dl>
<dt><code>set displaced-stepping on</code><dd>If the target architecture supports it, <span class="sc">gdb</span> will use
displaced stepping to step over breakpoints.
<br><dt><code>set displaced-stepping off</code><dd><span class="sc">gdb</span> will not use displaced stepping to step over breakpoints,
even if such is supported by the target architecture.
<p><a name="index-non_002dstop-mode_002c-and-_0040samp_007bset-displaced_002dstepping_007d-3325"></a><br><dt><code>set displaced-stepping auto</code><dd>This is the default mode. <span class="sc">gdb</span> will use displaced stepping
only if non-stop mode is active (see <a href="Non_002dStop-Mode.html#Non_002dStop-Mode">Non-Stop Mode</a>) and the target
architecture supports displaced stepping.
</dl>
<p><a name="index-maint-check_002dpsymtabs-3326"></a><br><dt><code>maint check-psymtabs</code><dd>Check the consistency of currently expanded psymtabs versus symtabs.
Use this to check, for example, whether a symbol is in one but not the other.
<p><a name="index-maint-check_002dsymtabs-3327"></a><br><dt><code>maint check-symtabs</code><dd>Check the consistency of currently expanded symtabs.
<p><a name="index-maint-expand_002dsymtabs-3328"></a><br><dt><code>maint expand-symtabs [</code><var>regexp</var><code>]</code><dd>Expand symbol tables.
If <var>regexp</var> is specified, only expand symbol tables for file
names matching <var>regexp</var>.
<p><a name="index-maint-set-catch_002ddemangler_002dcrashes-3329"></a><a name="index-maint-show-catch_002ddemangler_002dcrashes-3330"></a><a name="index-demangler-crashes-3331"></a><br><dt><code>maint set catch-demangler-crashes [on|off]</code><dt><code>maint show catch-demangler-crashes</code><dd>Control whether <span class="sc">gdb</span> should attempt to catch crashes in the
symbol name demangler. The default is to attempt to catch crashes.
If enabled, the first time a crash is caught, a core file is created,
the offending symbol is displayed and the user is presented with the
option to terminate the current session.
<p><a name="index-maint-cplus-first_005fcomponent-3332"></a><br><dt><code>maint cplus first_component </code><var>name</var><dd>Print the first C<tt>++</tt> class/namespace component of <var>name</var>.
<p><a name="index-maint-cplus-namespace-3333"></a><br><dt><code>maint cplus namespace</code><dd>Print the list of possible C<tt>++</tt> namespaces.
<p><a name="index-maint-deprecate-3334"></a><a name="index-maint-undeprecate-3335"></a><a name="index-deprecated-commands-3336"></a><br><dt><code>maint deprecate </code><var>command</var> <span class="roman">[</span><var>replacement</var><span class="roman">]</span><dt><code>maint undeprecate </code><var>command</var><dd>Deprecate or undeprecate the named <var>command</var>. Deprecated commands
cause <span class="sc">gdb</span> to issue a warning when you use them. The optional
argument <var>replacement</var> says which newer command should be used in
favor of the deprecated one; if it is given, <span class="sc">gdb</span> will mention
the replacement as part of the warning.
<p><a name="index-maint-dump_002dme-3337"></a><br><dt><code>maint dump-me</code><dd><a name="index-g_t_0040code_007bSIGQUIT_007d-signal_002c-dump-core-of-_0040value_007bGDBN_007d-3338"></a>Cause a fatal signal in the debugger and force it to dump its core.
This is supported only on systems which support aborting a program
with the <code>SIGQUIT</code> signal.
<p><a name="index-maint-internal_002derror-3339"></a><a name="index-maint-internal_002dwarning-3340"></a><a name="index-maint-demangler_002dwarning-3341"></a><a name="index-demangler-crashes-3342"></a><br><dt><code>maint internal-error </code><span class="roman">[</span><var>message-text</var><span class="roman">]</span><dt><code>maint internal-warning </code><span class="roman">[</span><var>message-text</var><span class="roman">]</span><dt><code>maint demangler-warning </code><span class="roman">[</span><var>message-text</var><span class="roman">]</span><dd>
Cause <span class="sc">gdb</span> to call the internal function <code>internal_error</code>,
<code>internal_warning</code> or <code>demangler_warning</code> and hence behave
as though an internal problem has been detected. In addition to
reporting the internal problem, these functions give the user the
opportunity to either quit <span class="sc">gdb</span> or (for <code>internal_error</code>
and <code>internal_warning</code>) create a core file of the current
<span class="sc">gdb</span> session.
<p>These commands take an optional parameter <var>message-text</var> that is
used as the text of the error or warning message.
<p>Here's an example of using <code>internal-error</code>:
<pre class="smallexample"> (gdb) <kbd>maint internal-error testing, 1, 2</kbd>
.../maint.c:121: internal-error: testing, 1, 2
A problem internal to GDB has been detected. Further
debugging may prove unreliable.
Quit this debugging session? (y or n) <kbd>n</kbd>
Create a core file? (y or n) <kbd>n</kbd>
(gdb)
</pre>
<p><a name="index-g_t_0040value_007bGDBN_007d-internal-error-3343"></a><a name="index-internal-errors_002c-control-of-_0040value_007bGDBN_007d-behavior-3344"></a><a name="index-demangler-crashes-3345"></a>
<a name="index-maint-set-internal_002derror-3346"></a><a name="index-maint-show-internal_002derror-3347"></a><a name="index-maint-set-internal_002dwarning-3348"></a><a name="index-maint-show-internal_002dwarning-3349"></a><a name="index-maint-set-demangler_002dwarning-3350"></a><a name="index-maint-show-demangler_002dwarning-3351"></a><br><dt><code>maint set internal-error </code><var>action</var><code> [ask|yes|no]</code><dt><code>maint show internal-error </code><var>action</var><dt><code>maint set internal-warning </code><var>action</var><code> [ask|yes|no]</code><dt><code>maint show internal-warning </code><var>action</var><dt><code>maint set demangler-warning </code><var>action</var><code> [ask|yes|no]</code><dt><code>maint show demangler-warning </code><var>action</var><dd>When <span class="sc">gdb</span> reports an internal problem (error or warning) it
gives the user the opportunity to both quit <span class="sc">gdb</span> and create a
core file of the current <span class="sc">gdb</span> session. These commands let you
override the default behaviour for each particular <var>action</var>,
described in the table below.
<dl>
<dt>&lsquo;<samp><span class="samp">quit</span></samp>&rsquo;<dd>You can specify that <span class="sc">gdb</span> should always (yes) or never (no)
quit. The default is to ask the user what to do.
<br><dt>&lsquo;<samp><span class="samp">corefile</span></samp>&rsquo;<dd>You can specify that <span class="sc">gdb</span> should always (yes) or never (no)
create a core file. The default is to ask the user what to do. Note
that there is no <code>corefile</code> option for <code>demangler-warning</code>:
demangler warnings always create a core file and this cannot be
disabled.
</dl>
<p><a name="index-maint-packet-3352"></a><br><dt><code>maint packet </code><var>text</var><dd>If <span class="sc">gdb</span> is talking to an inferior via the serial protocol,
then this command sends the string <var>text</var> to the inferior, and
displays the response packet. <span class="sc">gdb</span> supplies the initial
&lsquo;<samp><span class="samp">$</span></samp>&rsquo; character, the terminating &lsquo;<samp><span class="samp">#</span></samp>&rsquo; character, and the
checksum.
<p><a name="index-maint-print-architecture-3353"></a><br><dt><code>maint print architecture </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dd>Print the entire architecture configuration. The optional argument
<var>file</var> names the file where the output goes.
<p><a name="index-maint-print-c_002dtdesc-_0040r_007b_005b_007d_0040var_007bfile_007d_0040r_007b_005d_007d-3354"></a><br><dt><code>maint print c-tdesc</code><dd>Print the target description (see <a href="Target-Descriptions.html#Target-Descriptions">Target Descriptions</a>) as
a C source file. By default, the target description is for the current
target, but if the optional argument <var>file</var> is provided, that file
is used to produce the description. The <var>file</var> should be an XML
document, of the form described in <a href="Target-Description-Format.html#Target-Description-Format">Target Description Format</a>.
The created source file is built into <span class="sc">gdb</span> when <span class="sc">gdb</span> is
built again. This command is used by developers after they add or
modify XML target descriptions.
<p><a name="index-maint-check-xml_002ddescriptions-3355"></a><br><dt><code>maint check xml-descriptions </code><var>dir</var><dd>Check that the target descriptions dynamically created by <span class="sc">gdb</span>
equal the descriptions created from XML files found in <var>dir</var>.
<p><a name="maint-check-libthread_002ddb"></a><a name="index-maint-check-libthread_002ddb-3356"></a><br><dt><code>maint check libthread-db</code><dd>Run integrity checks on the current inferior's thread debugging
library. This exercises all <code>libthread_db</code> functionality used by
<span class="sc">gdb</span> on GNU/Linux systems, and by extension also exercises the
<code>proc_service</code> functions provided by <span class="sc">gdb</span> that
<code>libthread_db</code> uses. Note that parts of the test may be skipped
on some platforms when debugging core files.
<p><a name="index-maint-print-dummy_002dframes-3357"></a><br><dt><code>maint print dummy-frames</code><dd>Prints the contents of <span class="sc">gdb</span>'s internal dummy-frame stack.
<pre class="smallexample"> (gdb) <kbd>b add</kbd>
...
(gdb) <kbd>print add(2,3)</kbd>
Breakpoint 2, add (a=2, b=3) at ...
58 return (a + b);
The program being debugged stopped while in a function called from GDB.
...
(gdb) <kbd>maint print dummy-frames</kbd>
0xa8206d8: id={stack=0xbfffe734,code=0xbfffe73f,!special}, ptid=process 9353
(gdb)
</pre>
<p>Takes an optional file parameter.
<p><a name="index-maint-print-registers-3358"></a><a name="index-maint-print-raw_002dregisters-3359"></a><a name="index-maint-print-cooked_002dregisters-3360"></a><a name="index-maint-print-register_002dgroups-3361"></a><a name="index-maint-print-remote_002dregisters-3362"></a><br><dt><code>maint print registers </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dt><code>maint print raw-registers </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dt><code>maint print cooked-registers </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dt><code>maint print register-groups </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dt><code>maint print remote-registers </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dd>Print <span class="sc">gdb</span>'s internal register data structures.
<p>The command <code>maint print raw-registers</code> includes the contents of
the raw register cache; the command <code>maint print
cooked-registers</code> includes the (cooked) value of all registers,
including registers which aren't available on the target nor visible
to user; the command <code>maint print register-groups</code> includes the
groups that each register is a member of; and the command <code>maint
print remote-registers</code> includes the remote target's register numbers
and offsets in the `G' packets.
<p>These commands take an optional parameter, a file name to which to
write the information.
<p><a name="index-maint-print-reggroups-3363"></a><br><dt><code>maint print reggroups </code><span class="roman">[</span><var>file</var><span class="roman">]</span><dd>Print <span class="sc">gdb</span>'s internal register group data structures. The
optional argument <var>file</var> tells to what file to write the
information.
<p>The register groups info looks like this:
<pre class="smallexample"> (gdb) <kbd>maint print reggroups</kbd>
Group Type
general user
float user
all user
vector user
system user
save internal
restore internal
</pre>
<p><a name="index-flushregs-3364"></a><br><dt><code>flushregs</code><dd>This command forces <span class="sc">gdb</span> to flush its internal register cache.
<p><a name="index-maint-print-objfiles-3365"></a><a name="index-info-for-known-object-files-3366"></a><br><dt><code>maint print objfiles </code><span class="roman">[</span><var>regexp</var><span class="roman">]</span><dd>Print a dump of all known object files.
If <var>regexp</var> is specified, only print object files whose names
match <var>regexp</var>. For each object file, this command prints its name,
address in memory, and all of its psymtabs and symtabs.
<p><a name="index-maint-print-user_002dregisters-3367"></a><a name="index-user-registers-3368"></a><br><dt><code>maint print user-registers</code><dd>List all currently available <dfn>user registers</dfn>. User registers
typically provide alternate names for actual hardware registers. They
include the four &ldquo;standard&rdquo; registers <code>$fp</code>, <code>$pc</code>,
<code>$sp</code>, and <code>$ps</code>. See <a href="standard-registers.html#standard-registers">standard registers</a>. User
registers can be used in expressions in the same way as the canonical
register names, but only the latter are listed by the <code>info
registers</code> and <code>maint print registers</code> commands.
<p><a name="index-maint-print-section_002dscripts-3369"></a><a name="index-info-for-known-_002edebug_005fgdb_005fscripts_002dloaded-scripts-3370"></a><br><dt><code>maint print section-scripts [</code><var>regexp</var><code>]</code><dd>Print a dump of scripts specified in the <code>.debug_gdb_section</code> section.
If <var>regexp</var> is specified, only print scripts loaded by object files
matching <var>regexp</var>.
For each script, this command prints its name as specified in the objfile,
and the full path if known.
See <a href="dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section">dotdebug_gdb_scripts section</a>.
<p><a name="index-maint-print-statistics-3371"></a><a name="index-bcache-statistics-3372"></a><br><dt><code>maint print statistics</code><dd>This command prints, for each object file in the program, various data
about that object file followed by the byte cache (<dfn>bcache</dfn>)
statistics for the object file. The objfile data includes the number
of minimal, partial, full, and stabs symbols, the number of types
defined by the objfile, the number of as yet unexpanded psym tables,
the number of line tables and string tables, and the amount of memory
used by the various tables. The bcache statistics include the counts,
sizes, and counts of duplicates of all and unique objects, max,
average, and median entry size, total memory used and its overhead and
savings, and various measures of the hash table size and chain
lengths.
<p><a name="index-maint-print-target_002dstack-3373"></a><a name="index-target-stack-description-3374"></a><br><dt><code>maint print target-stack</code><dd>A <dfn>target</dfn> is an interface between the debugger and a particular
kind of file or process. Targets can be stacked in <dfn>strata</dfn>,
so that more than one target can potentially respond to a request.
In particular, memory accesses will walk down the stack of targets
until they find a target that is interested in handling that particular
address.
<p>This command prints a short description of each layer that was pushed on
the <dfn>target stack</dfn>, starting from the top layer down to the bottom one.
<p><a name="index-maint-print-type-3375"></a><a name="index-type-chain-of-a-data-type-3376"></a><br><dt><code>maint print type </code><var>expr</var><dd>Print the type chain for a type specified by <var>expr</var>. The argument
can be either a type name or a symbol. If it is a symbol, the type of
that symbol is described. The type chain produced by this command is
a recursive definition of the data type as stored in <span class="sc">gdb</span>'s
data structures, including its flags and contained types.
<p><a name="index-maint-selftest-3377"></a><a name="index-self-tests-3378"></a><br><dt><code>maint selftest </code><span class="roman">[</span><var>filter</var><span class="roman">]</span><dd>Run any self tests that were compiled in to <span class="sc">gdb</span>. This will
print a message showing how many tests were run, and how many failed.
If a <var>filter</var> is passed, only the tests with <var>filter</var> in their
name will by ran.
<p><a name="index-g_t_0022maint-info-selftests_0022-3379"></a><a name="index-self-tests-3380"></a><br><dt><code>maint info selftests</code><dd>List the selftests compiled in to <span class="sc">gdb</span>.
<p><a name="index-maint-set-dwarf-always_002ddisassemble-3381"></a><a name="index-maint-show-dwarf-always_002ddisassemble-3382"></a><br><dt><code>maint set dwarf always-disassemble</code><br><dt><code>maint show dwarf always-disassemble</code><dd>Control the behavior of <code>info address</code> when using DWARF debugging
information.
<p>The default is <code>off</code>, which means that <span class="sc">gdb</span> should try to
describe a variable's location in an easily readable format. When
<code>on</code>, <span class="sc">gdb</span> will instead display the DWARF location
expression in an assembly-like format. Note that some locations are
too complex for <span class="sc">gdb</span> to describe simply; in this case you will
always see the disassembly form.
<p>Here is an example of the resulting disassembly:
<pre class="smallexample"> (gdb) info addr argc
Symbol "argc" is a complex DWARF expression:
1: DW_OP_fbreg 0
</pre>
<p>For more information on these expressions, see
<a href="http://www.dwarfstd.org/">the DWARF standard</a>.
<p><a name="index-maint-set-dwarf-max_002dcache_002dage-3383"></a><a name="index-maint-show-dwarf-max_002dcache_002dage-3384"></a><br><dt><code>maint set dwarf max-cache-age</code><dt><code>maint show dwarf max-cache-age</code><dd>Control the DWARF compilation unit cache.
<p><a name="index-DWARF-compilation-units-cache-3385"></a>In object files with inter-compilation-unit references, such as those
produced by the GCC option &lsquo;<samp><span class="samp">-feliminate-dwarf2-dups</span></samp>&rsquo;, the DWARF
reader needs to frequently refer to previously read compilation units.
This setting controls how long a compilation unit will remain in the
cache if it is not referenced. A higher limit means that cached
compilation units will be stored in memory longer, and more total
memory will be used. Setting it to zero disables caching, which will
slow down <span class="sc">gdb</span> startup, but reduce memory consumption.
<p><a name="index-maint-set-dwarf-unwinders-3386"></a><a name="index-maint-show-dwarf-unwinders-3387"></a><br><dt><code>maint set dwarf unwinders</code><dt><code>maint show dwarf unwinders</code><dd>Control use of the DWARF frame unwinders.
<p><a name="index-DWARF-frame-unwinders-3388"></a>Many targets that support DWARF debugging use <span class="sc">gdb</span>'s DWARF
frame unwinders to build the backtrace. Many of these targets will
also have a second mechanism for building the backtrace for use in
cases where DWARF information is not available, this second mechanism
is often an analysis of a function's prologue.
<p>In order to extend testing coverage of the second level stack
unwinding mechanisms it is helpful to be able to disable the DWARF
stack unwinders, this can be done with this switch.
<p>In normal use of <span class="sc">gdb</span> disabling the DWARF unwinders is not
advisable, there are cases that are better handled through DWARF than
prologue analysis, and the debug experience is likely to be better
with the DWARF frame unwinders enabled.
<p>If DWARF frame unwinders are not supported for a particular target
architecture, then enabling this flag does not cause them to be used.
<a name="index-maint-set-profile-3389"></a><a name="index-maint-show-profile-3390"></a><a name="index-profiling-GDB-3391"></a><br><dt><code>maint set profile</code><dt><code>maint show profile</code><dd>Control profiling of <span class="sc">gdb</span>.
<p>Profiling will be disabled until you use the &lsquo;<samp><span class="samp">maint set profile</span></samp>&rsquo;
command to enable it. When you enable profiling, the system will begin
collecting timing and execution count data; when you disable profiling or
exit <span class="sc">gdb</span>, the results will be written to a log file. Remember that
if you use profiling, <span class="sc">gdb</span> will overwrite the profiling log file
(often called <samp><span class="file">gmon.out</span></samp>). If you have a record of important profiling
data in a <samp><span class="file">gmon.out</span></samp> file, be sure to move it to a safe location.
<p>Configuring with &lsquo;<samp><span class="samp">--enable-profiling</span></samp>&rsquo; arranges for <span class="sc">gdb</span> to be
compiled with the &lsquo;<samp><span class="samp">-pg</span></samp>&rsquo; compiler option.
<p><a name="index-maint-set-show_002ddebug_002dregs-3392"></a><a name="index-maint-show-show_002ddebug_002dregs-3393"></a><a name="index-hardware-debug-registers-3394"></a><br><dt><code>maint set show-debug-regs</code><dt><code>maint show show-debug-regs</code><dd>Control whether to show variables that mirror the hardware debug
registers. Use <code>on</code> to enable, <code>off</code> to disable. If
enabled, the debug registers values are shown when <span class="sc">gdb</span> inserts or
removes a hardware breakpoint or watchpoint, and when the inferior
triggers a hardware-assisted breakpoint or watchpoint.
<p><a name="index-maint-set-show_002dall_002dtib-3395"></a><a name="index-maint-show-show_002dall_002dtib-3396"></a><br><dt><code>maint set show-all-tib</code><dt><code>maint show show-all-tib</code><dd>Control whether to show all non zero areas within a 1k block starting
at thread local base, when using the &lsquo;<samp><span class="samp">info w32 thread-information-block</span></samp>&rsquo;
command.
<p><a name="index-maint-set-target_002dasync-3397"></a><a name="index-maint-show-target_002dasync-3398"></a><br><dt><code>maint set target-async</code><dt><code>maint show target-async</code><dd>This controls whether <span class="sc">gdb</span> targets operate in synchronous or
asynchronous mode (see <a href="Background-Execution.html#Background-Execution">Background Execution</a>). Normally the
default is asynchronous, if it is available; but this can be changed
to more easily debug problems occurring only in synchronous mode.
<p><a name="index-maint-set-target_002dnon_002dstop-_0040var_007bmode_007d-_005bon_007coff_007cauto_005d-3399"></a><a name="index-maint-show-target_002dnon_002dstop-3400"></a><br><dt><code>maint set target-non-stop</code><dt><code>maint show target-non-stop</code><dd>
This controls whether <span class="sc">gdb</span> targets always operate in non-stop
mode even if <code>set non-stop</code> is <code>off</code> (see <a href="Non_002dStop-Mode.html#Non_002dStop-Mode">Non-Stop Mode</a>). The default is <code>auto</code>, meaning non-stop mode is enabled
if supported by the target.
<dl>
<dt><code>maint set target-non-stop auto</code><dd>This is the default mode. <span class="sc">gdb</span> controls the target in
non-stop mode if the target supports it.
<br><dt><code>maint set target-non-stop on</code><dd><span class="sc">gdb</span> controls the target in non-stop mode even if the target
does not indicate support.
<br><dt><code>maint set target-non-stop off</code><dd><span class="sc">gdb</span> does not control the target in non-stop mode even if the
target supports it.
</dl>
<p><a name="index-maint-set-per_002dcommand-3401"></a><a name="index-maint-show-per_002dcommand-3402"></a><br><dt><code>maint set per-command</code><dt><code>maint show per-command</code><dd><a name="index-resources-used-by-commands-3403"></a>
<span class="sc">gdb</span> can display the resources used by each command.
This is useful in debugging performance problems.
<dl>
<dt><code>maint set per-command space [on|off]</code><dt><code>maint show per-command space</code><dd>Enable or disable the printing of the memory used by GDB for each command.
If enabled, <span class="sc">gdb</span> will display how much memory each command
took, following the command's own output.
This can also be requested by invoking <span class="sc">gdb</span> with the
<samp><span class="option">--statistics</span></samp> command-line switch (see <a href="Mode-Options.html#Mode-Options">Mode Options</a>).
<br><dt><code>maint set per-command time [on|off]</code><dt><code>maint show per-command time</code><dd>Enable or disable the printing of the execution time of <span class="sc">gdb</span>
for each command.
If enabled, <span class="sc">gdb</span> will display how much time it
took to execute each command, following the command's own output.
Both CPU time and wallclock time are printed.
Printing both is useful when trying to determine whether the cost is
CPU or, e.g., disk/network latency.
Note that the CPU time printed is for <span class="sc">gdb</span> only, it does not include
the execution time of the inferior because there's no mechanism currently
to compute how much time was spent by <span class="sc">gdb</span> and how much time was
spent by the program been debugged.
This can also be requested by invoking <span class="sc">gdb</span> with the
<samp><span class="option">--statistics</span></samp> command-line switch (see <a href="Mode-Options.html#Mode-Options">Mode Options</a>).
<br><dt><code>maint set per-command symtab [on|off]</code><dt><code>maint show per-command symtab</code><dd>Enable or disable the printing of basic symbol table statistics
for each command.
If enabled, <span class="sc">gdb</span> will display the following information:
<ol type=a start=1>
<li>number of symbol tables
<li>number of primary symbol tables
<li>number of blocks in the blockvector
</ol>
</dl>
<p><a name="index-maint-set-check_002dlibthread_002ddb-3404"></a><a name="index-maint-show-check_002dlibthread_002ddb-3405"></a><br><dt><code>maint set check-libthread-db [on|off]</code><dt><code>maint show check-libthread-db</code><dd>Control whether <span class="sc">gdb</span> should run integrity checks on inferior
specific thread debugging libraries as they are loaded. The default
is not to perform such checks. If any check fails <span class="sc">gdb</span> will
unload the library and continue searching for a suitable candidate as
described in <a href="set-libthread_002ddb_002dsearch_002dpath.html#set-libthread_002ddb_002dsearch_002dpath">set libthread-db-search-path</a>. For more information
about the tests, see <a href="maint-check-libthread_002ddb.html#maint-check-libthread_002ddb">maint check libthread-db</a>.
<p><a name="index-maint-space-3406"></a><a name="index-memory-used-by-commands-3407"></a><br><dt><code>maint space </code><var>value</var><dd>An alias for <code>maint set per-command space</code>.
A non-zero value enables it, zero disables it.
<p><a name="index-maint-time-3408"></a><a name="index-time-of-command-execution-3409"></a><br><dt><code>maint time </code><var>value</var><dd>An alias for <code>maint set per-command time</code>.
A non-zero value enables it, zero disables it.
<p><a name="index-maint-translate_002daddress-3410"></a><br><dt><code>maint translate-address </code><span class="roman">[</span><var>section</var><span class="roman">]</span> <var>addr</var><dd>Find the symbol stored at the location specified by the address
<var>addr</var> and an optional section name <var>section</var>. If found,
<span class="sc">gdb</span> prints the name of the closest symbol and an offset from
the symbol's location to the specified address. This is similar to
the <code>info address</code> command (see <a href="Symbols.html#Symbols">Symbols</a>), except that this
command also allows to find symbols in other sections.
<p>If section was not specified, the section in which the symbol was found
is also printed. For dynamically linked executables, the name of
executable or shared library containing the symbol is printed as well.
</dl>
<p>The following command is useful for non-interactive invocations of
<span class="sc">gdb</span>, such as in the test suite.
<dl>
<dt><code>set watchdog </code><var>nsec</var><dd><a name="index-set-watchdog-3411"></a><a name="index-watchdog-timer-3412"></a><a name="index-timeout-for-commands-3413"></a>Set the maximum number of seconds <span class="sc">gdb</span> will wait for the
target operation to finish. If this time expires, <span class="sc">gdb</span>
reports and error and the command is aborted.
<br><dt><code>show watchdog</code><dd>Show the current setting of the target wait timeout.
</dl>
</body></html>