Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04fdec0b authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Add demangling of function name.

Bug: 23762183

Test: Builds, unit tests pass.
Change-Id: Id49248a27d822db0f3837bfc0c20d004c55315fc
parent 12bd22ba
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@
#endif
#endif


#include <backtrace/Backtrace.h>
#include <backtrace/Backtrace.h>
#include <demangle.h>
#include <unwindstack/Elf.h>
#include <unwindstack/Elf.h>
#include <unwindstack/MapInfo.h>
#include <unwindstack/MapInfo.h>
#include <unwindstack/Maps.h>
#include <unwindstack/Maps.h>
@@ -110,7 +111,9 @@ static bool Unwind(pid_t pid, unwindstack::Memory* memory, unwindstack::Regs* re
      frame->map.name = map_info->name;
      frame->map.name = map_info->name;


      uint64_t func_offset = 0;
      uint64_t func_offset = 0;
      if (!elf->GetFunctionName(adjusted_rel_pc, &frame->func_name, &func_offset)) {
      if (elf->GetFunctionName(adjusted_rel_pc, &frame->func_name, &func_offset)) {
        frame->func_name = demangle(frame->func_name.c_str());
      } else {
        frame->func_name = "";
        frame->func_name = "";
      }
      }
      frame->func_offset = func_offset;
      frame->func_offset = func_offset;