From 329ed7dae49eba09bdf865dd999d1a7e73bb9687 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 1 May 2015 15:02:03 -0700 Subject: Add load base to map for relocation packing. The new linker relocation packing support uses non-zero load bases, so we better handle them properly. Also print out the load base for a map if it's non-zero. Bug: 20687795 Change-Id: Iec2d1db2051e7b4a278c1dfa57d745128a7f2974 --- include/backtrace/BacktraceMap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/backtrace/BacktraceMap.h b/include/backtrace/BacktraceMap.h index da96307..731c248 100644 --- a/include/backtrace/BacktraceMap.h +++ b/include/backtrace/BacktraceMap.h @@ -37,6 +37,7 @@ struct backtrace_map_t { uintptr_t start; uintptr_t end; + uintptr_t load_base; int flags; std::string name; }; @@ -82,6 +83,14 @@ public: return map.end > 0; } + static uintptr_t GetRelativePc(const backtrace_map_t& map, uintptr_t pc) { + if (IsValid(map)) { + return pc - map.start + map.load_base; + } else { + return pc; + } + } + protected: BacktraceMap(pid_t pid); -- cgit v1.1