Eclipse :Edit the source and continue debugging

后端 未结 3 1272
被撕碎了的回忆
被撕碎了的回忆 2021-02-08 07:31

I am using Eclipse IDE (Helios Version) While debugging in Eclipse , is it possible to edit the source and continue debugging ??

For example i have this file While debu

3条回答
  •  感情败类
    2021-02-08 08:21

    Yes it is possible to edit the source and continue debugging in Eclipse! You'll find extensive information here: Debugging with the Eclipse Platform (scroll down to the section Hotswap Bug Fixing: On-the-fly code fixing).

    If you are running Java Virtual Machine (JVM) V1.4 or higher, Eclipse supports a feature called Hotswap Bug Fixing (not available in JVM V1.3 or lower). It allows the changing of source code during a debugger session, which is better than exiting the application, changing the code, recompiling, then starting another debugging session. To use this function, simply change the code in the editor and resume debugging.

    There are some cases where the feature will not work. E.g. if you make changes to your main method's a4 variable, the JVM will not be able to remove all stack frames running old code from the call stack. The debugger data will be lost.

    To see the Hotswap Bug Fixing JVM feature in action, just move the code from your main method in the Test class to some other class. Here's what I mean:

    Hotswap Bug Fixing in Action

    Now you can modify the code on the fly while debugging in the MyObject class. Have fun!

    EDIT: Just found a similar question at superuser.com: Debugging in Eclipse, how to run until a breakpoint

提交回复
热议问题