3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"GDB%2fMI%20Simple%20Examples">GDB/MI Simple Examples
</a>,
13 Previous:
<a rel=
"previous" accesskey=
"p" href=
"GDB-MI-Output-Syntax.html#GDB%2fMI%20Output%20Syntax">GDB/MI Output Syntax
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"GDB-MI-Command-Syntax.html#GDB%2fMI%20Command%20Syntax">GDB/MI Command Syntax
</a>
18 <h4 class=
"subsection">Simple Examples of
<small>GDB/MI
</small> Interaction
</h4>
20 <p>This subsection presents several simple examples of interaction using
21 the
<small>GDB/MI
</small> interface. In these examples,
<code>-
></code> means that the
22 following line is passed to
<small>GDB/MI
</small> as input, while
<code><-
</code> means
23 the output received from
<small>GDB/MI
</small>.
25 <h5 class=
"subsubheading">Target Stop
</h5>
27 <p>Here's an example of stopping the inferior process:
29 <pre class=
"example"> -
> -stop
35 <pre class=
"example"> <- *stop,
reason=
"stop",
address=
"0x123",
source=
"a.c:123"
39 <h5 class=
"subsubheading">Simple CLI Command
</h5>
41 <p>Here's an example of a simple CLI command being passed through
42 <small>GDB/MI
</small> and on to the CLI.
44 <pre class=
"example"> -
> print
1+
2
49 <h5 class=
"subsubheading">Command With Side Effects
</h5>
51 <pre class=
"example"> -
> -symbol-file xyz.exe
52 <- *breakpoint,
nr=
"3",
address=
"0x123",
source=
"a.c:123"
56 <h5 class=
"subsubheading">A Bad Command
</h5>
58 <p>Here's what happens if you pass a non-existent command:
60 <pre class=
"example"> -
> -rubbish
61 <- error,
"Rubbish not found"