summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-03-31 23:01:28 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-31 23:01:28 +0000
commit7d4347389c0585e556e059594ae01266535b1511 (patch)
treeeb8eb4ac2bf5f4d0126f4347c74ec4a65166a4cc /include
parent6f8edc29c7ee194110864ad2c3a1f882c40125c0 (diff)
parent22790dfcfceebc537ffd3eb0a15fc0512f036091 (diff)
downloadsystem_core-7d4347389c0585e556e059594ae01266535b1511.zip
system_core-7d4347389c0585e556e059594ae01266535b1511.tar.gz
system_core-7d4347389c0585e556e059594ae01266535b1511.tar.bz2
am 22790dfc: am 246e9d50: am 9dc41d5d: Merge "Refactor the code."
* commit '22790dfcfceebc537ffd3eb0a15fc0512f036091': Refactor the code.
Diffstat (limited to 'include')
-rw-r--r--include/backtrace/Backtrace.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/include/backtrace/Backtrace.h b/include/backtrace/Backtrace.h
index 8c39acb..290682a 100644
--- a/include/backtrace/Backtrace.h
+++ b/include/backtrace/Backtrace.h
@@ -44,9 +44,6 @@ struct backtrace_frame_data_t {
uintptr_t func_offset; // pc relative to the start of the function, only valid if func_name is not NULL.
};
-// Forward declarations.
-class BacktraceImpl;
-
#if defined(__APPLE__)
struct __darwin_ucontext;
typedef __darwin_ucontext ucontext_t;
@@ -72,7 +69,7 @@ public:
virtual ~Backtrace();
// Get the current stack trace and store in the backtrace_ structure.
- virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL);
+ virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL) = 0;
// Get the function name and offset into the function given the pc.
// If the string is empty, then no valid function name was found.
@@ -95,9 +92,9 @@ public:
virtual std::string FormatFrameData(size_t frame_num);
virtual std::string FormatFrameData(const backtrace_frame_data_t* frame);
- pid_t Pid() { return pid_; }
- pid_t Tid() { return tid_; }
- size_t NumFrames() { return frames_.size(); }
+ pid_t Pid() const { return pid_; }
+ pid_t Tid() const { return tid_; }
+ size_t NumFrames() const { return frames_.size(); }
const backtrace_frame_data_t* GetFrame(size_t frame_num) {
if (frame_num >= frames_.size()) {
@@ -117,7 +114,11 @@ public:
BacktraceMap* GetMap() { return map_; }
protected:
- Backtrace(BacktraceImpl* impl, pid_t pid, BacktraceMap* map);
+ Backtrace(pid_t pid, pid_t tid, BacktraceMap* map);
+
+ // The name returned is not demangled, GetFunctionName() takes care of
+ // demangling the name.
+ virtual std::string GetFunctionNameRaw(uintptr_t pc, uintptr_t* offset) = 0;
virtual bool VerifyReadWordArgs(uintptr_t ptr, word_t* out_value);
@@ -130,10 +131,6 @@ protected:
bool map_shared_;
std::vector<backtrace_frame_data_t> frames_;
-
- BacktraceImpl* impl_;
-
- friend class BacktraceImpl;
};
#endif // _BACKTRACE_BACKTRACE_H