পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Friday, January 20, 2017

JDB - Basic Commands

This chapter takes you through the basic commands of JDB. After launching a session, these commands are used for debugging a program.
The following is the list of commands used for debugging.

Name Description
help or ? The most important JDB command; it displays a list of recognized commands with a brief description.
run After starting JDB and setting the necessary breakpoints, you can use this command to start execution and debug an application.
cont Continues execution of the debugged application after a breakpoint, exception, or step.
print Displays Java objects and primitive values.
dump For primitive values, this command is identical to print. For objects, it prints the current value of each field defined in the object. Static and instance fields are included.
threads Lists the threads that are currently running.
thread Selects a thread to be the current thread.
where Dumps the stack of the current thread.

Example

Let us assume we have a sample class called Add for the following examples:

Add.java

public class Add
{
   public int addition( int x, int y)
   {
      int z = x + y;
      return z;
   }
   
   public static void main( String ar[ ] )
   {
      int a = 5, b = 6;
      Add ob = new Add();
      
      int c = ob.addition(a,b);
      System.out.println("Add: " + c);
   }
}
Compile this class Add.java using the following command:
\>javac Add.java

Run

This command executes the main class file, which is added to JDB for debugging. Execute the following commands to run the Add class.
\>jdb Add
initializing jdb 
>run
On executing these commands, you get to see the following output:
Basic Commands

No comments:

Post a Comment