Skip to content

Commit

Permalink
Avoid demangling C functions with names coinciding with types
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 committed Nov 20, 2017
1 parent 370873e commit 43a1e42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/BinaryInfo/demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#define DEMANGLING_SUPPORTED true

inline QString demangle(const QString& mangled) {
if(!mangled.startsWith("_Z"))
return mangled; // otherwise we'll try to demangle C functions coinciding with types like "f" as "float", which is bad
int failed=0;
QStringList split=mangled.split("@"); // for cases like funcName@plt
std::unique_ptr<char,decltype(std::free)*> demangled(abi::__cxa_demangle(split.front().toStdString().c_str(),0,0,&failed), std::free);
Expand Down

0 comments on commit 43a1e42

Please sign in to comment.