Skip to content

Commit

Permalink
folly symbolizer support for ROAR symbols
Browse files Browse the repository at this point in the history
Summary:
If folly is built under ROAR and the symbol has not been identified,
it is possible this symbol is in a JIT arena. Call the JIT asking to symbolize
that address.

Reviewed By: Gownta

Differential Revision: D65977988

fbshipit-source-id: e419447db796e362b179903f03d62efcaadaba1b
  • Loading branch information
rafaelauler authored and facebook-github-bot committed Nov 19, 2024
1 parent 33f5b67 commit 126e2bb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions folly/debugging/symbolizer/Symbolizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
#include <execinfo.h>
#endif

#ifdef __roar__
extern "C" char* _roar_upcall_symbolizeAddress(void* Address);
#endif

namespace folly {
namespace symbolizer {

Expand Down Expand Up @@ -110,6 +114,14 @@ void setSymbolizedFrame(
frame.addr = address;
frame.file = file;
frame.name = file->getSymbolName(file->getDefinitionByAddress(address));
#ifdef __roar__
if (!frame.name) {
char* jit_name =
_roar_upcall_symbolizeAddress(reinterpret_cast<void*>(address));
if (jit_name && jit_name[0] != '\0')
frame.name = jit_name;
}
#endif

Dwarf(elfCache, file.get())
.findAddress(address, mode, frame, extraInlineFrames);
Expand Down

0 comments on commit 126e2bb

Please sign in to comment.