diff options
author | Christopher Ferris <cferris@google.com> | 2019-01-16 17:23:39 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-01-17 20:14:00 -0800 |
commit | bf373edc3c12a6e6df91770fde36075cc9d3e257 (patch) | |
tree | f0281cb2e53007d0ef9b3c2455db292da53dc234 /libunwindstack/tools | |
parent | b94c2e52a674d43705045d0662e6a427aee2e873 (diff) | |
download | system_core-bf373edc3c12a6e6df91770fde36075cc9d3e257.tar.gz system_core-bf373edc3c12a6e6df91770fde36075cc9d3e257.tar.bz2 system_core-bf373edc3c12a6e6df91770fde36075cc9d3e257.zip |
Add caching of build id in MapInfo object.
Change the GetBuildID function to return a std::string.
Added benchmark to check how long it takes to get the build id from
a file versus an elf object.
Added a way to get an elf without passing in a valid process_memory and
added tests for this.
Test: New unit tests.
Change-Id: I3029019767e0181c758d611fe635bc1bf72d6e8e
Diffstat (limited to 'libunwindstack/tools')
-rw-r--r-- | libunwindstack/tools/unwind_info.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libunwindstack/tools/unwind_info.cpp b/libunwindstack/tools/unwind_info.cpp index 3f2dfb07d..3f5b88ba8 100644 --- a/libunwindstack/tools/unwind_info.cpp +++ b/libunwindstack/tools/unwind_info.cpp @@ -123,8 +123,8 @@ int GetElfInfo(const char* file, uint64_t offset) { printf("Soname: %s\n", soname.c_str()); } - std::string build_id; - if (elf.GetBuildID(&build_id)) { + std::string build_id = elf.GetBuildID(); + if (!build_id.empty()) { printf("Build ID: "); for (size_t i = 0; i < build_id.size(); ++i) { printf("%02hhx", build_id[i]); |