JDB commissioning of small test sledgehammer

Source: Internet
Author: User
Debugging the sample program Hellojdb (D:\jdb\HelloJDB) with the JDK's own tool jdb The hellojdb code is as follows:public class Hellojdb{public static void Main (String args[]) {int a,b,c;a = 1;b = 2;c = a + b; System.out.println (c);}} Compile hellojdb:javac-g Hellojdb.java Note: the-G option indicates that debug information is generated, otherwise the locals command cannot be used to view the local variable debug mode run:
java-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 hellojdbjdb Connection:
Jdb-connect Com.sun.jdi.socketattach:hostname=localhost,port=8000-sourcepath d:\jdb Note:-sourcepath Develop the source code, Otherwise, the list directive cannot display the breakpoint at the source code jdb debug:stop at Hellojdb:7 on line seventh under breakpoint Run execution program to breakpoint locals view local variable List view breakpoint where source code next Down execution (step over) step down (step Into) Quit Stop debugging

JDB commissioning of small test sledgehammer

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.