0

I have a program that has 4 worker threads operating on a method. If I place a breakpoint in the method each worker thread will pause on it but the step into and step over buttons (as well as play/pause/terminate) are disabled so I can't walk through the execution path.

I have tried using suspendVM rather than just suspending thread and just suspending one thread by using a conditional breakpoint referencing worker1 thread name but it makes no difference, the step in/over buttons are disabled

Anybody know how to get this to work? Its works fine when i'm running only a single main thread.

daedalus
  • 105
  • 2
  • 10
  • Are you at the right stack level (top-most)? Are you on the correct thread which is stopped? – mvd Sep 10 '15 at 01:56

2 Answers2

0

Well I got it working but don't ask me how, I think it has something to do with native methods. If my thread suspends while there is a key next to the method (in the call stack) I can't use step buttons, but if its three blue bars in call stack I can. It seems to be pot luck which one I get so I just restart the program until I get lucky.

daedalus
  • 105
  • 2
  • 10
  • If you think this is an answer others might find useful, then accept your own answer by clicking the checkmark. If you think this was something you did, and it is not applicable to others, then just delete your question. – Andreas Sep 10 '15 at 02:27
0

I find the reason is my thread is blocked by my code. For example:

pulic void methodA(){
    ...
    methodB()
    ...
}

public void methodB{
    ...
    while(true){// it can be some other reason to block this thread
        Thread.sleep(100);
    }
    ...
}

If we F6(step over) in methodA, the thread status will be "stepping", and step in, step over and step return button status is disabled.

bluearrow
  • 856
  • 2
  • 11
  • 26