blob: 171424edbc96db59e45bc0c5aec60753a574b23c [file] [log] [blame]
<html lang="en">
<head>
<title>Which flavor to choose? - 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="Auto_002dloading.html#Auto_002dloading" title="Auto-loading">
<link rel="prev" href="_002edebug_005fgdb_005fscripts-section.html#g_t_002edebug_005fgdb_005fscripts-section" title=".debug_gdb_scripts section">
<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="Which-flavor-to-choose%3f"></a>
<a name="Which-flavor-to-choose_003f"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="_002edebug_005fgdb_005fscripts-section.html#g_t_002edebug_005fgdb_005fscripts-section">.debug_gdb_scripts section</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Auto_002dloading.html#Auto_002dloading">Auto-loading</a>
<hr>
</div>
<h5 class="subsubsection">23.2.3.3 Which flavor to choose?</h5>
<p>Given the multiple ways of auto-loading Python scripts, it might not always
be clear which one to choose. This section provides some guidance.
<p>Benefits of the <samp><span class="file">-gdb.py</span></samp> way:
<ul>
<li>Can be used with file formats that don't support multiple sections.
<li>Ease of finding scripts for public libraries.
<p>Scripts specified in the <code>.debug_gdb_scripts</code> section are searched for
in the source search path.
For publicly installed libraries, e.g., <samp><span class="file">libstdc++</span></samp>, there typically
isn't a source directory in which to find the script.
<li>Doesn't require source code additions.
</ul>
<p>Benefits of the <code>.debug_gdb_scripts</code> way:
<ul>
<li>Works with static linking.
<p>Scripts for libraries done the <samp><span class="file">-gdb.py</span></samp> way require an objfile to
trigger their loading. When an application is statically linked the only
objfile available is the executable, and it is cumbersome to attach all the
scripts from all the input libraries to the executable's <samp><span class="file">-gdb.py</span></samp> script.
<li>Works with classes that are entirely inlined.
<p>Some classes can be entirely inlined, and thus there may not be an associated
shared library to attach a <samp><span class="file">-gdb.py</span></samp> script to.
<li>Scripts needn't be copied out of the source tree.
<p>In some circumstances, apps can be built out of large collections of internal
libraries, and the build infrastructure necessary to install the
<samp><span class="file">-gdb.py</span></samp> scripts in a place where <span class="sc">gdb</span> can find them is
cumbersome. It may be easier to specify the scripts in the
<code>.debug_gdb_scripts</code> section as relative paths, and add a path to the
top of the source tree to the source search path.
</ul>
</body></html>