About debugging Eclipse's Debug mode

2. Right-click the menu and select Debug as (do not select Run as), then select Java Application to run

How to execute expressions in eclipse debug


3. If it has not been confirmed before, there will generally be a ConfirmPerspective Switch , click yes, and then open the Debug mode window

How to execute expressions in eclipse debug
How to execute expressions in eclipse debug













4. Generally, there is an Expressions window in the upper right corner by default , where you can add new expressions, click Add new expression

How to execute expressions in eclipse debug


5. Enter the expression to be executed. In order to demonstrate the effect, enter "a* b * 10" . After confirmation, the execution result of the expression will be displayed in the right column. Multiple expressions can be added at the same time. (This is very useful in the process of debugging. Sometimes you don't want to change the code, but you just want to temporarily execute an expression to see the execution result. After the debugging result matches, you can actually modify the code.)

How to execute expressions in eclipse debug


6. You can also select an expression in the code, right-click and select Inspect (shortcut Ctrl+Shift+I), which will pop up a box to display the execution result of the expression just selected. This method is very convenient to test the execution results of expressions that already exist in the code. Choose the appropriate method according to your needs.

How to execute expressions in eclipse debug
How to execute expressions in eclipse debug

















Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325471793&siteId=291194637