RFR: JDK-8253001: [JVMCI] Add API for getting stacktraces independently of current thread
Doug Simon
dnsimon at openjdk.java.net
Wed Sep 23 20:26:11 UTC 2020
On Wed, 23 Sep 2020 20:10:37 GMT, Erik Ă–sterlund <eosterlund at openjdk.org> wrote:
>> @fisk @coleenp , it appears as though StackWalker can only be used for the current thread. Am I missing some other,
>> potentially internal, API that extends StackWalker to allow one thread to walk the stack of another thread?
>
> You are right; the java.lang.StackWalker does not have a thread parameter. If one is needed, I imagine we can add one
> (using a handshake). However, I was under the impression that only the debugger case needed this for other remote
> threads, in which case JVMTI seems like the natural solution. So yeah, is the non-debug case in need of remote stack
> traces with locals?
I'll let @chumer answer that question.
However, I have another one of my own. As far as I can see, the only use of `java.lang.LiveStackFrame` and
`java.lang.LiveStackFrameInfo` in the JDK code base are in the
[LocalsAndOperands](https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/test/jdk/java/lang/StackWalker/LocalsAndOperands.java)
test where they are used via reflection. Do you know if there are/were plans to make these classes public?
-------------
PR: https://git.openjdk.java.net/jdk/pull/110
More information about the hotspot-compiler-dev
mailing list