Open tthtlc opened 5 years ago
OK, so looks like these symbols are not demangle-able with c++filt
/ __cxa_demangle
, which BCC uses.
Fallback to Itanium Demangler is OK (but probably still try __cxa_demangle
first as in practice we've found Itanium Demangler more expensive / slow), the only thing to be figured out is the additional dependency and if it's worth for BCC to have that.
Could you double check, maybe with source, why __cxa_demanglee
does not work?
-bash-4.4$ cat t.cc
#include <cxxabi.h>
#include <stdio.h>
int main() {
const char *name = "_ZN7mozilla6detail21ConditionVariableImpl10notify_oneEv";
char *dname;
dname = abi::__cxa_demangle(name, nullptr, nullptr, nullptr);
fprintf(stderr, "%s\n", dname);
return 0;
}
-bash-4.4$ g++ t.cc -std=c++0x
-bash-4.4$ ./a.out
mozilla::detail::ConditionVariableImpl::notify_one()
-bash-4.4$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-
threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-lib
unwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style
=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-in
itfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-r
edhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redha
t-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
-bash-4.4$
In my environment, gcc 4.8.5 seems working fine. Maybe __cxa_demangle
is not called somehow?
after running "funccount" on Mozilla firefox:
I got the above output.
can we do better? if you do "objdump --demangle" you can easily get the demangle output from the binary. If someone can suggest how and where to modify the BCC (which I don't know) perhaps I can try combining it with:
https://github.com/whitequark/python-itanium_demangler
and submit a patch request.