OSDN Git Service

ART: Avoid recursive abort on thread dump
authorAndreas Gampe <agampe@google.com>
Tue, 16 Sep 2014 22:15:13 +0000 (15:15 -0700)
committerAndreas Gampe <agampe@google.com>
Tue, 16 Sep 2014 22:17:31 +0000 (15:17 -0700)
Also clean up unused variable.

Bug: 15567083
Change-Id: Id83a3784bbe88520a4ffe654b2553d36a7b8e5bc

runtime/thread.cc

index 10688ff..9b37eb7 100644 (file)
@@ -942,7 +942,6 @@ struct StackDumpVisitor : public StackVisitor {
   std::ostream& os;
   const Thread* thread;
   const bool can_allocate;
-  mirror::ArtMethod* method;
   mirror::ArtMethod* last_method;
   int last_line_number;
   int repetition_count;
@@ -993,7 +992,7 @@ void Thread::DumpStack(std::ostream& os) const {
     // If we're currently in native code, dump that stack before dumping the managed stack.
     if (dump_for_abort || ShouldShowNativeStack(this)) {
       DumpKernelStack(os, GetTid(), "  kernel: ", false);
-      DumpNativeStack(os, GetTid(), "  native: ", GetCurrentMethod(nullptr));
+      DumpNativeStack(os, GetTid(), "  native: ", GetCurrentMethod(nullptr, !dump_for_abort));
     }
     DumpJavaStack(os);
   } else {