Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/stabs_to_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@
#include <utility>

#include "common/stabs_to_module.h"
#include "common/language.h"

namespace google_breakpad {

// Demangle using abi call.
// Older GCC may not support it.
static std::string Demangle(const std::string& mangled) {
if (!Language::IsMangledName(mangled))
return mangled;

int status = 0;
char *demangled = abi::__cxa_demangle(
mangled.c_str(), nullptr, nullptr, &status);
Expand Down
8 changes: 7 additions & 1 deletion src/common/stabs_to_module_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,15 @@ TEST(FunctionNames, Mangled) {
Module::Function *function = functions[0];
// This is GCC-specific, but we shouldn't be seeing STABS data anywhere
// but Linux.
#ifdef _WIN32
#define WHITESPACE_REGEX "\\s"
#else
#define WHITESPACE_REGEX "[[:space:]]"
#endif
EXPECT_THAT(function->name.str(), ::testing::ContainsRegex(
"std::vector<unsigned long long, std::allocator<unsigned long long>\\s?>::"
"std::vector<unsigned long long, std::allocator<unsigned long long>" WHITESPACE_REGEX "?>::"
"push_back\\(unsigned long long const&\\)"));
#undef WHITESPACE_REGEX
EXPECT_EQ(0xf2cfda63cef7f46dLL, function->address);
EXPECT_LT(0U, function->ranges[0].size); // should have used dummy size
EXPECT_EQ(0U, function->parameter_size);
Expand Down