how to inspect the value of an exception catch block variable in the debugger ?

Good day -

I have a process I am trying to debug that does, in some method :
        ...
          try
          {
               do_action() ;
          } catch ( Throwable t )
          {
*             throw new SomeOtherException( t ) ;
          }
        ...
I have got the debugger to break at the line indicated by the asterisk,
but it does not let me see the value of exception 't' - Idea 14.1.3 pops
up an error dialog with the message :
   "Cannot find local variable 't' ."
when I try to evaluate the expression 't' or 'System.err.println(t)' .

This is not a process I control the source code of (it is an ancient gradle-1.12 release
that I am trying to debug to find out why it fails to execute a certain task ).

Can anyone suggest how I could discover what 't' is - ie. the exception originally thrown
by do_action() ?  Is there any way of inspecting this value with IntellIJ Idea?
The 'SomeOtherException' object does not indicate what 't' is.

Thanks & Regards,
Jason

3 comments
Comment actions Permalink

Strange.
Are you sure that you have the correct source code version?
(It may be that the exact original source code version that was used for the build did not even have a variable "t" at that particular line.)

Even if the gradle jar was built without debug info, IDEA should try and guess the variable names, like described here:
http://blog.jetbrains.com/idea/2013/10/show-local-variables-in-debugger-even-with-no-debug-info/

Another idea: Maybe you can set a breakpoint on the constructor of "SomeOtherException"?

0
Comment actions Permalink

Source code mismatch is the most probable case, try different sources or disable sources at all: IDEA decompiler do the job well.

0

Please sign in to leave a comment.