views:

170

answers:

2

I have a piece of Java code I can't edit which I want to debug.

The issue is that one of my 10,000 records has a data error and is causing the application to crash.

I can remote debug the live application and add watch which would pick up the id of the record as each is processed. The problem is when the "bad record" is processed and the method is exited the value held in the watch is lost so I don't know which record it was that causes the problem.

Is there any way of storing/printing the value held in the watch

Thanks

A: 

May be yu could launch your own modified eclipse with a watchExpressionDelegates extension point in it.

Your class which would implement that delegate class org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate may have the opportunity to do whatever it wants, including logging informations.

I have not tested it but if you do successfully implement that, let us know.

VonC
+1  A: 

If the bad record is causing your application to crash by throwing an exception, try putting a breakpoint on that exception, and maybe the record info will still be available in the stack frame of that method. Haven't tried this, just a thought. Good luck.

Dov Wasserman