输出“Watch”的值 在 Eclipse 中写入日志文件
我有一段无法编辑的 Java 代码,但我想调试它。
问题是我的 10,000 条记录中有一条存在数据错误,导致应用程序崩溃。
我可以远程调试实时应用程序并添加监视,该监视将在处理每个记录时获取记录的 ID。 问题是,当处理“坏记录”并且退出该方法时,手表中保存的值会丢失,因此我不知道是哪个记录导致了问题。
有什么方法可以存储/打印手表中的值
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果错误记录通过引发异常导致应用程序崩溃,请尝试在该异常上放置断点,也许记录信息在该方法的堆栈帧中仍然可用。 没试过这个,只是一个想法。 祝你好运。
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.
也许你可以使用 watchExpressionDelegates 扩展点 在其中。
您将实现该委托类
org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate
的类可能有机会做任何它想做的事情,包括记录信息。我还没有测试过它,但如果您成功实现了它,请告诉我们。
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.