summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-01-28 21:23:50 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-28 21:23:50 +0000
commitd391c9b4acb2bcd6cec048075e728d3aee6a0d6f (patch)
treec811c4a561ef19686b393ea4f5c296c2bd73e896 /include
parentd2acdd82e613b3e1d79a00943ac3bf5fbc14a766 (diff)
parentdf2906186b6952c57b1f662bfef0b65c9f8c2e0d (diff)
downloadsystem_core-d391c9b4acb2bcd6cec048075e728d3aee6a0d6f.zip
system_core-d391c9b4acb2bcd6cec048075e728d3aee6a0d6f.tar.gz
system_core-d391c9b4acb2bcd6cec048075e728d3aee6a0d6f.tar.bz2
Merge "Re-enable libunwind for arm."
Diffstat (limited to 'include')
-rw-r--r--include/backtrace/Backtrace.h4
-rw-r--r--include/backtrace/BacktraceMap.h13
2 files changed, 8 insertions, 9 deletions
diff --git a/include/backtrace/Backtrace.h b/include/backtrace/Backtrace.h
index f0fb0cd..bd4134c 100644
--- a/include/backtrace/Backtrace.h
+++ b/include/backtrace/Backtrace.h
@@ -64,10 +64,6 @@ public:
// Find the map associated with the given pc.
virtual const backtrace_map_t* FindMap(uintptr_t pc);
- // Take ownership of the BacktraceMap object associated with the backtrace.
- // If this is called, the caller must handle deleting the object themselves.
- virtual BacktraceMap* TakeMapOwnership();
-
// Read the data at a specific address.
virtual bool ReadWord(uintptr_t ptr, uint32_t* out_value) = 0;
diff --git a/include/backtrace/BacktraceMap.h b/include/backtrace/BacktraceMap.h
index a53293a..06da2f4 100644
--- a/include/backtrace/BacktraceMap.h
+++ b/include/backtrace/BacktraceMap.h
@@ -28,8 +28,8 @@
#include <sys/mman.h>
#endif
+#include <deque>
#include <string>
-#include <vector>
struct backtrace_map_t {
uintptr_t start;
@@ -40,7 +40,8 @@ struct backtrace_map_t {
class BacktraceMap {
public:
- BacktraceMap(pid_t pid);
+ static BacktraceMap* Create(pid_t pid);
+
virtual ~BacktraceMap();
// Get the map data structure for the given address.
@@ -60,20 +61,22 @@ public:
bool IsWritable(uintptr_t pc) { return GetFlags(pc) & PROT_WRITE; }
bool IsExecutable(uintptr_t pc) { return GetFlags(pc) & PROT_EXEC; }
- typedef std::vector<backtrace_map_t>::iterator iterator;
+ typedef std::deque<backtrace_map_t>::iterator iterator;
iterator begin() { return maps_.begin(); }
iterator end() { return maps_.end(); }
- typedef std::vector<backtrace_map_t>::const_iterator const_iterator;
+ typedef std::deque<backtrace_map_t>::const_iterator const_iterator;
const_iterator begin() const { return maps_.begin(); }
const_iterator end() const { return maps_.end(); }
virtual bool Build();
protected:
+ BacktraceMap(pid_t pid);
+
virtual bool ParseLine(const char* line, backtrace_map_t* map);
- std::vector<backtrace_map_t> maps_;
+ std::deque<backtrace_map_t> maps_;
pid_t pid_;
};