Loading libbacktrace/UnwindStack.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ #include "UnwindStackMap.h" bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map, std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames) { std::vector<std::string> skip_names{"libunwindstack.so", "libbacktrace.so"}; std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames, std::vector<std::string>* skip_names) { UnwindStackMap* stack_map = reinterpret_cast<UnwindStackMap*>(back_map); auto process_memory = stack_map->process_memory(); unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(), regs, stack_map->process_memory()); unwinder.Unwind(&skip_names, &stack_map->GetSuffixesToIgnore()); unwinder.Unwind(skip_names, &stack_map->GetSuffixesToIgnore()); if (num_ignore_frames >= unwinder.NumFrames()) { frames->resize(0); Loading Loading @@ -104,7 +104,8 @@ bool UnwindStackCurrent::UnwindFromContext(size_t num_ignore_frames, ucontext_t* } error_ = BACKTRACE_UNWIND_NO_ERROR; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames); std::vector<std::string> skip_names{"libunwindstack.so", "libbacktrace.so"}; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, &skip_names); } UnwindStackPtrace::UnwindStackPtrace(pid_t pid, pid_t tid, BacktraceMap* map) Loading @@ -124,5 +125,5 @@ bool UnwindStackPtrace::Unwind(size_t num_ignore_frames, ucontext_t* context) { } error_ = BACKTRACE_UNWIND_NO_ERROR; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames); return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, nullptr); } libbacktrace/include/backtrace/Backtrace.h +2 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,8 @@ public: virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL) = 0; static bool Unwind(unwindstack::Regs* regs, BacktraceMap* back_map, std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames); std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames, std::vector<std::string>* skip_names); // Get the function name and offset into the function given the pc. // If the string is empty, then no valid function name was found, Loading Loading
libbacktrace/UnwindStack.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ #include "UnwindStackMap.h" bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map, std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames) { std::vector<std::string> skip_names{"libunwindstack.so", "libbacktrace.so"}; std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames, std::vector<std::string>* skip_names) { UnwindStackMap* stack_map = reinterpret_cast<UnwindStackMap*>(back_map); auto process_memory = stack_map->process_memory(); unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(), regs, stack_map->process_memory()); unwinder.Unwind(&skip_names, &stack_map->GetSuffixesToIgnore()); unwinder.Unwind(skip_names, &stack_map->GetSuffixesToIgnore()); if (num_ignore_frames >= unwinder.NumFrames()) { frames->resize(0); Loading Loading @@ -104,7 +104,8 @@ bool UnwindStackCurrent::UnwindFromContext(size_t num_ignore_frames, ucontext_t* } error_ = BACKTRACE_UNWIND_NO_ERROR; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames); std::vector<std::string> skip_names{"libunwindstack.so", "libbacktrace.so"}; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, &skip_names); } UnwindStackPtrace::UnwindStackPtrace(pid_t pid, pid_t tid, BacktraceMap* map) Loading @@ -124,5 +125,5 @@ bool UnwindStackPtrace::Unwind(size_t num_ignore_frames, ucontext_t* context) { } error_ = BACKTRACE_UNWIND_NO_ERROR; return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames); return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, nullptr); }
libbacktrace/include/backtrace/Backtrace.h +2 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,8 @@ public: virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL) = 0; static bool Unwind(unwindstack::Regs* regs, BacktraceMap* back_map, std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames); std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames, std::vector<std::string>* skip_names); // Get the function name and offset into the function given the pc. // If the string is empty, then no valid function name was found, Loading