diff options
author | Christopher Ferris <cferris@google.com> | 2018-01-19 23:30:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-19 23:30:33 +0000 |
commit | e20b4a48fee974901e73039f6add426df857e3de (patch) | |
tree | 8818fbffe638b0523535829829e047a6ca0ec82b /libbacktrace/include | |
parent | b6d7f2655d19f8de30b3957a12715afddf7fc522 (diff) | |
parent | 7937a36c8e24ef2dc5105a2a6b67f395934b2e2f (diff) | |
download | system_core-e20b4a48fee974901e73039f6add426df857e3de.tar.gz system_core-e20b4a48fee974901e73039f6add426df857e3de.tar.bz2 system_core-e20b4a48fee974901e73039f6add426df857e3de.zip |
Merge "Change all uintptr_t to uint64_t in API."
Diffstat (limited to 'libbacktrace/include')
-rw-r--r-- | libbacktrace/include/backtrace/Backtrace.h | 27 | ||||
-rw-r--r-- | libbacktrace/include/backtrace/BacktraceMap.h | 22 |
2 files changed, 25 insertions, 24 deletions
diff --git a/libbacktrace/include/backtrace/Backtrace.h b/libbacktrace/include/backtrace/Backtrace.h index f34fb2d5f..1b8ad19e3 100644 --- a/libbacktrace/include/backtrace/Backtrace.h +++ b/libbacktrace/include/backtrace/Backtrace.h @@ -26,11 +26,11 @@ #include <backtrace/backtrace_constants.h> #include <backtrace/BacktraceMap.h> -#if __LP64__ -#define PRIPTR "016" PRIxPTR +#if defined(__LP64__) +#define PRIPTR "016" PRIx64 typedef uint64_t word_t; #else -#define PRIPTR "08" PRIxPTR +#define PRIPTR "08" PRIx64 typedef uint32_t word_t; #endif @@ -77,14 +77,15 @@ struct BacktraceUnwindError { struct backtrace_frame_data_t { size_t num; // The current fame number. - uintptr_t pc; // The absolute pc. - uintptr_t rel_pc; // The relative pc. - uintptr_t sp; // The top of the stack. + uint64_t pc; // The absolute pc. + uint64_t rel_pc; // The relative pc. + uint64_t sp; // The top of the stack. size_t stack_size; // The size of the stack, zero indicate an unknown stack size. uint64_t dex_pc; // If non-zero, the Dex PC for the ART interpreter. backtrace_map_t map; // The map associated with the given pc. std::string func_name; // The function name associated with this pc, NULL if not found. - uintptr_t func_offset; // pc relative to the start of the function, only valid if func_name is not NULL. + uint64_t func_offset; // pc relative to the start of the function, only valid if func_name is not + // NULL. }; #if defined(__APPLE__) @@ -139,20 +140,20 @@ public: // Get the function name and offset into the function given the pc. // If the string is empty, then no valid function name was found, // or the pc is not in any valid map. - virtual std::string GetFunctionName(uintptr_t pc, uintptr_t* offset, + virtual std::string GetFunctionName(uint64_t pc, uint64_t* offset, const backtrace_map_t* map = NULL); // Fill in the map data associated with the given pc. - virtual void FillInMap(uintptr_t pc, backtrace_map_t* map); + virtual void FillInMap(uint64_t pc, backtrace_map_t* map); // Read the data at a specific address. - virtual bool ReadWord(uintptr_t ptr, word_t* out_value) = 0; + virtual bool ReadWord(uint64_t ptr, word_t* out_value) = 0; // Read arbitrary data from a specific address. If a read request would // span from one map to another, this call only reads up until the end // of the current map. // Returns the total number of bytes actually read. - virtual size_t Read(uintptr_t addr, uint8_t* buffer, size_t bytes) = 0; + virtual size_t Read(uint64_t addr, uint8_t* buffer, size_t bytes) = 0; // Create a string representing the formatted line of backtrace information // for a single frame. @@ -189,9 +190,9 @@ protected: // 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 std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset) = 0; - virtual bool VerifyReadWordArgs(uintptr_t ptr, word_t* out_value); + virtual bool VerifyReadWordArgs(uint64_t ptr, word_t* out_value); bool BuildMap(); diff --git a/libbacktrace/include/backtrace/BacktraceMap.h b/libbacktrace/include/backtrace/BacktraceMap.h index 4ae68dde0..4d020e6ad 100644 --- a/libbacktrace/include/backtrace/BacktraceMap.h +++ b/libbacktrace/include/backtrace/BacktraceMap.h @@ -39,10 +39,10 @@ static constexpr int PROT_DEVICE_MAP = 0x8000; struct backtrace_map_t { - uintptr_t start = 0; - uintptr_t end = 0; - uintptr_t offset = 0; - uintptr_t load_bias = 0; + uint64_t start = 0; + uint64_t end = 0; + uint64_t offset = 0; + uint64_t load_bias = 0; int flags = 0; std::string name; }; @@ -91,7 +91,7 @@ public: return nullptr; } backtrace_map_t* map = &map_->maps_[index_]; - if (map->load_bias == static_cast<uintptr_t>(-1)) { + if (map->load_bias == static_cast<uint64_t>(-1)) { map->load_bias = map_->GetLoadBias(index_); } return map; @@ -106,15 +106,15 @@ public: iterator end() { return iterator(this, maps_.size()); } // Fill in the map data structure for the given address. - virtual void FillIn(uintptr_t addr, backtrace_map_t* map); + virtual void FillIn(uint64_t addr, backtrace_map_t* map); // Only supported with the new unwinder. - virtual std::string GetFunctionName(uintptr_t /*pc*/, uintptr_t* /*offset*/) { return ""; } + virtual std::string GetFunctionName(uint64_t /*pc*/, uint64_t* /*offset*/) { return ""; } virtual std::shared_ptr<unwindstack::Memory> GetProcessMemory() { return nullptr; } // The flags returned are the same flags as used by the mmap call. // The values are PROT_*. - int GetFlags(uintptr_t pc) { + int GetFlags(uint64_t pc) { backtrace_map_t map; FillIn(pc, &map); if (IsValid(map)) { @@ -123,9 +123,9 @@ public: return PROT_NONE; } - bool IsReadable(uintptr_t pc) { return GetFlags(pc) & PROT_READ; } - bool IsWritable(uintptr_t pc) { return GetFlags(pc) & PROT_WRITE; } - bool IsExecutable(uintptr_t pc) { return GetFlags(pc) & PROT_EXEC; } + bool IsReadable(uint64_t pc) { return GetFlags(pc) & PROT_READ; } + bool IsWritable(uint64_t pc) { return GetFlags(pc) & PROT_WRITE; } + bool IsExecutable(uint64_t pc) { return GetFlags(pc) & PROT_EXEC; } // In order to use the iterators on this object, a caller must // call the LockIterator and UnlockIterator function to guarantee |