Android
dalvik.system
public final class

dalvik.system.VMStack

java.lang.Object
dalvik.system.VMStack

VM-internal classes for examining a stack.

Summary

Public Constructors

            VMStack()

Public Methods

      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

Details

Public Constructors

public VMStack()

Public Methods

public static ClassLoader getCallingClassLoader()

Return the defining class loader of the caller's caller.

public static ClassLoader getCallingClassLoader2()

Return the defining class loader of the caller's caller's caller.

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

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)
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48