std::string functionname =
stacktrace_entry.substr(pos_start + 1, pos_end - pos_start - 1);
- stacktrace_entry.resize(pos_start);
- stacktrace_entry += ": ";
+ std::string demangled_stacktrace_entry =
+ stacktrace_entry.substr(0, pos_start);
+ demangled_stacktrace_entry += ": ";
// demangle, and if successful replace old mangled string by
// unmangled one (skipping address and offset). treat "main"
realname.erase(realname.find(", boost::tuples::null_type>"),
std::string(", boost::tuples::null_type").size());
- stacktrace_entry += realname;
+ demangled_stacktrace_entry += realname;
}
else
- stacktrace_entry += functionname;
+ demangled_stacktrace_entry += functionname;
free(p);
#else
- stacktrace_entry += functionname;
+ demangled_stacktrace_entry += functionname;
#endif
// then output what we have
- out << stacktrace_entry << std::endl;
+ out << demangled_stacktrace_entry << std::endl;
// stop if we're in main()
if (functionname == "main")