Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

21.6. Configuring the current ABI

gdb can determine the ABI (Application Binary Interface) of your application automatically. However, sometimes you need to override its conclusions. Use these commands to manage gdb's view of the current ABI.

One gdb configuration can debug binaries for multiple operating system targets, either via remote debugging or native emulation. gdb will autodetect the OS ABI (Operating System ABI) in use, but you can override its conclusion using the set osabi command. One example where this is useful is in debugging of binaries which use an alternate C library (e.g. uClibc for gnu/Linux) which does not have the same identifying marks that the standard C library for your platform provides.

show osabi

Show the OS ABI currently in use.

set osabi

With no argument, show the list of registered available OS ABI's.

set osabi abi

Set the current OS ABI to abi.

Generally, the way that an argument of type float is passed to a function depends on whether the function is prototyped. For a prototyped (that is, ANSI/ISO style) function, float arguments are passed unchanged, according to the architecture's convention for float. For unprototyped (that is, K&R style) functions, float arguments are first promoted to type double and then passed.

Unfortunately, some forms of debug information do not reliably indicate whether a function is prototyped. If gdb calls a function that is not marked as prototyped, it consults set coerce-float-to-double.

set coerce-float-to-double, set coerce-float-to-double on

Arguments of type float will be promoted to double when passed to an unprototyped function. This is the default setting.

set coerce-float-to-double off

Arguments of type float will be passed directly to unprototyped functions.

gdb needs to know the ABI used for your program's C++ objects. The correct C++ ABI depends on which C++ compiler was used to build your application. gdb only fully supports programs with a single C++ ABI; if your program contains code using multiple C++ ABI's or if gdb can not identify your program's ABI correctly, you can tell gdb which ABI to use. Currently supported ABI's include "gnu-v2", for g++ versions before 3.0, "gnu-v3", for g++ versions 3.0 and later, and "hpaCC" for the HP ANSI C++ compiler. Other C++ compilers may use the "gnu-v2" or "gnu-v3" ABI's as well. The default setting is "auto".

show cp-abi

Show the C++ ABI currently in use.

set cp-abi

With no argument, show the list of supported C++ ABI's.

set cp-abi abi, set cp-abi auto

Set the current C++ ABI to abi, or return to automatic detection.

 
 
  Published under the terms of the GNU General Public License Design by Interspire