有没有人知道调试器或编程语言允许您设置断点,然后修改代码,然后执行新修改的代码。
如果调试器还具有 reverse debugging 的能力,这将更加有用。 .因此,您可以单步执行有缺陷的代码,向后堆叠,修复代码,然后再次单步执行它以查看是否修复了错误。这很性感,有人这样做吗?
最佳答案
我相信Hot Code Replace在 eclipse 中是你在问题中的意思:
The idea is that you can start a debugging session on a given runtime workbench and change a Java file in your development workbench, and the debugger will replace the code in the receiving VM while it is running. No restart is required, hence the reference to "hot".
但也有限制:
HCR only works when the class signature does not change; you cannot remove or add fields to existing classes, for instance. However, HCR can be used to change the body of a method.
关于debugging - 在调试 session 期间修改代码。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6878110/