ART: additional info SIGILL
Bug: 65412375
Test: art/test/run-test --host --jit 708 && killall -SIGILL dalvikvm
Change-Id: Iaa5f8b6729356f33dfbfe19f11876fe2e99aefdf
diff --git a/runtime/runtime_common.cc b/runtime/runtime_common.cc
index 940e461..f8e9442 100644
--- a/runtime/runtime_common.cc
+++ b/runtime/runtime_common.cc
@@ -416,8 +416,19 @@
<< "Cmdline: " << cmd_line << std::endl
<< "Thread: " << tid << " \"" << thread_name << "\"" << std::endl
<< "Registers:\n" << Dumpable<UContext>(thread_context) << std::endl
- << "Backtrace:\n" << Dumpable<Backtrace>(thread_backtrace) << std::endl;
- stream << std::flush;
+ << "Backtrace:\n" << Dumpable<Backtrace>(thread_backtrace);
+ if (signal_number == SIGILL) {
+ // Note the view we present is from the d-cache, which should
+ // match the i-cache if all is well.
+ static const size_t kCodeSnippetBytes = 16;
+ stream << "Code:\n\t" << info->si_addr << ":";
+ uintptr_t start = reinterpret_cast<uintptr_t>(info->si_addr);
+ uintptr_t end = std::min(start + kCodeSnippetBytes, RoundUp(start, kPageSize));
+ for (uintptr_t addr = start; addr != end; ++addr) {
+ stream << StringPrintf(" %02x", *(reinterpret_cast<const uint8_t*>(addr)));
+ }
+ }
+ stream << std::endl << std::flush;
};
if (dump_on_stderr) {
diff --git a/runtime/runtime_common.h b/runtime/runtime_common.h
index 06d6627..1248fe0 100644
--- a/runtime/runtime_common.h
+++ b/runtime/runtime_common.h
@@ -30,6 +30,7 @@
#include <iomanip>
+#include "base/bit_utils.h"
#include "base/dumpable.h"
#include "native_stack_dump.h"
#include "utils.h"