MyEclipse breakpoint debugging, JavaScript breakpoint debugging __java

Source: Internet
Author: User
Replicated on the Internet is to understand the method of debugging but still do not understand the role of debugging
The most basic operations are:
1, first set a breakpoint in a Java file, then run, and when the program goes to the breakpoint, it goes to the debug view,
2, F5 key and F6 keys are Single-step debugging, F5 is step into, that is, to enter the bank code to execute, F6 is stepped over,
That is, execute the line code, jump to the next row,
3,f7 is stepping out of function step return
4,f8 was executed to the last.

=====================================

1.Step into (also F5) jump
2.Step over (also F6) skipped
3.Step return (also F7) executes the current method, and then return jumps out of this method
4.step filter filtering is performed until an unfiltered location or breakpoint is encountered (set Filter:window-preferences-java-debug-step filtering)
5.resume Restart Debug and run until you encounter breakpoint
6.hit Count set the number of executions to fit in a for loop in the program (set breakpoint view-right hit count)
7.inspect check operation. Executes an expression that shows the execution value
8.watch real-time monitoring of variable changes
9. We often say that the breakpoint (breakpoints) is line breakpoints, in addition to line breakpoints, there are other types of breakpoints: field (Watchpoint) Breakpoint,method Breakpoint,exception Breakpoint.
10.field Breakpoint also known as Watchpoint (watch Point) suspend when member variable is read or modified
11. Add Method Breakpoint (Run-method breakpoint) when entering/leaving this approach
12. Add exception Breakpoint catch Execption suspend (to be continued ...)
Breakpoint Properties:
1.hit count execution number of times suspended for loop
2.enable condition encounters with your input criteria (for ture\ changes) on suspend
Suspend this thread when 3.suspend thread multi-thread
4.suspend VM suspend Virtual machine
The variables in the 13.variables view can change the value of the variable, right-click on the variable in the variables view and click--change Value. Once for quick debugging.
After modifying some code in the 14.debug process,--〉save&build-->resume--> the breakpoint again


===========================
For example, you have the following procedure:
public static void Main (String args[]) {

MyDate AA = new MyDate ();
Aa.adddays (day); ============= "(1)
System.out.println ("eeeeeeeeeeeeeee"); ============= "(2)
}

Public String addDays (int more_days) {
System.out.println ("1"); ============= "(3)
String result = ""; ============= "(4)
System.out.println ("2"); ============= "(5)
return result;
}

You add a breakpoint at (1), and when you run here if step into (also F5) is a jump, then execute to (3). Execution of Step Over (also F6) executes the bank, then executes to (4). Finally execute step return (also F7), then jump out of the AddDays method and skip to (2)

MyEclipse Breakpoints Debug JavaScript We can take a few steps to illustrate this:
1. Prepare two files under the site: 1.js and index.html, introduce 1.js in index.html, and click the button in Index.html to invoke the test () method in 1.js:
XML code
﹤html﹥
﹤head﹥
﹤meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/﹥
﹤/head﹥
﹤script type= ' text/javascript ' src= './1.js ' ﹥﹤/script﹥
﹤body﹥
﹤input type= "button" name= "T" value= "testing" onclick= "Test ()"/﹥
﹤/body﹥
﹤/html﹥
2. After starting Tomcat, browse the page with MyEclipse's web2.0 browser:

MyEclipse breakpoint Debugging JavaScript Analysis Figure 1
3. In the Web2.0 browser, enter the page address, after the page appears, click on the toolbar "JS debugging" button, then in the "Javascript Scripts Inspector" window to list the current page design of all JS files. Select the JS file that requires breakpoint debugging, and double-click enter.

MyEclipse breakpoint Debugging JavaScript Analysis Figure 2
4. After entering the 1.js file, you can add a breakpoint to the JS code:

MyEclipse breakpoint Debugging JavaScript Analysis Figure 3
5. Then go back to just web2.0 browsing page, click on the button, call the 1.js test () method, the system will automatically jump to the debugging state, and positioning to 1.js just set the breakpoint location.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.