Allow calling GetFunctionName before unwinding.
Some extra initialization needs to occur before calling the local/remote
GetFunctioneName.
Also, cleanup the test code a bit:
- Make all local functions static.
- Create a common function to create and finish remote processes.
- Remove unused function.
- Fix the formatting a bit by making it match clang format.
Test: Ran the unit tests.
Change-Id: I998bed1378d582df59fdf9263df6f208db5d795a
diff --git a/libbacktrace/UnwindPtrace.h b/libbacktrace/UnwindPtrace.h
index ab04abf..4688110 100644
--- a/libbacktrace/UnwindPtrace.h
+++ b/libbacktrace/UnwindPtrace.h
@@ -30,7 +30,7 @@
#include "BacktracePtrace.h"
class UnwindPtrace : public BacktracePtrace {
-public:
+ public:
UnwindPtrace(pid_t pid, pid_t tid, BacktraceMap* map);
virtual ~UnwindPtrace();
@@ -38,7 +38,9 @@
std::string GetFunctionNameRaw(uintptr_t pc, uintptr_t* offset) override;
-private:
+ private:
+ bool Init();
+
unw_addr_space_t addr_space_;
struct UPT_info* upt_info_;
};