summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/doc/html/manual/debug.html
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-10 00:54:53 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-10 00:54:53 +0000
commit7ffc0596cf37a74abf0b136957540b987d8f5cd8 (patch)
treec39cd4e1463e1faae31da39b7744f082a9237e2d /libstdc++-v3/doc/html/manual/debug.html
parent45936f18b2fbb1ca6647f04675fba92967276249 (diff)
downloadppe42-gcc-7ffc0596cf37a74abf0b136957540b987d8f5cd8.tar.gz
ppe42-gcc-7ffc0596cf37a74abf0b136957540b987d8f5cd8.zip
2011-02-10 Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/xml/manual/status_cxx200x.xml: Update. * doc/html/*: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169996 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/doc/html/manual/debug.html')
-rw-r--r--libstdc++-v3/doc/html/manual/debug.html53
1 files changed, 28 insertions, 25 deletions
diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html
index e3e5044a2bb..e33c1074986 100644
--- a/libstdc++-v3/doc/html/manual/debug.html
+++ b/libstdc++-v3/doc/html/manual/debug.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_exceptions.html" title="Exceptions"/><link rel="next" href="bk01pt02.html" title="Part II.  Standard Contents"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr></table><hr/></div><div class="section" title="Debugging Support"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.debug"/>Debugging Support</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_exceptions.html" title="Exceptions"/><link rel="next" href="bk01pt02.html" title="Part II.  Standard Contents"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr></table><hr/></div><div class="section" title="Debugging Support"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.debug"/>Debugging Support</h2></div></div></div><p>
There are numerous things that can be done to improve the ease with
which C++ binaries are debugged when using the GNU tool chain. Here
are some of them.
@@ -28,7 +28,7 @@
platform can be identified via the value set by the
PREFERRED_DEBUGGING_TYPE macro in the gcc sources.
</p><p>
- Many other options are available: please see <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options">"Options
+ Many other options are available: please see <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options" target="">"Options
for Debugging Your Program"</a> in Using the GNU Compiler
Collection (GCC) for a complete list.
</p></div><div class="section" title="Debug Versions of Library Binary Files"><div class="titlepage"><div><div><h3 class="title"><a id="debug.req"/>Debug Versions of Library Binary Files</h3></div></div></div><p>
@@ -122,34 +122,37 @@
</p><pre class="programlisting">
valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
</pre></div><div class="section" title="Data Race Hunting"><div class="titlepage"><div><div><h3 class="title"><a id="debug.races"/>Data Race Hunting</h3></div></div></div><p>
- All synchronization primitives used in the library internals should be
+ All synchronization primitives used in the library internals need to be
understood by race detectors so that they do not produce false reports.
</p><p>
- We use two annotations (macros) to explain low-level synchronization
+ Two annotation macros are used to explain low-level synchronization
to race detectors:
<code class="code">_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE()</code> and
<code class="code"> _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER()</code>.
- By default, these two macros are defined empty -- anyone who wants
- to use a race detector will need to redefine these macros to call an
+ By default, these macros are defined empty -- anyone who wants
+ to use a race detector needs to redefine them to call an
appropriate API.
- Since these macros are empty by default, redefining them in the user code
- will affect only the inline template code, e.g. <code class="code">shared_ptr</code>.
- In order to redefine the macros in <code class="code">basic_string</code> one will
- need to disable extern templates (by defining
- <code class="code">_GLIBCXX_EXTERN_TEMPLATE=-1</code>) or rebuild the
+ Since these macros are empty by default when the library is built,
+ redefining them will only affect inline functions and template
+ instantiations which are compiled in user code. This allows annotation
+ of templates such as <code class="code">shared_ptr</code>, but not code which is
+ only instantiated in the library.
+ In order to annotate <code class="code">basic_string</code> reference counting it
+ is necessary to disable extern templates (by defining
+ <code class="code">_GLIBCXX_EXTERN_TEMPLATE=-1</code>) or to rebuild the
<code class="code">.so</code> file.
- The rest of the cases (currently, <code class="code">ios_base::Init::~Init</code>,
- <code class="code">locale::_Impl</code> and <code class="code">locale::facet</code>) will require
- to rebuild the <code class="code">.so</code> file.
+ Annotating the remaining atomic operations (at the time of writing these
+ are in <code class="code">ios_base::Init::~Init</code>, <code class="code">locale::_Impl</code> and
+ <code class="code">locale::facet</code>) requires rebuilding the <code class="code">.so</code> file.
</p><p>
- The approach described above works at least with the following race
+ The approach described above is known to work with the following race
detection tools:
- <a class="link" href="http://valgrind.org/docs/manual/drd-manual.html">
- DRD </a>,
- <a class="link" href="http://valgrind.org/docs/manual/hg-manual.html">
- Helgrind </a>,
- <a class="link" href="http://code.google.com/p/data-race-test">
- ThreadSanitizer </a>.
+ <a class="link" href="http://valgrind.org/docs/manual/drd-manual.html" target="">
+ DRD</a>,
+ <a class="link" href="http://valgrind.org/docs/manual/hg-manual.html" target="">
+ Helgrind</a>, and
+ <a class="link" href="http://code.google.com/p/data-race-test" target="">
+ ThreadSanitizer</a>.
</p><p>
With DRD, Helgrind and ThreadSanitizer you will need to define
the macros like this:
@@ -157,10 +160,10 @@
#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) ANNOTATE_HAPPENS_BEFORE(A)
#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) ANNOTATE_HAPPENS_AFTER(A)
</pre><p>
- Refer to the documentation of each particular tool for the details.
+ Refer to the documentation of each particular tool for details.
</p></div><div class="section" title="Using gdb"><div class="titlepage"><div><div><h3 class="title"><a id="debug.gdb"/>Using <span class="command"><strong>gdb</strong></span></h3></div></div></div><p>
</p><p>
- Many options are available for GDB itself: please see <a class="link" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb/">
+ Many options are available for GDB itself: please see <a class="link" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb/" target="">
"GDB features for C++" </a> in the GDB documentation. Also
recommended: the other parts of this manual.
</p><p>
@@ -204,12 +207,12 @@
pretty-printers were not loaded.
</p><p>
For additional information on STL support and GDB please visit:
- <a class="link" href="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
+ <a class="link" href="http://sourceware.org/gdb/wiki/STLSupport" target=""> "GDB Support
for STL" </a> in the GDB wiki. Additionally, in-depth
documentation and discussion of the pretty printing feature can be
found in "Pretty Printing" node in the GDB manual. You can find
on-line versions of the GDB user manual in GDB's homepage, at
- <a class="link" href="http://sourceware.org/gdb/"> "GDB: The GNU Project
+ <a class="link" href="http://sourceware.org/gdb/" target=""> "GDB: The GNU Project
Debugger" </a>.
</p></div><div class="section" title="Tracking uncaught exceptions"><div class="titlepage"><div><div><h3 class="title"><a id="debug.exceptions"/>Tracking uncaught exceptions</h3></div></div></div><p>
The <a class="link" href="termination.html#support.termination.verbose" title="Verbose Terminate Handler">verbose
OpenPOWER on IntegriCloud