MCPcopy Create free account
hub / github.com/apache/brpc / FindSymbol

Method FindSymbol

src/butil/debug/stack_trace_posix.cc:788–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786}
787
788bool StackTrace::FindSymbol(void* symbol) const {
789#if !defined(__UCLIBC__)
790 for (size_t i = 0; i < count_; ++i) {
791 uint64_t saddr;
792 // Subtract by one as return address of function may be in the next
793 // function when a function is annotated as noreturn.
794 void* address = static_cast<char*>(trace_[i]) - 1;
795 if (!google::SymbolizeAddress(address, &saddr)) {
796 continue;
797 }
798 if ((void*)saddr == symbol) {
799 return true;
800 }
801 }
802#endif
803 return false;
804}
805
806void StackTrace::Print() const {
807 // NOTE: This code MUST be async-signal safe (it's used by in-process

Callers 2

TestFindSymbol1Function · 0.80
submit_contentionFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestFindSymbol1Function · 0.64