FileDocCategorySizeDatePackage
VMStack.javaAPI DocAndroid 1.5 API2749Wed May 06 22:41:02 BST 2009dalvik.system

VMStack

public final class VMStack extends Object
Provides a limited interface to the Dalvik VM stack. This class is mostly used for implementing security checks.
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public static native java.lang.ClassLoadergetCallingClassLoader()
Returns the defining class loader of the caller's caller.

return
the requested class loader, or {@code null} if this is the bootstrap class loader.

public static native java.lang.ClassLoadergetCallingClassLoader2()
Returns the defining class loader of the caller's caller's caller.

return
the requested class loader, or {@code null} if this is the bootstrap class loader.

public static native java.lang.Class[]getClasses(int maxDepth, boolean stopAtPrivileged)
Creates 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.

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

public static native java.lang.StackTraceElement[]getThreadStackTrace(java.lang.Thread t)
Retrieves the stack trace from the specified thread.

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