libfoedus-core
FOEDUS Core Library
foedus::assorted::BacktraceContext::GlibcBacktraceInfo Struct Reference

Detailed Description

Definition at line 40 of file rich_backtrace.cpp.

Collaboration diagram for foedus::assorted::BacktraceContext::GlibcBacktraceInfo:

Public Member Functions

void parse_symbol ()
 

Public Attributes

void * address_
 
std::string symbol_
 
std::string function_
 
std::string binary_path_
 
std::string function_offset_
 

Member Function Documentation

void foedus::assorted::BacktraceContext::GlibcBacktraceInfo::parse_symbol ( )

Definition at line 141 of file rich_backtrace.cpp.

References binary_path_, foedus::assorted::demangle_type_name(), function_, function_offset_, and symbol_.

Referenced by foedus::assorted::BacktraceContext::call_glibc_backtrace().

141  {
142  // Case 1: /foo/hoge/test_dummy(_ZN6foedus5func3Ev+0x9) [0x43e479]
143  // Case 2: /foo/hoge/libfoedus-core.so(+0x3075a5) [0x7f1b6b8b05a5]
144  // Case 3: /lib64/libpthread.so.0() [0x3d1ee0ef90]
145  // Case 4: /lib64/libc.so.6(abort+0x148) [0x3d1e6370f8]
146  std::size_t pos = symbol_.find("(");
147  std::size_t pos2 = symbol_.find(")");
148  if (pos == std::string::npos || pos2 == std::string::npos || pos >= pos2) {
149  return;
150  }
151 
152  binary_path_ = symbol_.substr(0, pos);
153  if (pos2 == pos + 1) { // "()"
154  } else if (symbol_[pos + 1] == '+') {
155  function_offset_ = symbol_.substr(pos + 2, pos2 - pos - 2);
156  } else {
157  std::size_t plus = symbol_.find("+", pos);
158  if (plus == std::string::npos || plus > pos2) {
159  } else {
160  std::string mangled = symbol_.substr(pos + 1, plus - pos - 1);
161  function_ = demangle_type_name(mangled.c_str());
162  function_offset_ = symbol_.substr(plus + 1, pos2 - plus - 1);
163  }
164  }
165 }
std::string demangle_type_name(const char *mangled_name)
Demangle the given C++ type name if possible (otherwise the original string).

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

void* foedus::assorted::BacktraceContext::GlibcBacktraceInfo::address_
std::string foedus::assorted::BacktraceContext::GlibcBacktraceInfo::binary_path_
std::string foedus::assorted::BacktraceContext::GlibcBacktraceInfo::function_
std::string foedus::assorted::BacktraceContext::GlibcBacktraceInfo::function_offset_

Definition at line 45 of file rich_backtrace.cpp.

Referenced by parse_symbol().

std::string foedus::assorted::BacktraceContext::GlibcBacktraceInfo::symbol_

The documentation for this struct was generated from the following file: