Add offset to map data.

Also, print the offset in the maps section.

Bug: 20864928
Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61
(cherry picked from commit 5c8856854d)
This commit is contained in:
Christopher Ferris 2015-05-06 12:50:09 -07:00
parent ac725c12da
commit af67fb2475
3 changed files with 5 additions and 1 deletions

View file

@ -371,7 +371,8 @@ static void dump_all_maps(Backtrace* backtrace, BacktraceMap* map, log_t* log, p
} else {
line += '-';
}
line += android::base::StringPrintf(" %8" PRIxPTR, it->end - it->start);
line += android::base::StringPrintf(" %8" PRIxPTR " %8" PRIxPTR,
it->offset, it->end - it->start);
if (it->name.length() > 0) {
line += " " + it->name;
std::string build_id;

View file

@ -37,6 +37,7 @@ struct backtrace_map_t {
uintptr_t start;
uintptr_t end;
uintptr_t offset;
uintptr_t load_base;
int flags;
std::string name;

View file

@ -51,6 +51,7 @@ bool UnwindMap::GenerateMap() {
map.start = unw_map.start;
map.end = unw_map.end;
map.offset = unw_map.offset;
map.load_base = unw_map.load_base;
map.flags = unw_map.flags;
map.name = unw_map.path;
@ -92,6 +93,7 @@ bool UnwindMapLocal::GenerateMap() {
map.start = unw_map.start;
map.end = unw_map.end;
map.offset = unw_map.offset;
map.load_base = unw_map.load_base;
map.flags = unw_map.flags;
map.name = unw_map.path;