|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <!-- Copyright (C) 1988-2020 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." -->
- <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>GDB/MI Miscellaneous Commands (Debugging with GDB)</title>
-
- <meta name="description" content="GDB/MI Miscellaneous Commands (Debugging with GDB)">
- <meta name="keywords" content="GDB/MI Miscellaneous Commands (Debugging with GDB)">
- <meta name="resource-type" content="document">
- <meta name="distribution" content="global">
- <meta name="Generator" content="makeinfo">
- <link href="index.html#Top" rel="start" title="Top">
- <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
- <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
- <link href="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
- <link href="Annotations.html#Annotations" rel="next" title="Annotations">
- <link href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" rel="prev" title="GDB/MI Support Commands">
- <style type="text/css">
- <!--
- a.summary-letter {text-decoration: none}
- blockquote.indentedblock {margin-right: 0em}
- blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
- blockquote.smallquotation {font-size: smaller}
- div.display {margin-left: 3.2em}
- div.example {margin-left: 3.2em}
- div.lisp {margin-left: 3.2em}
- div.smalldisplay {margin-left: 3.2em}
- div.smallexample {margin-left: 3.2em}
- div.smalllisp {margin-left: 3.2em}
- kbd {font-style: oblique}
- pre.display {font-family: inherit}
- pre.format {font-family: inherit}
- pre.menu-comment {font-family: serif}
- pre.menu-preformatted {font-family: serif}
- pre.smalldisplay {font-family: inherit; font-size: smaller}
- pre.smallexample {font-size: smaller}
- pre.smallformat {font-family: inherit; font-size: smaller}
- pre.smalllisp {font-size: smaller}
- span.nolinebreak {white-space: nowrap}
- span.roman {font-family: initial; font-weight: normal}
- span.sansserif {font-family: sans-serif; font-weight: normal}
- ul.no-bullet {list-style: none}
- -->
- </style>
-
-
- </head>
-
- <body lang="en">
- <a name="GDB_002fMI-Miscellaneous-Commands"></a>
- <div class="header">
- <p>
- Previous: <a href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" accesskey="p" rel="prev">GDB/MI Support Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> [<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>
- </div>
- <hr>
- <a name="Miscellaneous-GDB_002fMI-Commands"></a>
- <h3 class="section">27.24 Miscellaneous <small>GDB/MI</small> Commands</h3>
-
-
- <a name="The-_002dgdb_002dexit-Command"></a>
- <h4 class="subheading">The <code>-gdb-exit</code> Command</h4>
- <a name="index-_002dgdb_002dexit"></a>
-
- <a name="Synopsis-104"></a>
- <h4 class="subsubheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample"> -gdb-exit
- </pre></div>
-
- <p>Exit <small>GDB</small> immediately.
- </p>
- <a name="GDB-Command-86"></a>
- <h4 class="subsubheading"><small>GDB</small> Command</h4>
-
- <p>Approximately corresponds to ‘<samp>quit</samp>’.
- </p>
- <a name="Example-86"></a>
- <h4 class="subsubheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -gdb-exit
- ^exit
- </pre></div>
-
-
-
-
- <a name="The-_002dgdb_002dset-Command"></a>
- <h4 class="subheading">The <code>-gdb-set</code> Command</h4>
- <a name="index-_002dgdb_002dset"></a>
-
- <a name="Synopsis-105"></a>
- <h4 class="subsubheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample"> -gdb-set
- </pre></div>
-
- <p>Set an internal <small>GDB</small> variable.
- </p>
- <a name="GDB-Command-87"></a>
- <h4 class="subsubheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>set</samp>’.
- </p>
- <a name="Example-87"></a>
- <h4 class="subsubheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -gdb-set $foo=3
- ^done
- (gdb)
- </pre></div>
-
-
- <a name="The-_002dgdb_002dshow-Command"></a>
- <h4 class="subheading">The <code>-gdb-show</code> Command</h4>
- <a name="index-_002dgdb_002dshow"></a>
-
- <a name="Synopsis-106"></a>
- <h4 class="subsubheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample"> -gdb-show
- </pre></div>
-
- <p>Show the current value of a <small>GDB</small> variable.
- </p>
- <a name="GDB-Command-88"></a>
- <h4 class="subsubheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>show</samp>’.
- </p>
- <a name="Example-88"></a>
- <h4 class="subsubheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -gdb-show annotate
- ^done,value="0"
- (gdb)
- </pre></div>
-
-
-
- <a name="The-_002dgdb_002dversion-Command"></a>
- <h4 class="subheading">The <code>-gdb-version</code> Command</h4>
- <a name="index-_002dgdb_002dversion"></a>
-
- <a name="Synopsis-107"></a>
- <h4 class="subsubheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample"> -gdb-version
- </pre></div>
-
- <p>Show version information for <small>GDB</small>. Used mostly in testing.
- </p>
- <a name="GDB-Command-89"></a>
- <h4 class="subsubheading"><small>GDB</small> Command</h4>
-
- <p>The <small>GDB</small> equivalent is ‘<samp>show version</samp>’. <small>GDB</small> by
- default shows this information when you start an interactive session.
- </p>
- <a name="Example-89"></a>
- <h4 class="subsubheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -gdb-version
- ~GNU gdb 5.2.1
- ~Copyright 2000 Free Software Foundation, Inc.
- ~GDB is free software, covered by the GNU General Public License, and
- ~you are welcome to change it and/or distribute copies of it under
- ~ certain conditions.
- ~Type "show copying" to see the conditions.
- ~There is absolutely no warranty for GDB. Type "show warranty" for
- ~ details.
- ~This GDB was configured as
- "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
- ^done
- (gdb)
- </pre></div>
-
- <a name="The-_002dlist_002dthread_002dgroups-Command"></a>
- <h4 class="subheading">The <code>-list-thread-groups</code> Command</h4>
- <a name="index-_002dlist_002dthread_002dgroups"></a>
-
- <a name="Synopsis-108"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-list-thread-groups [ --available ] [ --recurse 1 ] [ <var>group</var> ... ]
- </pre></div>
-
- <p>Lists thread groups (see <a href="Thread-groups.html#Thread-groups">Thread groups</a>). When a single thread
- group is passed as the argument, lists the children of that group.
- When several thread group are passed, lists information about those
- thread groups. Without any parameters, lists information about all
- top-level thread groups.
- </p>
- <p>Normally, thread groups that are being debugged are reported.
- With the ‘<samp>--available</samp>’ option, <small>GDB</small> reports thread groups
- available on the target.
- </p>
- <p>The output of this command may have either a ‘<samp>threads</samp>’ result or
- a ‘<samp>groups</samp>’ result. The ‘<samp>thread</samp>’ result has a list of tuples
- as value, with each tuple describing a thread (see <a href="GDB_002fMI-Thread-Information.html#GDB_002fMI-Thread-Information">GDB/MI Thread Information</a>). The ‘<samp>groups</samp>’ result has a list of tuples as value,
- each tuple describing a thread group. If top-level groups are
- requested (that is, no parameter is passed), or when several groups
- are passed, the output always has a ‘<samp>groups</samp>’ result. The format
- of the ‘<samp>group</samp>’ result is described below.
- </p>
- <p>To reduce the number of roundtrips it’s possible to list thread groups
- together with their children, by passing the ‘<samp>--recurse</samp>’ option
- and the recursion depth. Presently, only recursion depth of 1 is
- permitted. If this option is present, then every reported thread group
- will also include its children, either as ‘<samp>group</samp>’ or
- ‘<samp>threads</samp>’ field.
- </p>
- <p>In general, any combination of option and parameters is permitted, with
- the following caveats:
- </p>
- <ul>
- <li> When a single thread group is passed, the output will typically
- be the ‘<samp>threads</samp>’ result. Because threads may not contain
- anything, the ‘<samp>recurse</samp>’ option will be ignored.
-
- </li><li> When the ‘<samp>--available</samp>’ option is passed, limited information may
- be available. In particular, the list of threads of a process might
- be inaccessible. Further, specifying specific thread groups might
- not give any performance advantage over listing all thread groups.
- The frontend should assume that ‘<samp>-list-thread-groups --available</samp>’
- is always an expensive operation and cache the results.
-
- </li></ul>
-
- <p>The ‘<samp>groups</samp>’ result is a list of tuples, where each tuple may
- have the following fields:
- </p>
- <dl compact="compact">
- <dt><code>id</code></dt>
- <dd><p>Identifier of the thread group. This field is always present.
- The identifier is an opaque string; frontends should not try to
- convert it to an integer, even though it might look like one.
- </p>
- </dd>
- <dt><code>type</code></dt>
- <dd><p>The type of the thread group. At present, only ‘<samp>process</samp>’ is a
- valid type.
- </p>
- </dd>
- <dt><code>pid</code></dt>
- <dd><p>The target-specific process identifier. This field is only present
- for thread groups of type ‘<samp>process</samp>’ and only if the process exists.
- </p>
- </dd>
- <dt><code>exit-code</code></dt>
- <dd><p>The exit code of this group’s last exited thread, formatted in octal.
- This field is only present for thread groups of type ‘<samp>process</samp>’ and
- only if the process is not running.
- </p>
- </dd>
- <dt><code>num_children</code></dt>
- <dd><p>The number of children this thread group has. This field may be
- absent for an available thread group.
- </p>
- </dd>
- <dt><code>threads</code></dt>
- <dd><p>This field has a list of tuples as value, each tuple describing a
- thread. It may be present if the ‘<samp>--recurse</samp>’ option is
- specified, and it’s actually possible to obtain the threads.
- </p>
- </dd>
- <dt><code>cores</code></dt>
- <dd><p>This field is a list of integers, each identifying a core that one
- thread of the group is running on. This field may be absent if
- such information is not available.
- </p>
- </dd>
- <dt><code>executable</code></dt>
- <dd><p>The name of the executable file that corresponds to this thread group.
- The field is only present for thread groups of type ‘<samp>process</samp>’,
- and only if there is a corresponding executable file.
- </p>
- </dd>
- </dl>
-
- <a name="Example-90"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">gdb
- -list-thread-groups
- ^done,groups=[{id="17",type="process",pid="yyy",num_children="2"}]
- -list-thread-groups 17
- ^done,threads=[{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",
- frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",args=[]},state="running"},
- {id="1",target-id="Thread 0xb7e156b0 (LWP 21254)",
- frame={level="0",addr="0x0804891f",func="foo",args=[{name="i",value="10"}],
- file="/tmp/a.c",fullname="/tmp/a.c",line="158",arch="i386:x86_64"},state="running"}]]
- -list-thread-groups --available
- ^done,groups=[{id="17",type="process",pid="yyy",num_children="2",cores=[1,2]}]
- -list-thread-groups --available --recurse 1
- ^done,groups=[{id="17", types="process",pid="yyy",num_children="2",cores=[1,2],
- threads=[{id="1",target-id="Thread 0xb7e14b90",cores=[1]},
- {id="2",target-id="Thread 0xb7e14b90",cores=[2]}]},..]
- -list-thread-groups --available --recurse 1 17 18
- ^done,groups=[{id="17", types="process",pid="yyy",num_children="2",cores=[1,2],
- threads=[{id="1",target-id="Thread 0xb7e14b90",cores=[1]},
- {id="2",target-id="Thread 0xb7e14b90",cores=[2]}]},...]
- </pre></div>
-
- <a name="The-_002dinfo_002dos-Command"></a>
- <h4 class="subheading">The <code>-info-os</code> Command</h4>
- <a name="index-_002dinfo_002dos"></a>
-
- <a name="Synopsis-109"></a>
- <h4 class="subsubheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-info-os [ <var>type</var> ]
- </pre></div>
-
- <p>If no argument is supplied, the command returns a table of available
- operating-system-specific information types. If one of these types is
- supplied as an argument <var>type</var>, then the command returns a table
- of data of that type.
- </p>
- <p>The types of information available depend on the target operating
- system.
- </p>
- <a name="GDB-Command-90"></a>
- <h4 class="subsubheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>info os</samp>’.
- </p>
- <a name="Example-91"></a>
- <h4 class="subsubheading">Example</h4>
-
- <p>When run on a <small>GNU</small>/Linux system, the output will look something
- like this:
- </p>
- <div class="smallexample">
- <pre class="smallexample">gdb
- -info-os
- ^done,OSDataTable={nr_rows="10",nr_cols="3",
- hdr=[{width="10",alignment="-1",col_name="col0",colhdr="Type"},
- {width="10",alignment="-1",col_name="col1",colhdr="Description"},
- {width="10",alignment="-1",col_name="col2",colhdr="Title"}],
- body=[item={col0="cpus",col1="Listing of all cpus/cores on the system",
- col2="CPUs"},
- item={col0="files",col1="Listing of all file descriptors",
- col2="File descriptors"},
- item={col0="modules",col1="Listing of all loaded kernel modules",
- col2="Kernel modules"},
- item={col0="msg",col1="Listing of all message queues",
- col2="Message queues"},
- item={col0="processes",col1="Listing of all processes",
- col2="Processes"},
- item={col0="procgroups",col1="Listing of all process groups",
- col2="Process groups"},
- item={col0="semaphores",col1="Listing of all semaphores",
- col2="Semaphores"},
- item={col0="shm",col1="Listing of all shared-memory regions",
- col2="Shared-memory regions"},
- item={col0="sockets",col1="Listing of all internet-domain sockets",
- col2="Sockets"},
- item={col0="threads",col1="Listing of all threads",
- col2="Threads"}]
- gdb
- -info-os processes
- ^done,OSDataTable={nr_rows="190",nr_cols="4",
- hdr=[{width="10",alignment="-1",col_name="col0",colhdr="pid"},
- {width="10",alignment="-1",col_name="col1",colhdr="user"},
- {width="10",alignment="-1",col_name="col2",colhdr="command"},
- {width="10",alignment="-1",col_name="col3",colhdr="cores"}],
- body=[item={col0="1",col1="root",col2="/sbin/init",col3="0"},
- item={col0="2",col1="root",col2="[kthreadd]",col3="1"},
- item={col0="3",col1="root",col2="[ksoftirqd/0]",col3="0"},
- ...
- item={col0="26446",col1="stan",col2="bash",col3="0"},
- item={col0="28152",col1="stan",col2="bash",col3="1"}]}
- (gdb)
- </pre></div>
-
- <p>(Note that the MI output here includes a <code>"Title"</code> column that
- does not appear in command-line <code>info os</code>; this column is useful
- for MI clients that want to enumerate the types of data, such as in a
- popup menu, but is needless clutter on the command line, and
- <code>info os</code> omits it.)
- </p>
- <a name="The-_002dadd_002dinferior-Command"></a>
- <h4 class="subheading">The <code>-add-inferior</code> Command</h4>
- <a name="index-_002dadd_002dinferior"></a>
-
- <a name="Synopsis-110"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-add-inferior
- </pre></div>
-
- <p>Creates a new inferior (see <a href="Inferiors-Connections-and-Programs.html#Inferiors-Connections-and-Programs">Inferiors Connections and Programs</a>). The created
- inferior is not associated with any executable. Such association may
- be established with the ‘<samp>-file-exec-and-symbols</samp>’ command
- (see <a href="GDB_002fMI-File-Commands.html#GDB_002fMI-File-Commands">GDB/MI File Commands</a>). The command response has a single
- field, ‘<samp>inferior</samp>’, whose value is the identifier of the
- thread group corresponding to the new inferior.
- </p>
- <a name="Example-92"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">gdb
- -add-inferior
- ^done,inferior="i3"
- </pre></div>
-
- <a name="The-_002dinterpreter_002dexec-Command"></a>
- <h4 class="subheading">The <code>-interpreter-exec</code> Command</h4>
- <a name="index-_002dinterpreter_002dexec"></a>
-
- <a name="Synopsis-111"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-interpreter-exec <var>interpreter</var> <var>command</var>
- </pre></div>
- <a name="g_t_002dinterpreter_002dexec"></a>
- <p>Execute the specified <var>command</var> in the given <var>interpreter</var>.
- </p>
- <a name="GDB-Command-91"></a>
- <h4 class="subheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>interpreter-exec</samp>’.
- </p>
- <a name="Example-93"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -interpreter-exec console "break main"
- &"During symbol reading, couldn't parse type; debugger out of date?.\n"
- &"During symbol reading, bad structure-type format.\n"
- ~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n"
- ^done
- (gdb)
- </pre></div>
-
- <a name="The-_002dinferior_002dtty_002dset-Command"></a>
- <h4 class="subheading">The <code>-inferior-tty-set</code> Command</h4>
- <a name="index-_002dinferior_002dtty_002dset"></a>
-
- <a name="Synopsis-112"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-inferior-tty-set /dev/pts/1
- </pre></div>
-
- <p>Set terminal for future runs of the program being debugged.
- </p>
- <a name="GDB-Command-92"></a>
- <h4 class="subheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>set inferior-tty</samp>’ /dev/pts/1.
- </p>
- <a name="Example-94"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -inferior-tty-set /dev/pts/1
- ^done
- (gdb)
- </pre></div>
-
- <a name="The-_002dinferior_002dtty_002dshow-Command"></a>
- <h4 class="subheading">The <code>-inferior-tty-show</code> Command</h4>
- <a name="index-_002dinferior_002dtty_002dshow"></a>
-
- <a name="Synopsis-113"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-inferior-tty-show
- </pre></div>
-
- <p>Show terminal for future runs of program being debugged.
- </p>
- <a name="GDB-Command-93"></a>
- <h4 class="subheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>show inferior-tty</samp>’.
- </p>
- <a name="Example-95"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -inferior-tty-set /dev/pts/1
- ^done
- (gdb)
- -inferior-tty-show
- ^done,inferior_tty_terminal="/dev/pts/1"
- (gdb)
- </pre></div>
-
- <a name="The-_002denable_002dtimings-Command"></a>
- <h4 class="subheading">The <code>-enable-timings</code> Command</h4>
- <a name="index-_002denable_002dtimings"></a>
-
- <a name="Synopsis-114"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-enable-timings [yes | no]
- </pre></div>
-
- <p>Toggle the printing of the wallclock, user and system times for an MI
- command as a field in its output. This command is to help frontend
- developers optimize the performance of their code. No argument is
- equivalent to ‘<samp>yes</samp>’.
- </p>
- <a name="GDB-Command-94"></a>
- <h4 class="subheading"><small>GDB</small> Command</h4>
-
- <p>No equivalent.
- </p>
- <a name="Example-96"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -enable-timings
- ^done
- (gdb)
- -break-insert main
- ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
- addr="0x080484ed",func="main",file="myprog.c",
- fullname="/home/nickrob/myprog.c",line="73",thread-groups=["i1"],
- times="0"},
- time={wallclock="0.05185",user="0.00800",system="0.00000"}
- (gdb)
- -enable-timings no
- ^done
- (gdb)
- -exec-run
- ^running
- (gdb)
- *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="0",
- frame={addr="0x080484ed",func="main",args=[{name="argc",value="1"},
- {name="argv",value="0xbfb60364"}],file="myprog.c",
- fullname="/home/nickrob/myprog.c",line="73",arch="i386:x86_64"}
- (gdb)
- </pre></div>
-
- <a name="The-_002dcomplete-Command"></a>
- <h4 class="subheading">The <code>-complete</code> Command</h4>
- <a name="index-_002dcomplete"></a>
-
- <a name="Synopsis-115"></a>
- <h4 class="subheading">Synopsis</h4>
-
- <div class="smallexample">
- <pre class="smallexample">-complete <var>command</var>
- </pre></div>
-
- <p>Show a list of completions for partially typed CLI <var>command</var>.
- </p>
- <p>This command is intended for <small>GDB/MI</small> frontends that cannot use two separate
- CLI and MI channels — for example: because of lack of PTYs like on Windows or
- because <small>GDB</small> is used remotely via a SSH connection.
- </p>
- <a name="Result-9"></a>
- <h4 class="subheading">Result</h4>
-
- <p>The result consists of two or three fields:
- </p>
- <dl compact="compact">
- <dt>‘<samp>completion</samp>’</dt>
- <dd><p>This field contains the completed <var>command</var>. If <var>command</var>
- has no known completions, this field is omitted.
- </p>
- </dd>
- <dt>‘<samp>matches</samp>’</dt>
- <dd><p>This field contains a (possibly empty) array of matches. It is always present.
- </p>
- </dd>
- <dt>‘<samp>max_completions_reached</samp>’</dt>
- <dd><p>This field contains <code>1</code> if number of known completions is above
- <code>max-completions</code> limit (see <a href="Completion.html#Completion">Completion</a>), otherwise it contains
- <code>0</code>. It is always present.
- </p>
- </dd>
- </dl>
-
- <a name="GDB-Command-95"></a>
- <h4 class="subheading"><small>GDB</small> Command</h4>
-
- <p>The corresponding <small>GDB</small> command is ‘<samp>complete</samp>’.
- </p>
- <a name="Example-97"></a>
- <h4 class="subheading">Example</h4>
-
- <div class="smallexample">
- <pre class="smallexample">(gdb)
- -complete br
- ^done,completion="break",
- matches=["break","break-range"],
- max_completions_reached="0"
- (gdb)
- -complete "b ma"
- ^done,completion="b ma",
- matches=["b madvise","b main"],max_completions_reached="0"
- (gdb)
- -complete "b push_b"
- ^done,completion="b push_back(",
- matches=[
- "b A::push_back(void*)",
- "b std::string::push_back(char)",
- "b std::vector<int, std::allocator<int> >::push_back(int&&)"],
- max_completions_reached="0"
- (gdb)
- -complete "nonexist"
- ^done,matches=[],max_completions_reached="0"
- (gdb)
-
- </pre></div>
-
- <hr>
- <div class="header">
- <p>
- Previous: <a href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" accesskey="p" rel="prev">GDB/MI Support Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> [<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>
- </div>
-
-
-
- </body>
- </html>
|