| Summary: | alloc-fn appears not to work for C++ class member functions | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | martijn versteegh <m.versteegh> |
| Component: | massif | Assignee: | Nicholas Nethercote <njn> |
| Status: | RESOLVED INTENTIONAL | ||
| Severity: | wishlist | CC: | pjfloyd |
| Priority: | NOR | ||
| Version First Reported In: | 2.2.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
martijn versteegh
2004-09-17 16:48:16 UTC
The trouble is that different C++ compilers have different name-mangling algorithms, so Valgrind would also need to know exactly which compiler/ABI you're using. I'm closing this as intentional. There are ways to demangle decorated name (we could 'popen c++filt' or use abi::__cxa_demangle [but that is a C++ interface]) but that is the wrong direction. I'm not aware of tools that preform mangling, other than the compiler. I don't think that it's a good idea for us to maintain a copy of the C++ or Rust or whatever mangler in Valgrind. There is another small disadvantage to using undecorated names. Some of the characters (like ~ in destructor names) are not shell-friendly and may need quoting/escaping. Not that this is too likely, with the main need being for replacement malloc/free//new/delete. In summary, I think the best solution is to simply use 'nm' on your executable. In case the name of the function you are looking for is not obvious you can run 'nm -C', note the hexd offset, then run 'nm' without -C and look for the same hex offset. |