diff options
-rw-r--r-- | debuggerd/libdebuggerd/tombstone.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp index 50d19bd1d..f5ecf48c5 100644 --- a/debuggerd/libdebuggerd/tombstone.cpp +++ b/debuggerd/libdebuggerd/tombstone.cpp | |||
@@ -800,10 +800,22 @@ void engrave_tombstone_ucontext(int tombstone_fd, uintptr_t abort_msg_address, s | |||
800 | dump_abort_message(backtrace.get(), &log, abort_msg_address); | 800 | dump_abort_message(backtrace.get(), &log, abort_msg_address); |
801 | dump_registers(&log, ucontext); | 801 | dump_registers(&log, ucontext); |
802 | 802 | ||
803 | // TODO: Dump registers from the ucontext. | ||
804 | if (backtrace->Unwind(0, ucontext)) { | 803 | if (backtrace->Unwind(0, ucontext)) { |
805 | dump_backtrace_and_stack(backtrace.get(), &log); | 804 | dump_backtrace_and_stack(backtrace.get(), &log); |
806 | } else { | 805 | } else { |
807 | ALOGE("Unwind failed: pid = %d, tid = %d", pid, tid); | 806 | ALOGE("Unwind failed: pid = %d, tid = %d", pid, tid); |
808 | } | 807 | } |
808 | |||
809 | // TODO: Make this match the format of dump_all_maps above. | ||
810 | _LOG(&log, logtype::MAPS, "memory map:\n"); | ||
811 | android::base::unique_fd maps_fd(open("/proc/self/maps", O_RDONLY | O_CLOEXEC)); | ||
812 | if (maps_fd == -1) { | ||
813 | _LOG(&log, logtype::MAPS, " failed to open /proc/self/maps: %s", strerror(errno)); | ||
814 | } else { | ||
815 | char buf[256]; | ||
816 | ssize_t rc; | ||
817 | while ((rc = TEMP_FAILURE_RETRY(read(maps_fd.get(), buf, sizeof(buf)))) > 0) { | ||
818 | android::base::WriteFully(tombstone_fd, buf, rc); | ||
819 | } | ||
820 | } | ||
809 | } | 821 | } |