'Map' symbols: add pgoff to disambiguate multiple mappings on same object.

PiperOrigin-RevId: 391520785
Change-Id: Icb05e60f778acfb9fe6f519911ce54bec65fc4ff
This commit is contained in:
Catalin Patulea 2021-08-18 07:13:45 -07:00 committed by Copybara-Service
parent 59f5fa8042
commit 9ab330dc7a

View File

@ -100,7 +100,11 @@ absl::StatusOr<std::map<uint64_t, std::string>> LoadSymbolsMap(pid_t pid) {
// The maps entries are ordered and thus sorted with increasing adresses. // The maps entries are ordered and thus sorted with increasing adresses.
// This means if there is a symbol @ entry.end, it will be overwritten in // This means if there is a symbol @ entry.end, it will be overwritten in
// the next iteration. // the next iteration.
addr_to_symbol[entry.start] = absl::StrCat("map:", entry.path); std::string map = absl::StrCat("map:", entry.path);
if (entry.pgoff) {
absl::StrAppend(&map, "+0x%x", entry.pgoff);
}
addr_to_symbol[entry.start] = map;
addr_to_symbol[entry.end] = ""; addr_to_symbol[entry.end] = "";
absl::StatusOr<ElfFile> elf = absl::StatusOr<ElfFile> elf =