Build 1.0_r1(from source)

dalvik.system
Class VMStack

java.lang.Object
  extended by dalvik.system.VMStack

public final class VMStack
extends Object

VM-internal classes for examining a stack.


Constructor Summary
VMStack()
           
 
Method Summary
static ClassLoader getCallingClassLoader()
          Return the defining class loader of the caller's caller.
static ClassLoader getCallingClassLoader2()
          Return the defining class loader of the caller's caller's caller.
static Class<?>[] getClasses(int maxDepth, boolean stopAtPrivileged)
          Create an array of classes from the methods at the top of the stack.
static StackTraceElement[] getThreadStackTrace(Thread t)
          Retrieve the stack trace from the specified thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMStack

public VMStack()
Method Detail

getCallingClassLoader

public static ClassLoader getCallingClassLoader()
Return the defining class loader of the caller's caller.


getCallingClassLoader2

public static ClassLoader getCallingClassLoader2()
Return the defining class loader of the caller's caller's caller.


getClasses

public static Class<?>[] getClasses(int maxDepth,
                                    boolean stopAtPrivileged)
Create an array of classes from the methods at the top of the stack. We continue until we reach the bottom of the stack or exceed the specified maximum depth. If stopAtPrivileged is set, the last element of the array will be the caller of the most-recent privileged method. The topmost stack frame (this method) and the one above that (the caller) are excluded from the array. Frames with java.lang.reflect classes are skipped over. The classes in the array are the defining classes of the methods. This is expected to be identical to Harmony's VMStack.getClasses.

Parameters:
maxDepth - maximum number of classes to return, or -1 for all
stopAtPrivileged - stop when a privileged frame is reached
Returns:
an array with classes for the most-recent methods on the stack

getThreadStackTrace

public static StackTraceElement[] getThreadStackTrace(Thread t)
Retrieve the stack trace from the specified thread.

Parameters:
t - thread of interest
Returns:
an array of stack trace elements, or null if the thread doesn't have a stack trace (e.g. because it exited)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature