blob: 1e54b1583d2df496a6e343041d513050e354fbe7 [file] [log] [blame]
<html lang="en">
<head>
<title>ABI - 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="Numbers.html#Numbers" title="Numbers">
<link rel="next" href="Messages_002fWarnings.html#Messages_002fWarnings" title="Messages/Warnings">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
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>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="ABI"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Messages_002fWarnings.html#Messages_002fWarnings">Messages/Warnings</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Numbers.html#Numbers">Numbers</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Controlling-GDB.html#Controlling-GDB">Controlling GDB</a>
<hr>
</div>
<h3 class="section">22.6 Configuring the Current ABI</h3>
<p><span class="sc">gdb</span> can determine the <dfn>ABI</dfn> (Application Binary Interface) of your
application automatically. However, sometimes you need to override its
conclusions. Use these commands to manage <span class="sc">gdb</span>'s view of the
current ABI.
<p><a name="index-OS-ABI-1470"></a><a name="index-set-osabi-1471"></a><a name="index-show-osabi-1472"></a>
One <span class="sc">gdb</span> configuration can debug binaries for multiple operating
system targets, either via remote debugging or native emulation.
<span class="sc">gdb</span> will autodetect the <dfn>OS ABI</dfn> (Operating System ABI) in use,
but you can override its conclusion using the <code>set osabi</code> command.
One example where this is useful is in debugging of binaries which use
an alternate C library (e.g. <span class="sc">uClibc</span> for <span class="sc">gnu</span>/Linux) which does
not have the same identifying marks that the standard C library for your
platform provides.
<dl>
<dt><code>show osabi</code><dd>Show the OS ABI currently in use.
<br><dt><code>set osabi</code><dd>With no argument, show the list of registered available OS ABI's.
<br><dt><code>set osabi </code><var>abi</var><dd>Set the current OS ABI to <var>abi</var>.
</dl>
<p><a name="index-float-promotion-1473"></a>
Generally, the way that an argument of type <code>float</code> is passed to a
function depends on whether the function is prototyped. For a prototyped
(i.e. ANSI/ISO style) function, <code>float</code> arguments are passed unchanged,
according to the architecture's convention for <code>float</code>. For unprototyped
(i.e. K&amp;R style) functions, <code>float</code> arguments are first promoted to type
<code>double</code> and then passed.
<p>Unfortunately, some forms of debug information do not reliably indicate whether
a function is prototyped. If <span class="sc">gdb</span> calls a function that is not marked
as prototyped, it consults <kbd>set coerce-float-to-double</kbd>.
<a name="index-set-coerce_002dfloat_002dto_002ddouble-1474"></a>
<dl><dt><code>set coerce-float-to-double</code><dt><code>set coerce-float-to-double on</code><dd>Arguments of type <code>float</code> will be promoted to <code>double</code> when passed
to an unprototyped function. This is the default setting.
<br><dt><code>set coerce-float-to-double off</code><dd>Arguments of type <code>float</code> will be passed directly to unprototyped
functions.
<p><a name="index-show-coerce_002dfloat_002dto_002ddouble-1475"></a><br><dt><code>show coerce-float-to-double</code><dd>Show the current setting of promoting <code>float</code> to <code>double</code>.
</dl>
<p><a name="index-set-cp_002dabi-1476"></a><a name="index-show-cp_002dabi-1477"></a><span class="sc">gdb</span> needs to know the ABI used for your program's C<tt>++</tt>
objects. The correct C<tt>++</tt> ABI depends on which C<tt>++</tt> compiler was
used to build your application. <span class="sc">gdb</span> only fully supports
programs with a single C<tt>++</tt> ABI; if your program contains code using
multiple C<tt>++</tt> ABI's or if <span class="sc">gdb</span> can not identify your
program's ABI correctly, you can tell <span class="sc">gdb</span> which ABI to use.
Currently supported ABI's include &ldquo;gnu-v2&rdquo;, for <code>g++</code> versions
before 3.0, &ldquo;gnu-v3&rdquo;, for <code>g++</code> versions 3.0 and later, and
&ldquo;hpaCC&rdquo; for the HP ANSI C<tt>++</tt> compiler. Other C<tt>++</tt> compilers may
use the &ldquo;gnu-v2&rdquo; or &ldquo;gnu-v3&rdquo; ABI's as well. The default setting is
&ldquo;auto&rdquo;.
<dl>
<dt><code>show cp-abi</code><dd>Show the C<tt>++</tt> ABI currently in use.
<br><dt><code>set cp-abi</code><dd>With no argument, show the list of supported C<tt>++</tt> ABI's.
<br><dt><code>set cp-abi </code><var>abi</var><dt><code>set cp-abi auto</code><dd>Set the current C<tt>++</tt> ABI to <var>abi</var>, or return to automatic detection.
</dl>
</body></html>