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/BacktraceCurrent.h b/libbacktrace/BacktraceCurrent.h
index 8aad36d..072ffd2 100644
--- a/libbacktrace/BacktraceCurrent.h
+++ b/libbacktrace/BacktraceCurrent.h
@@ -36,7 +36,7 @@
class BacktraceMap;
class BacktraceCurrent : public Backtrace {
-public:
+ public:
BacktraceCurrent(pid_t pid, pid_t tid, BacktraceMap* map) : Backtrace(pid, tid, map) {}
virtual ~BacktraceCurrent() {}
@@ -46,10 +46,10 @@
bool Unwind(size_t num_ignore_frames, ucontext_t* ucontext) override;
-protected:
+ protected:
bool DiscardFrame(const backtrace_frame_data_t& frame);
-private:
+ private:
bool UnwindThread(size_t num_ignore_frames);
virtual bool UnwindFromContext(size_t num_ignore_frames, ucontext_t* ucontext) = 0;