Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] throw statement in evaluations


I like the way this works - I think it is what the user expects. The throw statement resumes the thread and throws the exception. I was able to place breakpoints in catch blocks, and end up in the appropriate catch block - which is what I wanted.

However, there is still a "bug". The evaluation action attempts to display the result of the evaluation - but there is not result (the program resumes). Thus, the display view prints a message like this:

throw new NullPointerException();
         (java.lang.NullPointerException) Evaluation failed - thread not suspended.

We should avoid attempting to print the result in this case (I will update the bug).

Darin

 


Luc Bourlier/Minneapolis/IBM@IBMUS
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

07/22/2003 05:52 PM
Please respond to jdt-debug-dev

       
        To:        jdt-debug-dev@xxxxxxxxxxx
        cc:        
        Subject:        [jdt-debug-dev] throw statement in evaluations







I implemented the throw statement in the evaluation engine. It allows to
evaluate a snippet like "throw new Exception();". It will create the
exception, stop the execution of the thread and throw the exception as if
the snippet was in the code of the current method.
It works fine but I don't like the fact that an evaluation has a direct
effect on a thread, that will create some interresting cases if it use in
_expression_ condition or watch _expression_.
An alternative is to create a 'throw' action (like evaluate, inspect, ...
actions) which will throw an exception created by a snippet evaluation.
This allow use more control on when and in which condition the throw can be
performed.

May be the current implementation is OK, but it seems to me that it allows
to do more than what we need.

See bug 39824 for more details.

Any comment is welcome (almost).

Luc

_______________________________________________
jdt-debug-dev mailing list
jdt-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-debug-dev



Back to the top