544be2beb1
The Profile Mode extension is not used by anybody, nor maintained by anybody. The containers do not support the full API specified in recent standards, and so enabling Profile Mode is not source compatible with much modern C++ code. The heuristics that would check the profile information and make useful suggestions never materialized, so it isn't useful. It should be removed. Remove Profile Mode, deprecated since 7.1.0 * doc/Makefile.am: Remove XML file for profile mode docs. * doc/Makefile.in: Regenerate. * doc/xml/authors.xml: Remove authors of profile mode docs. * doc/xml/manual/appendix_contributing.xml: Remove mention of profile mode. * doc/xml/manual/debug.xml: Likewise. * doc/xml/manual/evolution.xml: Document removal of profile mode. * doc/xml/manual/profile_mode.xml: Remove profile mode docs. * doc/xml/manual/spine.xml: Remove profile mode author credit. * doc/xml/manual/test.xml: Remove docs for dg-require-profile-mode directive. * doc/xml/manual/using.xml: Remove docs for profile mode headers and macro. * doc/html/*: Regenerate. * include/Makefile.am: Remove profile mode headers. * include/Makefile.in: Regenerate. * include/bits/c++config (std::__profile): Remove namespace. [_GLIBCXX_PROFILE]: Remove checks for macro. * include/profile/array: Remove. * include/profile/base.h: Remove. * include/profile/bitset: Remove. * include/profile/deque: Remove. * include/profile/forward_list: Remove. * include/profile/impl/profiler.h: Remove. * include/profile/impl/profiler_algos.h: Remove. * include/profile/impl/profiler_container_size.h: Remove. * include/profile/impl/profiler_hash_func.h: Remove. * include/profile/impl/profiler_hashtable_size.h: Remove. * include/profile/impl/profiler_list_to_slist.h: Remove. * include/profile/impl/profiler_list_to_vector.h: Remove. * include/profile/impl/profiler_map_to_unordered_map.h: Remove. * include/profile/impl/profiler_node.h: Remove. * include/profile/impl/profiler_state.h: Remove. * include/profile/impl/profiler_trace.h: Remove. * include/profile/impl/profiler_vector_size.h: Remove. * include/profile/impl/profiler_vector_to_list.h: Remove. * include/profile/iterator_tracker.h: Remove. * include/profile/list: Remove. * include/profile/map: Remove. * include/profile/map.h: Remove. * include/profile/multimap.h: Remove. * include/profile/multiset.h: Remove. * include/profile/ordered_base.h: Remove. * include/profile/set: Remove. * include/profile/set.h: Remove. * include/profile/unordered_base.h: Remove. * include/profile/unordered_map: Remove. * include/profile/unordered_set: Remove. * include/profile/vector: Remove. * scripts/run_doxygen: Do not process profile mode headers. * testsuite/23_containers/array/element_access/60497.cc: Don't use profile mode type. * testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc: Remove dg-skip-if for profile mode. * testsuite/23_containers/forward_list/capacity/1.cc: Remove preprocessor check for profile mode. * testsuite/23_containers/list/capacity/29134.cc: Likewise. * testsuite/23_containers/map/modifiers/extract.cc: Remove dg-skip-if for profile mode. * testsuite/23_containers/map/modifiers/insert_or_assign/1.cc: Likewise. * testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise. * testsuite/23_containers/multimap/modifiers/extract.cc: Likewise. * testsuite/23_containers/multiset/modifiers/extract.cc: Likewise. * testsuite/23_containers/set/modifiers/extract.cc: Likewise. * testsuite/23_containers/unordered_map/modifiers/extract.cc: Likewise. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: Likewise. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: Likewise. * testsuite/23_containers/unordered_set/modifiers/extract.cc: Likewise. * testsuite/23_containers/vector/bool/capacity/29134.cc: Remove preprocessor check for profile mode. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Likewise. * testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc: Remove dg-skip-if for profile mode. * testsuite/25_algorithms/binary_search/partitioned.cc: Likewise. * testsuite/25_algorithms/equal_range/partitioned.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise. * testsuite/25_algorithms/lower_bound/partitioned.cc: Likewise. * testsuite/25_algorithms/upper_bound/partitioned.cc: Likewise. * testsuite/Makefile.am: Remove profile_flags variable and * testsuite/Makefile.am: Remove profile_flags variable and check-profile target. * testsuite/Makefile.in: Regenerate. * testsuite/ext/profile/all.cc: Remove. * testsuite/ext/profile/mutex_extensions_neg.cc: Remove. * testsuite/ext/profile/profiler_algos.cc: Remove. * testsuite/ext/profile/replace_new.cc: Remove. * testsuite/ext/throw_allocator/deallocate_global.cc: Remove preprocessor check for profile mode. * testsuite/ext/throw_allocator/deallocate_local.cc: Likewise. * testsuite/lib/libstdc++.exp (check_v3_target_profile_mode): Remove. (check_v3_target_normal_mode): Do not check for profile mode macro. * testsuite/libstdc++-prettyprinters/80276.cc: Remove dg-skip-if for profile mode. * testsuite/libstdc++-prettyprinters/compat.cc: Likewise. * testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise. * testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise. * testsuite/libstdc++-prettyprinters/debug.cc: Likewise. * testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise. * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise. * testsuite/libstdc++-prettyprinters/simple.cc: Likewise. * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise. * testsuite/libstdc++-prettyprinters/whatis.cc: Likewise. * testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise. From-SVN: r271120
73 lines
4.5 KiB
HTML
73 lines
4.5 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 28. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III. Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 27. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 29. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III.
|
||
Extensions
|
||
|
||
</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 28. Demangling</h2></div></div></div><p>
|
||
Transforming C++ ABI identifiers (like RTTI symbols) into the
|
||
original C++ source identifiers is called
|
||
<span class="quote">“<span class="quote">demangling.</span>”</span>
|
||
</p><p>
|
||
If you have read the <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html" target="_top">source
|
||
documentation for <code class="code">namespace abi</code></a> then you are
|
||
aware of the cross-vendor C++ ABI in use by GCC. One of the
|
||
exposed functions is used for demangling,
|
||
<code class="code">abi::__cxa_demangle</code>.
|
||
</p><p>
|
||
In programs like <span class="command"><strong>c++filt</strong></span>, the linker, and other tools
|
||
have the ability to decode C++ ABI names, and now so can you.
|
||
</p><p>
|
||
(The function itself might use different demanglers, but that's the
|
||
whole point of abstract interfaces. If we change the implementation,
|
||
you won't notice.)
|
||
</p><p>
|
||
Probably the only times you'll be interested in demangling at runtime
|
||
are when you're seeing <code class="code">typeid</code> strings in RTTI, or when
|
||
you're handling the runtime-support exception classes. For example:
|
||
</p><pre class="programlisting">
|
||
#include <exception>
|
||
#include <iostream>
|
||
#include <cxxabi.h>
|
||
|
||
struct empty { };
|
||
|
||
template <typename T, int N>
|
||
struct bar { };
|
||
|
||
|
||
int main()
|
||
{
|
||
int status;
|
||
char *realname;
|
||
|
||
// exception classes not in <stdexcept>, thrown by the implementation
|
||
// instead of the user
|
||
std::bad_exception e;
|
||
realname = abi::__cxa_demangle(e.what(), 0, 0, &status);
|
||
std::cout << e.what() << "\t=> " << realname << "\t: " << status << '\n';
|
||
free(realname);
|
||
|
||
|
||
// typeid
|
||
bar<empty,17> u;
|
||
const std::type_info &ti = typeid(u);
|
||
|
||
realname = abi::__cxa_demangle(ti.name(), 0, 0, &status);
|
||
std::cout << ti.name() << "\t=> " << realname << "\t: " << status << '\n';
|
||
free(realname);
|
||
|
||
return 0;
|
||
}
|
||
</pre><p>
|
||
This prints
|
||
</p><pre class="screen">
|
||
<code class="computeroutput">
|
||
St13bad_exception => std::bad_exception : 0
|
||
3barI5emptyLi17EE => bar<empty, 17> : 0
|
||
</code>
|
||
</pre><p>
|
||
The demangler interface is described in the source documentation
|
||
linked to above. It is actually written in C, so you don't need to
|
||
be writing C++ in order to demangle C++. (That also means we have to
|
||
use crummy memory management facilities, so don't forget to free()
|
||
the returned char array.)
|
||
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 27. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 29. Concurrency</td></tr></table></div></body></html> |