inspect a thread’s stack

2018-04-06 Thread Pietro Paolini
couldn’t find a way examples where their usage is shown without connecting to the VM somehow, like a debugger would do. Is it possible to inspect a thread’s stack “locally” ? In my mind I could be able to have a function such as : static void hook(Thread thread) { thread.wait() // stop that

Re: inspect a thread’s stack

2018-04-06 Thread Martin Skarsaune
amples where their usage is shown > > without connecting to the VM somehow, like a debugger would do. > > > > Is it possible to > > > > inspect a thread’s stack “locally” ? In my mind I could be able to have a > function such as : > > > > static void hook(Thread

Re: inspect a thread’s stack

2018-04-07 Thread Andrew Haley
On 04/06/2018 05:13 PM, Pietro Paolini wrote: > Is it possible to > > inspect a thread’s stack “locally” ? Have you looked at ThreadMXBean.getThreadInfo(id).getStackTrace() ? -- Andrew Haley Java Platform Lead Engineer Red Hat UK Ltd. <https://www.redhat.com> EAC8 43EB D3EF

Re: inspect a thread’s stack

2018-04-08 Thread Martin Buchholz
Access to stacktraces with locals is demoed in this test http://hg.openjdk.java.net/jdk/jdk/file/tip/test/jdk/java/lang/StackWalker/LocalsAndOperands.java but the functionality does not seem to be available (yet!) via a public API.

RE: inspect a thread’s stack

2018-04-09 Thread Pietro Paolini
to inspect the stack-frame of a specific  thread, I came across the StackFrame/ThreadReference classes but I couldn’t find a way examples where their usage is shown without connecting to the VM somehow, like a debugger would do.   Is it possible to   inspect a thread’s stack “locally”  ? In my

RE: inspect a thread’s stack

2018-04-09 Thread Pietro Paolini
>Access to stacktraces with locals is demoed in this test >http://hg.openjdk.java.net/jdk/jdk/file/tip/test/jdk/java/lang/StackWalker/LocalsAndOperands.java Maybe I haven't read it well enough but isn't that accessible through https://docs.oracle.com/javase/9/docs/api/java/lang/StackWalker.html

Re: inspect a thread’s stack

2018-04-09 Thread JC Beyler
I think the conversation will shift a bit if you explain what you mean with: "// inspect the frames of that thread doing any needed business with them" What exactly do you have in mind? Do you want to change the stack in some way? Because, depending on what you want, Andrew's comment on: ThreadM

RE: inspect a thread’s stack

2018-04-10 Thread Pietro Paolini
> > I think the conversation will shift a bit if you explain what you mean with: > > "// inspect the frames of that thread doing any needed business with them" > > What exactly do you have in mind? Do you want to change the stack in some > way? I would like to inspect the variable's name/value

Re: inspect a thread’s stack

2018-04-10 Thread Mario Torre
On Tue, Apr 10, 2018 at 9:26 AM, Pietro Paolini wrote: >> >> I think the conversation will shift a bit if you explain what you mean with: >> >> "// inspect the frames of that thread doing any needed business with them" >> >> What exactly do you have in mind? Do you want to change the stack in some