summaryrefslogtreecommitdiff
path: root/libunwindstack/Elf.cpp
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-05-13 00:52:56 +0100
committerDavid Srbecky <dsrbecky@google.com>2021-05-13 01:45:48 +0100
commit5150e1292ec6b16e4717e86b9e3cfb855eec18a3 (patch)
treea3b39c1f399f4984d1bffd72cdab21bda6833730 /libunwindstack/Elf.cpp
parent01372e33617b21f71b45dc843e6af0dd56df8a54 (diff)
downloadunwinding-5150e1292ec6b16e4717e86b9e3cfb855eec18a3.tar.gz
MapInfo: Add set accessors for the fields
This properly encapsulates all MapInfo fields, and changes MapInfo from struct to class. Test: libunwindstack_unit_test Change-Id: I2a07d1a83702267c8af3960279694d25d3c779f1
Diffstat (limited to 'libunwindstack/Elf.cpp')
-rw-r--r--libunwindstack/Elf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libunwindstack/Elf.cpp b/libunwindstack/Elf.cpp
index 4dec11e..b52d294 100644
--- a/libunwindstack/Elf.cpp
+++ b/libunwindstack/Elf.cpp
@@ -401,7 +401,7 @@ bool Elf::CacheAfterCreateMemory(MapInfo* info) {
// In this case, the whole file is the elf, and the name has already
// been cached. Add an entry at name:offset to get this directly out
// of the cache next time.
- info->elf_ = entry->second.first;
+ info->set_elf(entry->second.first);
std::string key = std::string(info->name()) + ':' + std::to_string(info->offset());
(*cache_)[key] = std::make_pair(info->elf(), true);
return true;
@@ -414,9 +414,9 @@ bool Elf::CacheGet(MapInfo* info) {
}
auto entry = cache_->find(name);
if (entry != cache_->end()) {
- info->elf_ = entry->second.first;
+ info->set_elf(entry->second.first);
if (entry->second.second) {
- info->elf_offset_ = info->offset();
+ info->set_elf_offset(info->offset());
}
return true;
}