Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use debug in idea

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use debug in idea? for this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

1Rerun XXX, this is to rerun a program directly.

2, this is equivalent to the f8 in eclipse, run directly, stop at the next breakpoint, and finish the program without it.

3. Stop the project or program. If you click on your main, you will stop. If you click on a Java web project, you will stop the server by clicking 2.

4. Check all breakpoint settings. For details, there is a schematic diagram below, which will be explained in detail.

5. Cancel all breakpoints directly and make them invalid.

6. If you accidentally mess up the layout below, if you click this, you will restore the layout below.

7. Jump to the place where the current code is executed, that is, when you look at the code, click somewhere else, and at the click of this button, you will reach the current line of code where the program is executed.

8, the next step, if it is a method, he will not jump in. It's just going down line by line. (the shortcut key in eclipse is f6)

9, jump to the details, and if the next line of debugging code is an executable method, f5 can go in and see the running details of this method. The point is to click in and execute it.

10, jump out of the details, opposite to 9 above.

11, it literally means to jump to the place where the cursor is, as long as he can get in the way without stopping.

12, after this click, you can calculate the value of the code segment you want to see, which is detailed in the figure above.

13, look at the meaning, like the watch in eclipse, look at the value of an object, a custom object.

14, separate the values of the custom view object into another tab page.

Sometimes when we step into the method body, we still want to go back to the outside of the method, and after clicking this button, the breakpoint goes back outside the method body. After continuing, you can still enter the method again (this is good, suppose you are quick, skip the method that you want to break point, and then the drop frame, after you go out, you can debug again. This will be introduced in detail)

To view the value of an object at a breakpoint, you can do the following:

1. After the object is selected, the mouse hovers over the object for about 2 seconds

2. Add this object to the watch

3, the following may automatically list what is in your code.

4, use the button of 12 marked on the above picture

5 alter + click, hold down alter, and then click on the variable you want to see, the value of the variable appears, which is awesome, thanks to the comments of the man on the 40th floor.

Let's go into more details. 4, 12, 13, 14.

4. Check the details of all the breakpoints and click as shown below.

In the figure, the condition of the breakpoint can be set in the condition, and only stops when I finish 4. View the specific breakpoint content.

About setting breakpoint conditions, you can also, directly in the code breakpoint, right-click to set, after that, done, the setting is complete.

12. This one is also used more frequently, so this one is more casual. You can calculate the results you want based on your input, without limiting the variables in the code.

This is very convenient to use in debug.

13 14, after these two points are finished, the effect is shown in the following figure, but the custom variables and the variables included in the code are displayed on two tab pages.

You can click button 13 and add the value of the variable you want to see.

There is also a requirement, that is, when debugging the code, real-time changes, the value of the running state of the code variable.

If you take a closer look at the following figure, you can see how to set the values of some variables when debugging the code in real time. You can see that after I typed an above, there is a prompt similar to that when you write the code below. You can change the value of the variable in this place.

For debugging, set run-time parameters as follows:

The entrance is as follows, either place is fine.

Generally run simple main method, run main method, also with parameter file, or for the first time, by the way to make a record.

Finally, wet chest I said in so much detail, ladies and gentlemen, those who have money hold a money market, and those who have no money hold a personal market. Like it, leave a message or something, all right.

Update: this editor for the convenience of students transferred from the eclipse editor, he can set keymap. Look at the picture.

Because I just started, I used eclipse, and then I turned it around, so when I used it, I set up this keyboard mapping first. You use the same shortcut keys you used on eclipse before. You don't need to remember the new shortcut key mapping again. This is also extremely convenient.

So, on this debug shortcut as when using eclipse, it's the same as f5 going in, and f6 is the next step.

Sometimes I find that you hit a breakpoint, but the code does not stop, pay attention to the following figure

This is the answer to the question about how to use debug in idea. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report