wood burning stoves*
The moose likes IDEs, Version Control and other tools and the fly likes Debugger in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debugger in Java" Watch "Debugger in Java" New topic
Author

Debugger in Java

K Gupta
Ranch Hand

Joined: Aug 31, 2004
Posts: 43
Hi ,

I want to make a debugger with remote debugging option in Java.Can somebody give some pointers like which API to use and sample code.And I also need to know the theory behind debugging.


SCJWSD, SCBCD,SCWCD, SCJP
If I am destined to fail, then I do have a purpose in my life: To fail my destiny.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not an advanced question. Please choose an appropriate forum more carefully. Moving...


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

The JVM has an interface called JVMTI (Java Virtual Machine Tool Interface) which is the interface you'll want to use if you're going to write a debugger for Java.

You could have a look at the source code for Eclipse or NetBeans, two open-source IDEs which both have very good debuggers built-in.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
There's an excellent standalone debugger called JSwat which you can study. Is there a particular reason you're trying to build one yourself instead of using one of the existing ones? It'll be quite a project.


Ping & DNS - my free Android networking tools app
K Gupta
Ranch Hand

Joined: Aug 31, 2004
Posts: 43
Thanks ...

@Ulf : Yes I know it will be quite a project but I want to make one as I have some specific requirements. Can you guide me toward some theory of debugger i.e how it works etc.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
Can you tell us a bit about those special requirements? I am betting that it will be easier to start with something like JSwat and incorporating those than to roll your own from scratch. If those features could be of general interest, the lead developer of JSwat might even help you get them implemented, and incorporate them in the official version.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Since the Java VM has its own builtin debugger, every development system I know of uses that. Which is reasonable, because about the only other way you'll be able to see inside the system and set breakpoints, etc. is to create (and debug!) your own JVM.

There's no API I'm aware of - the developer tools simply send text debugging commands to the JVM debugger and present what they pull out of the debugger's text responses. Which should mean that telnet is the simplest remote debugger of them all.

BTW, the Unix "ddd" debugger also supports Java in addition to compiled languages. It's a plugin, I think, but I believe it came already enabled in the version of ddd that came with my Fedora Linux distro.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Tim Holloway:
There's no API I'm aware of


So what would you call the JVMTI ???


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Debugger in Java
 
Similar Threads
Debugging problem with NetBeans IDE
Is Log4j for Debug Suppourt or Something else
Is rt.jar debuggable in JDK6?
Pls Help !! Debugging Error Message "Error within Debug UI"
migrate javaweb application IE6 to IE8