summaryrefslogtreecommitdiff
path: root/debuggerd/libdebuggerd/utility.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2020-07-17 14:49:31 -0700
committerPeter Collingbourne <pcc@google.com>2020-07-17 17:35:49 -0700
commit10e428dd77181003942542d8de5c4615b693c610 (patch)
treea39bf752d803fba06954feb6e9bbafd54a346bc2 /debuggerd/libdebuggerd/utility.cpp
parentc8e4154d899847a32f0fb7bbf999c39c7cb0dba7 (diff)
Fix dumping of heap memory.
After r.android.com/1288984 we started failing to dump memory contents for heap addresses because the tag started causing any addresses to fail this bounds check. Add an untag_address() call to the bounds check so that the tag is ignored. Bug: 154272452 Change-Id: I3a6d1a078b21871bd93164150a123549f83289f6
Diffstat (limited to 'debuggerd/libdebuggerd/utility.cpp')
-rw-r--r--debuggerd/libdebuggerd/utility.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp
index c8a3431b7..0a491bbf6 100644
--- a/debuggerd/libdebuggerd/utility.cpp
+++ b/debuggerd/libdebuggerd/utility.cpp
@@ -135,6 +135,10 @@ void dump_memory(log_t* log, unwindstack::Memory* memory, uint64_t addr, const s
addr -= 32;
}
+ // We don't want the address tag to interfere with the bounds check below or appear in the
+ // addresses in the memory dump.
+ addr = untag_address(addr);
+
// Don't bother if the address looks too low, or looks too high.
if (addr < 4096 ||
#if defined(__LP64__)