1<html lang="en"> 2<head> 3<title>MIPS - 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.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Architectures.html#Architectures" title="Architectures"> 9<link rel="prev" href="Alpha.html#Alpha" title="Alpha"> 10<link rel="next" href="HPPA.html#HPPA" title="HPPA"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 141998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 15Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation; with the 20Invariant Sections being ``Free Software'' and ``Free Software Needs 21Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 22and with the Back-Cover Texts as in (a) below. 23 24(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 25this GNU Manual. Buying copies from GNU Press supports the FSF in 26developing GNU and promoting software freedom.''--> 27<meta http-equiv="Content-Style-Type" content="text/css"> 28<style type="text/css"><!-- 29 pre.display { font-family:inherit } 30 pre.format { font-family:inherit } 31 pre.smalldisplay { font-family:inherit; font-size:smaller } 32 pre.smallformat { font-family:inherit; font-size:smaller } 33 pre.smallexample { font-size:smaller } 34 pre.smalllisp { font-size:smaller } 35 span.sc { font-variant:small-caps } 36 span.roman { font-family:serif; font-weight:normal; } 37 span.sansserif { font-family:sans-serif; font-weight:normal; } 38--></style> 39<link rel="stylesheet" type="text/css" href="../cs.css"> 40</head> 41<body> 42<div class="node"> 43<a name="MIPS"></a> 44<p> 45Next: <a rel="next" accesskey="n" href="HPPA.html#HPPA">HPPA</a>, 46Previous: <a rel="previous" accesskey="p" href="Alpha.html#Alpha">Alpha</a>, 47Up: <a rel="up" accesskey="u" href="Architectures.html#Architectures">Architectures</a> 48<hr> 49</div> 50 51<h4 class="subsection">21.4.4 MIPS</h4> 52 53<p><a name="index-stack-on-Alpha-1401"></a><a name="index-stack-on-MIPS-1402"></a><a name="index-Alpha-stack-1403"></a><a name="index-MIPS-stack-1404"></a>Alpha- and MIPS-based computers use an unusual stack frame, which 54sometimes requires <span class="sc">gdb</span> to search backward in the object code to 55find the beginning of a function. 56 57 <p><a name="index-response-time_002c-MIPS-debugging-1405"></a>To improve response time (especially for embedded applications, where 58<span class="sc">gdb</span> may be restricted to a slow serial line for this search) 59you may want to limit the size of this search, using one of these 60commands: 61 62 63<a name="index-g_t_0040code_007bheuristic_002dfence_002dpost_007d-_0028Alpha_002c-MIPS_0029-1406"></a> 64<dl><dt><code>set heuristic-fence-post </code><var>limit</var><dd>Restrict <span class="sc">gdb</span> to examining at most <var>limit</var> bytes in its 65search for the beginning of a function. A value of <var>0</var> (the 66default) means there is no limit. However, except for <var>0</var>, the 67larger the limit the more bytes <code>heuristic-fence-post</code> must search 68and therefore the longer it takes to run. You should only need to use 69this command when debugging a stripped executable. 70 71 <br><dt><code>show heuristic-fence-post</code><dd>Display the current limit. 72</dl> 73 74<p class="noindent">These commands are available <em>only</em> when <span class="sc">gdb</span> is configured 75for debugging programs on Alpha or MIPS processors. 76 77 <p>Several MIPS-specific commands are available when debugging MIPS 78programs: 79 80 <dl> 81<dt><code>set mips abi </code><var>arg</var><dd><a name="index-set-mips-abi-1407"></a><a name="index-set-ABI-for-MIPS-1408"></a>Tell <span class="sc">gdb</span> which MIPS ABI is used by the inferior. Possible 82values of <var>arg</var> are: 83 84 <dl> 85<dt>‘<samp><span class="samp">auto</span></samp>’<dd>The default ABI associated with the current binary (this is the 86default). 87<br><dt>‘<samp><span class="samp">o32</span></samp>’<br><dt>‘<samp><span class="samp">o64</span></samp>’<br><dt>‘<samp><span class="samp">n32</span></samp>’<br><dt>‘<samp><span class="samp">n64</span></samp>’<br><dt>‘<samp><span class="samp">eabi32</span></samp>’<br><dt>‘<samp><span class="samp">eabi64</span></samp>’<dd></dl> 88 89 <br><dt><code>show mips abi</code><dd><a name="index-show-mips-abi-1409"></a>Show the MIPS ABI used by <span class="sc">gdb</span> to debug the inferior. 90 91 <br><dt><code>set mips compression </code><var>arg</var><dd><a name="index-set-mips-compression-1410"></a><a name="index-MIPS-code-compression-1411"></a>Tell <span class="sc">gdb</span> which MIPS compressed ISA encoding is used by the 92inferior. <span class="sc">gdb</span> uses this for code disassembly and other 93internal interpretation purposes. This setting is only referred to 94when no executable has been associated with the debugging session or 95the executable does not provide information about the encoding it uses. 96Otherwise this setting is automatically updated from information 97provided by the executable. 98 99 <p>Possible values of <var>arg</var> are ‘<samp><span class="samp">mips16</span></samp>’ and ‘<samp><span class="samp">micromips</span></samp>’. 100The default compressed ISA encoding is ‘<samp><span class="samp">mips16</span></samp>’, as executables 101containing MIPS16 code frequently are not identified as such. 102 103 <p>This setting is “sticky”; that is, it retains its value across 104debugging sessions until reset either explicitly with this command or 105implicitly from an executable. 106 107 <p>The compiler and/or assembler typically add symbol table annotations to 108identify functions compiled for the MIPS16 or microMIPS ISAs. If these 109function-scope annotations are present, <span class="sc">gdb</span> uses them in 110preference to the global compressed ISA encoding setting. 111 112 <br><dt><code>show mips compression</code><dd><a name="index-show-mips-compression-1412"></a>Show the MIPS compressed ISA encoding used by <span class="sc">gdb</span> to debug the 113inferior. 114 115 <br><dt><code>set mipsfpu</code><dt><code>show mipsfpu</code><dd>See <a href="MIPS-Embedded.html#MIPS-Embedded">set mipsfpu</a>. 116 117 <br><dt><code>set mips mask-address </code><var>arg</var><dd><a name="index-set-mips-mask_002daddress-1413"></a><a name="index-MIPS-addresses_002c-masking-1414"></a>This command determines whether the most-significant 32 bits of 64-bit 118MIPS addresses are masked off. The argument <var>arg</var> can be 119‘<samp><span class="samp">on</span></samp>’, ‘<samp><span class="samp">off</span></samp>’, or ‘<samp><span class="samp">auto</span></samp>’. The latter is the default 120setting, which lets <span class="sc">gdb</span> determine the correct value. 121 122 <br><dt><code>show mips mask-address</code><dd><a name="index-show-mips-mask_002daddress-1415"></a>Show whether the upper 32 bits of MIPS addresses are masked off or 123not. 124 125 <br><dt><code>set remote-mips64-transfers-32bit-regs</code><dd><a name="index-set-remote_002dmips64_002dtransfers_002d32bit_002dregs-1416"></a>This command controls compatibility with 64-bit MIPS targets that 126transfer data in 32-bit quantities. If you have an old MIPS 64 target 127that transfers 32 bits for some registers, like <span class="sc">sr</span> and <span class="sc">fsr</span>, 128and 64 bits for other registers, set this option to ‘<samp><span class="samp">on</span></samp>’. 129 130 <br><dt><code>show remote-mips64-transfers-32bit-regs</code><dd><a name="index-show-remote_002dmips64_002dtransfers_002d32bit_002dregs-1417"></a>Show the current setting of compatibility with older MIPS 64 targets. 131 132 <br><dt><code>set debug mips</code><dd><a name="index-set-debug-mips-1418"></a>This command turns on and off debugging messages for the MIPS-specific 133target code in <span class="sc">gdb</span>. 134 135 <br><dt><code>show debug mips</code><dd><a name="index-show-debug-mips-1419"></a>Show the current setting of MIPS debugging messages. 136</dl> 137 138 </body></html> 139 140