Matt124
Matt124

Reputation:

outputting the value of a "Watch" in Eclipse to a log file

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

Upvotes: 1

Views: 363

Answers (2)

Dov Wasserman
Dov Wasserman

Reputation: 2682

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.

Upvotes: 1

VonC
VonC

Reputation: 1328602

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.

Upvotes: 0

Related Questions