• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugger in Java

 
K Gupta
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Please choose an appropriate forum more carefully. Moving...
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
K Gupta
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
There's no API I'm aware of


So what would you call the JVMTI ???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic