[vmkit-commits] [vmkit] r85564 - /vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Oct 29 18:48:31 PDT 2009


Author: geoffray
Date: Thu Oct 29 20:48:30 2009
New Revision: 85564

URL: http://llvm.org/viewvc/llvm-project?rev=85564&view=rev
Log:
Better handling of thread's last SP when printing stacktrace.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=85564&r1=85563&r2=85564&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Thu Oct 29 20:48:30 2009
@@ -298,8 +298,14 @@
 void JavaThread::printBacktrace() {
   std::vector<void*>::iterator it = addresses.end();
   Jnjvm* vm = getJVM();
+  mvm::Thread* th = mvm::Thread::get();
+
+  assert((th == this || getLastSP()) && "No last sp on foreign thread");
+  
+  void** addr = mvm::Thread::get() == th ? 
+    (void**)FRAME_PTR() : (void**)th->getLastSP();
+  assert(addr && "No address to start with");
 
-  void** addr = getLastSP() ? (void**)getLastSP() : (void**)FRAME_PTR();
   void** oldAddr = addr;
 
   // Loop until we cross the first Java frame.





More information about the vmkit-commits mailing list