diff options
| author | Elliott Hughes <enh@google.com> | 2018-02-15 09:18:21 -0800 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2018-02-15 16:28:50 -0800 |
| commit | 04364c84fb868ff2225357fc001d2d22fbf5b770 (patch) | |
| tree | 93490451128e77d8f3a6fd3dcfb01c84975ef31d /debuggerd/libdebuggerd/utility.cpp | |
| parent | 2a49d5936bb71ea8863590d0898759a79be7e535 (diff) | |
Include the map name when dumping memory around a register.
Bug: http://b/19590178
Test: ran tests, ran crasher
Change-Id: Ib9afa34c860d8732ef1943eb4decd0b7c8fb55fd
Diffstat (limited to 'debuggerd/libdebuggerd/utility.cpp')
| -rw-r--r-- | debuggerd/libdebuggerd/utility.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp index 3ac98f58f2..d1538653d3 100644 --- a/debuggerd/libdebuggerd/utility.cpp +++ b/debuggerd/libdebuggerd/utility.cpp @@ -124,13 +124,7 @@ void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { #define MEMORY_BYTES_TO_DUMP 256 #define MEMORY_BYTES_PER_LINE 16 -void dump_memory(log_t* log, unwindstack::Memory* memory, uint64_t addr, const char* fmt, ...) { - std::string log_msg; - va_list ap; - va_start(ap, fmt); - android::base::StringAppendV(&log_msg, fmt, ap); - va_end(ap); - +void dump_memory(log_t* log, unwindstack::Memory* memory, uint64_t addr, const std::string& label) { // Align the address to sizeof(long) and start 32 bytes before the address. addr &= ~(sizeof(long) - 1); if (addr >= 4128) { @@ -147,7 +141,7 @@ void dump_memory(log_t* log, unwindstack::Memory* memory, uint64_t addr, const c return; } - _LOG(log, logtype::MEMORY, "\n%s\n", log_msg.c_str()); + _LOG(log, logtype::MEMORY, "\n%s:\n", label.c_str()); // Dump 256 bytes uintptr_t data[MEMORY_BYTES_TO_DUMP/sizeof(uintptr_t)]; |
