blob: 7ed113913cc6aac3403b09a480be5fb636579277 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2015 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 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Debugging with GDB: MIPS Embedded</title>
<meta name="description" content="Debugging with GDB: MIPS Embedded">
<meta name="keywords" content="Debugging with GDB: MIPS Embedded">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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="Embedded-Processors.html#Embedded-Processors" rel="up" title="Embedded Processors">
<link href="PowerPC-Embedded.html#PowerPC-Embedded" rel="next" title="PowerPC Embedded">
<link href="MicroBlaze.html#MicroBlaze" rel="prev" title="MicroBlaze">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
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.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="MIPS-Embedded"></a>
<div class="header">
<p>
Next: <a href="PowerPC-Embedded.html#PowerPC-Embedded" accesskey="n" rel="next">PowerPC Embedded</a>, Previous: <a href="MicroBlaze.html#MicroBlaze" accesskey="p" rel="prev">MicroBlaze</a>, Up: <a href="Embedded-Processors.html#Embedded-Processors" accesskey="u" rel="up">Embedded Processors</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>
</div>
<hr>
<a name="MIPS-Embedded-1"></a>
<h4 class="subsection">21.3.5 <acronym>MIPS</acronym> Embedded</h4>
<a name="index-MIPS-boards"></a>
<p><small>GDB</small> can use the <acronym>MIPS</acronym> remote debugging protocol to talk to a
<acronym>MIPS</acronym> board attached to a serial line. This is available when
you configure <small>GDB</small> with &lsquo;<samp>--target=mips-elf</samp>&rsquo;.
</p>
<p>Use these <small>GDB</small> commands to specify the connection to your target board:
</p>
<dl compact="compact">
<dt><code>target mips <var>port</var></code></dt>
<dd><a name="index-target-mips-port"></a>
<p>To run a program on the board, start up <code>gdb</code> with the
name of your program as the argument. To connect to the board, use the
command &lsquo;<samp>target mips <var>port</var></samp>&rsquo;, where <var>port</var> is the name of
the serial port connected to the board. If the program has not already
been downloaded to the board, you may use the <code>load</code> command to
download it. You can then use all the usual <small>GDB</small> commands.
</p>
<p>For example, this sequence connects to the target board through a serial
port, and loads and runs a program called <var>prog</var> through the
debugger:
</p>
<div class="smallexample">
<pre class="smallexample">host$ gdb <var>prog</var>
GDB is free software and &hellip;
(gdb) target mips /dev/ttyb
(gdb) load <var>prog</var>
(gdb) run
</pre></div>
</dd>
<dt><code>target mips <var>hostname</var>:<var>portnumber</var></code></dt>
<dd><p>On some <small>GDB</small> host configurations, you can specify a TCP
connection (for instance, to a serial line managed by a terminal
concentrator) instead of a serial port, using the syntax
&lsquo;<samp><var>hostname</var>:<var>portnumber</var></samp>&rsquo;.
</p>
</dd>
<dt><code>target pmon <var>port</var></code></dt>
<dd><a name="index-target-pmon-port"></a>
<p>PMON ROM monitor.
</p>
</dd>
<dt><code>target ddb <var>port</var></code></dt>
<dd><a name="index-target-ddb-port"></a>
<p>NEC&rsquo;s DDB variant of PMON for Vr4300.
</p>
</dd>
<dt><code>target lsi <var>port</var></code></dt>
<dd><a name="index-target-lsi-port"></a>
<p>LSI variant of PMON.
</p>
<a name="index-target-r3900"></a>
</dd>
<dt><code>target r3900 <var>dev</var></code></dt>
<dd><p>Densan DVE-R3900 ROM monitor for Toshiba R3900 Mips.
</p>
<a name="index-target-array"></a>
</dd>
<dt><code>target array <var>dev</var></code></dt>
<dd><p>Array Tech LSI33K RAID controller board.
</p>
</dd>
</dl>
<p><small>GDB</small> also supports these special commands for <acronym>MIPS</acronym> targets:
</p>
<dl compact="compact">
<dt><code>set mipsfpu double</code></dt>
<dt><code>set mipsfpu single</code></dt>
<dt><code>set mipsfpu none</code></dt>
<dt><code>set mipsfpu auto</code></dt>
<dt><code>show mipsfpu</code></dt>
<dd><a name="index-set-mipsfpu"></a>
<a name="index-show-mipsfpu"></a>
<a name="index-MIPS-remote-floating-point"></a>
<a name="index-floating-point_002c-MIPS-remote"></a>
<p>If your target board does not support the <acronym>MIPS</acronym> floating point
coprocessor, you should use the command &lsquo;<samp>set mipsfpu none</samp>&rsquo; (if you
need this, you may wish to put the command in your <small>GDB</small> init
file). This tells <small>GDB</small> how to find the return value of
functions which return floating point values. It also allows
<small>GDB</small> to avoid saving the floating point registers when calling
functions on the board. If you are using a floating point coprocessor
with only single precision floating point support, as on the <small>R4650</small>
processor, use the command &lsquo;<samp>set mipsfpu single</samp>&rsquo;. The default
double precision floating point coprocessor may be selected using
&lsquo;<samp>set mipsfpu double</samp>&rsquo;.
</p>
<p>In previous versions the only choices were double precision or no
floating point, so &lsquo;<samp>set mipsfpu on</samp>&rsquo; will select double precision
and &lsquo;<samp>set mipsfpu off</samp>&rsquo; will select no floating point.
</p>
<p>As usual, you can inquire about the <code>mipsfpu</code> variable with
&lsquo;<samp>show mipsfpu</samp>&rsquo;.
</p>
</dd>
<dt><code>set timeout <var>seconds</var></code></dt>
<dt><code>set retransmit-timeout <var>seconds</var></code></dt>
<dt><code>show timeout</code></dt>
<dt><code>show retransmit-timeout</code></dt>
<dd><a name="index-timeout_002c-MIPS-protocol"></a>
<a name="index-retransmit_002dtimeout_002c-MIPS-protocol"></a>
<a name="index-set-timeout"></a>
<a name="index-show-timeout"></a>
<a name="index-set-retransmit_002dtimeout"></a>
<a name="index-show-retransmit_002dtimeout"></a>
<p>You can control the timeout used while waiting for a packet, in the <acronym>MIPS</acronym>
remote protocol, with the <code>set timeout <var>seconds</var></code> command. The
default is 5 seconds. Similarly, you can control the timeout used while
waiting for an acknowledgment of a packet with the <code>set
retransmit-timeout <var>seconds</var></code> command. The default is 3 seconds.
You can inspect both values with <code>show timeout</code> and <code>show
retransmit-timeout</code>. (These commands are <em>only</em> available when
<small>GDB</small> is configured for &lsquo;<samp>--target=mips-elf</samp>&rsquo;.)
</p>
<p>The timeout set by <code>set timeout</code> does not apply when <small>GDB</small>
is waiting for your program to stop. In that case, <small>GDB</small> waits
forever because it has no way of knowing how long the program is going
to run before stopping.
</p>
</dd>
<dt><code>set syn-garbage-limit <var>num</var></code></dt>
<dd><a name="index-set-syn_002dgarbage_002dlimit_002c-MIPS-remote"></a>
<a name="index-synchronize-with-remote-MIPS-target"></a>
<p>Limit the maximum number of characters <small>GDB</small> should ignore when
it tries to synchronize with the remote target. The default is 10
characters. Setting the limit to -1 means there&rsquo;s no limit.
</p>
</dd>
<dt><code>show syn-garbage-limit</code></dt>
<dd><a name="index-show-syn_002dgarbage_002dlimit_002c-MIPS-remote"></a>
<p>Show the current limit on the number of characters to ignore when
trying to synchronize with the remote system.
</p>
</dd>
<dt><code>set monitor-prompt <var>prompt</var></code></dt>
<dd><a name="index-set-monitor_002dprompt_002c-MIPS-remote"></a>
<a name="index-remote-monitor-prompt"></a>
<p>Tell <small>GDB</small> to expect the specified <var>prompt</var> string from the
remote monitor. The default depends on the target:
</p><dl compact="compact">
<dt>pmon target</dt>
<dd><p>&lsquo;<samp>PMON</samp>&rsquo;
</p></dd>
<dt>ddb target</dt>
<dd><p>&lsquo;<samp>NEC010</samp>&rsquo;
</p></dd>
<dt>lsi target</dt>
<dd><p>&lsquo;<samp>PMON&gt;</samp>&rsquo;
</p></dd>
</dl>
</dd>
<dt><code>show monitor-prompt</code></dt>
<dd><a name="index-show-monitor_002dprompt_002c-MIPS-remote"></a>
<p>Show the current strings <small>GDB</small> expects as the prompt from the
remote monitor.
</p>
</dd>
<dt><code>set monitor-warnings</code></dt>
<dd><a name="index-set-monitor_002dwarnings_002c-MIPS-remote"></a>
<p>Enable or disable monitor warnings about hardware breakpoints. This
has effect only for the <code>lsi</code> target. When on, <small>GDB</small> will
display warning messages whose codes are returned by the <code>lsi</code>
PMON monitor for breakpoint commands.
</p>
</dd>
<dt><code>show monitor-warnings</code></dt>
<dd><a name="index-show-monitor_002dwarnings_002c-MIPS-remote"></a>
<p>Show the current setting of printing monitor warnings.
</p>
</dd>
<dt><code>pmon <var>command</var></code></dt>
<dd><a name="index-pmon_002c-MIPS-remote"></a>
<a name="index-send-PMON-command"></a>
<p>This command allows sending an arbitrary <var>command</var> string to the
monitor. The monitor must be in debug mode for this to work.
</p></dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="PowerPC-Embedded.html#PowerPC-Embedded" accesskey="n" rel="next">PowerPC Embedded</a>, Previous: <a href="MicroBlaze.html#MicroBlaze" accesskey="p" rel="prev">MicroBlaze</a>, Up: <a href="Embedded-Processors.html#Embedded-Processors" accesskey="u" rel="up">Embedded Processors</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>
</div>
</body>
</html>