96 lines
5.0 KiB
HTML
96 lines
5.0 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>Numbers - Debugging with GDB</title>
|
|
<meta http-equiv="Content-Type" content="text/html">
|
|
<meta name="description" content="Debugging with GDB">
|
|
<meta name="generator" content="makeinfo 4.13">
|
|
<link title="Top" rel="start" href="index.html#Top">
|
|
<link rel="up" href="Controlling-GDB.html#Controlling-GDB" title="Controlling GDB">
|
|
<link rel="prev" href="Output-Styling.html#Output-Styling" title="Output Styling">
|
|
<link rel="next" href="ABI.html#ABI" title="ABI">
|
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
|
<!--
|
|
Copyright (C) 1988-2019 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.''
|
|
-->
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
pre.display { font-family:inherit }
|
|
pre.format { font-family:inherit }
|
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
|
pre.smallexample { font-size:smaller }
|
|
pre.smalllisp { font-size:smaller }
|
|
span.sc { font-variant:small-caps }
|
|
span.roman { font-family:serif; font-weight:normal; }
|
|
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<div class="node">
|
|
<a name="Numbers"></a>
|
|
<p>
|
|
Next: <a rel="next" accesskey="n" href="ABI.html#ABI">ABI</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="Output-Styling.html#Output-Styling">Output Styling</a>,
|
|
Up: <a rel="up" accesskey="u" href="Controlling-GDB.html#Controlling-GDB">Controlling GDB</a>
|
|
<hr>
|
|
</div>
|
|
|
|
<h3 class="section">22.6 Numbers</h3>
|
|
|
|
<p><a name="index-number-representation-1694"></a><a name="index-entering-numbers-1695"></a>
|
|
You can always enter numbers in octal, decimal, or hexadecimal in
|
|
<span class="sc">gdb</span> by the usual conventions: octal numbers begin with
|
|
‘<samp><span class="samp">0</span></samp>’, decimal numbers end with ‘<samp><span class="samp">.</span></samp>’, and hexadecimal numbers
|
|
begin with ‘<samp><span class="samp">0x</span></samp>’. Numbers that neither begin with ‘<samp><span class="samp">0</span></samp>’ or
|
|
‘<samp><span class="samp">0x</span></samp>’, nor end with a ‘<samp><span class="samp">.</span></samp>’ are, by default, entered in base
|
|
10; likewise, the default display for numbers—when no particular
|
|
format is specified—is base 10. You can change the default base for
|
|
both input and output with the commands described below.
|
|
|
|
|
|
<a name="index-set-input_002dradix-1696"></a>
|
|
<dl><dt><code>set input-radix </code><var>base</var><dd>Set the default base for numeric input. Supported choices
|
|
for <var>base</var> are decimal 8, 10, or 16. The base must itself be
|
|
specified either unambiguously or using the current input radix; for
|
|
example, any of
|
|
|
|
<pre class="smallexample"> set input-radix 012
|
|
set input-radix 10.
|
|
set input-radix 0xa
|
|
</pre>
|
|
<p class="noindent">sets the input base to decimal. On the other hand, ‘<samp><span class="samp">set input-radix 10</span></samp>’
|
|
leaves the input radix unchanged, no matter what it was, since
|
|
‘<samp><span class="samp">10</span></samp>’, being without any leading or trailing signs of its base, is
|
|
interpreted in the current radix. Thus, if the current radix is 16,
|
|
‘<samp><span class="samp">10</span></samp>’ is interpreted in hex, i.e. as 16 decimal, which doesn't
|
|
change the radix.
|
|
|
|
<p><a name="index-set-output_002dradix-1697"></a><br><dt><code>set output-radix </code><var>base</var><dd>Set the default base for numeric display. Supported choices
|
|
for <var>base</var> are decimal 8, 10, or 16. The base must itself be
|
|
specified either unambiguously or using the current input radix.
|
|
|
|
<p><a name="index-show-input_002dradix-1698"></a><br><dt><code>show input-radix</code><dd>Display the current default base for numeric input.
|
|
|
|
<p><a name="index-show-output_002dradix-1699"></a><br><dt><code>show output-radix</code><dd>Display the current default base for numeric display.
|
|
|
|
<br><dt><code>set radix </code><span class="roman">[</span><var>base</var><span class="roman">]</span><dt><code>show radix</code><dd><a name="index-set-radix-1700"></a><a name="index-show-radix-1701"></a>These commands set and show the default base for both input and output
|
|
of numbers. <code>set radix</code> sets the radix of input and output to
|
|
the same base; without an argument, it resets the radix back to its
|
|
default value of 10.
|
|
|
|
</dl>
|
|
|
|
</body></html>
|
|
|