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-2013 Free Software Foundation, Inc. 14 15Permission is granted to copy, distribute and/or modify this document 16under the terms of the GNU Free Documentation License, Version 1.3 or 17any later version published by the Free Software Foundation; with the 18Invariant Sections being ``Free Software'' and ``Free Software Needs 19Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 20and with the Back-Cover Texts as in (a) below. 21 22(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 23this GNU Manual. Buying copies from GNU Press supports the FSF in 24developing GNU and promoting software freedom.'' 25--> 26<meta http-equiv="Content-Style-Type" content="text/css"> 27<style type="text/css"><!-- 28 pre.display { font-family:inherit } 29 pre.format { font-family:inherit } 30 pre.smalldisplay { font-family:inherit; font-size:smaller } 31 pre.smallformat { font-family:inherit; font-size:smaller } 32 pre.smallexample { font-size:smaller } 33 pre.smalllisp { font-size:smaller } 34 span.sc { font-variant:small-caps } 35 span.roman { font-family:serif; font-weight:normal; } 36 span.sansserif { font-family:sans-serif; font-weight:normal; } 37--></style> 38<link rel="stylesheet" type="text/css" href="../cs.css"> 39</head> 40<body> 41<div class="node"> 42<a name="MIPS"></a> 43<p> 44Next: <a rel="next" accesskey="n" href="HPPA.html#HPPA">HPPA</a>, 45Previous: <a rel="previous" accesskey="p" href="Alpha.html#Alpha">Alpha</a>, 46Up: <a rel="up" accesskey="u" href="Architectures.html#Architectures">Architectures</a> 47<hr> 48</div> 49 50<h4 class="subsection">21.4.4 <acronym>MIPS</acronym></h4> 51 52<p><a name="index-stack-on-Alpha-1515"></a><a name="index-stack-on-_0040acronym_007bMIPS_007d-1516"></a><a name="index-Alpha-stack-1517"></a><a name="index-g_t_0040acronym_007bMIPS_007d-stack-1518"></a>Alpha- and <acronym>MIPS</acronym>-based computers use an unusual stack frame, which 53sometimes requires <span class="sc">gdb</span> to search backward in the object code to 54find the beginning of a function. 55 56 <p><a name="index-response-time_002c-_0040acronym_007bMIPS_007d-debugging-1519"></a>To improve response time (especially for embedded applications, where 57<span class="sc">gdb</span> may be restricted to a slow serial line for this search) 58you may want to limit the size of this search, using one of these 59commands: 60 61 62<a name="index-g_t_0040code_007bheuristic_002dfence_002dpost_007d-_0028Alpha_002c-_0040acronym_007bMIPS_007d_0029-1520"></a> 63<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 64search for the beginning of a function. A value of <var>0</var> (the 65default) means there is no limit. However, except for <var>0</var>, the 66larger the limit the more bytes <code>heuristic-fence-post</code> must search 67and therefore the longer it takes to run. You should only need to use 68this command when debugging a stripped executable. 69 70 <br><dt><code>show heuristic-fence-post</code><dd>Display the current limit. 71</dl> 72 73<p class="noindent">These commands are available <em>only</em> when <span class="sc">gdb</span> is configured 74for debugging programs on Alpha or <acronym>MIPS</acronym> processors. 75 76 <p>Several <acronym>MIPS</acronym>-specific commands are available when debugging <acronym>MIPS</acronym> 77programs: 78 79 <dl> 80<dt><code>set mips abi </code><var>arg</var><dd><a name="index-set-mips-abi-1521"></a><a name="index-set-ABI-for-_0040acronym_007bMIPS_007d-1522"></a>Tell <span class="sc">gdb</span> which <acronym>MIPS</acronym> ABI is used by the inferior. Possible 81values of <var>arg</var> are: 82 83 <dl> 84<dt>‘<samp><span class="samp">auto</span></samp>’<dd>The default ABI associated with the current binary (this is the 85default). 86<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> 87 88 <br><dt><code>show mips abi</code><dd><a name="index-show-mips-abi-1523"></a>Show the <acronym>MIPS</acronym> ABI used by <span class="sc">gdb</span> to debug the inferior. 89 90 <br><dt><code>set mips compression </code><var>arg</var><dd><a name="index-set-mips-compression-1524"></a><a name="index-code-compression_002c-_0040acronym_007bMIPS_007d-1525"></a>Tell <span class="sc">gdb</span> which <acronym>MIPS</acronym> compressed 91<acronym title="Instruction Set Architecture">ISA</acronym> (Instruction Set Architecture) 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 <acronym title="Instruction Set Architecture">ISA</acronym> encoding is ‘<samp><span class="samp">mips16</span></samp>’, as 101executables containing <acronym>MIPS16</acronym> code frequently are not 102identified as such. 103 104 <p>This setting is “sticky”; that is, it retains its value across 105debugging sessions until reset either explicitly with this command or 106implicitly from an executable. 107 108 <p>The compiler and/or assembler typically add symbol table annotations to 109identify functions compiled for the <acronym>MIPS16</acronym> or 110<acronym>microMIPS</acronym> <acronym title="Instruction Set Architecture">ISA</acronym>s. If these function-scope annotations 111are present, <span class="sc">gdb</span> uses them in preference to the global 112compressed <acronym title="Instruction Set Architecture">ISA</acronym> encoding setting. 113 114 <br><dt><code>show mips compression</code><dd><a name="index-show-mips-compression-1526"></a>Show the <acronym>MIPS</acronym> compressed <acronym title="Instruction Set Architecture">ISA</acronym> encoding used by 115<span class="sc">gdb</span> to debug the inferior. 116 117 <br><dt><code>set mipsfpu</code><dt><code>show mipsfpu</code><dd>See <a href="MIPS-Embedded.html#MIPS-Embedded">set mipsfpu</a>. 118 119 <br><dt><code>set mips mask-address </code><var>arg</var><dd><a name="index-set-mips-mask_002daddress-1527"></a><a name="index-g_t_0040acronym_007bMIPS_007d-addresses_002c-masking-1528"></a>This command determines whether the most-significant 32 bits of 64-bit 120<acronym>MIPS</acronym> addresses are masked off. The argument <var>arg</var> can be 121‘<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 122setting, which lets <span class="sc">gdb</span> determine the correct value. 123 124 <br><dt><code>show mips mask-address</code><dd><a name="index-show-mips-mask_002daddress-1529"></a>Show whether the upper 32 bits of <acronym>MIPS</acronym> addresses are masked off or 125not. 126 127 <br><dt><code>set remote-mips64-transfers-32bit-regs</code><dd><a name="index-set-remote_002dmips64_002dtransfers_002d32bit_002dregs-1530"></a>This command controls compatibility with 64-bit <acronym>MIPS</acronym> targets that 128transfer data in 32-bit quantities. If you have an old <acronym>MIPS</acronym> 64 target 129that transfers 32 bits for some registers, like <span class="sc">sr</span> and <span class="sc">fsr</span>, 130and 64 bits for other registers, set this option to ‘<samp><span class="samp">on</span></samp>’. 131 132 <br><dt><code>show remote-mips64-transfers-32bit-regs</code><dd><a name="index-show-remote_002dmips64_002dtransfers_002d32bit_002dregs-1531"></a>Show the current setting of compatibility with older <acronym>MIPS</acronym> 64 targets. 133 134 <br><dt><code>set debug mips</code><dd><a name="index-set-debug-mips-1532"></a>This command turns on and off debugging messages for the <acronym>MIPS</acronym>-specific 135target code in <span class="sc">gdb</span>. 136 137 <br><dt><code>show debug mips</code><dd><a name="index-show-debug-mips-1533"></a>Show the current setting of <acronym>MIPS</acronym> debugging messages. 138</dl> 139 140 </body></html> 141 142