to reuse or not to reuse
Hi,
I'm trying to create a OOP visual simulator, that goes through a program and describes what's going on. This sounds a lot like a "dolled-up" debugger. Well, that's where my problem lies. I'm thinking I need to either write a debugger or reuse an existing one. So, I was wondering if anyone could point me in the right direction as I've only been programming for the last 3 years, and am feeling very much in the dark with regards to this topic.
a) Does anyone know of suitable information outlining the steps needed to write a basic debugger?
b) how long would it take to accomplish this task?
c) Does anyone know of a good debugger that I could reuse (that also has good documentation)?
d) Would I be able to reuse the jdb debugger?
I do apologise for all the questions (especially if the answers are common-knowledge) but I have been researching on the net for some time, and don't seem to be getting anywhere.
Thanks.
[979 byte] By [
sonOfTimea] at [2007-9-29 17:33:25]

G'day sonOfTime,
Sounds like you and I have a similar task. I am also developing a "dolled-up" or "visual" debugger. I am creating a debugger that dynamically displays an object diagram representation of the program as it executes. To support the display of the object diagram, I am using ArgoUML and I am porting the jdb debugger into it to support all its debugging functionality. Because of the size and complexity of ArgoUML, it's been quite difficult to come up with an application that can be fully utilized as a suitable debugger, mainly because it is such a resource hog and too slow for the purposes of debugging, however I am finding ways to make it more efficient day by day by stripping away the layers that I don't need. Also I have recently started looking into JSwat and results I am obtaining in combining this program (as the debugger) with ArgoUML's graphical editing capabilities is encouraging.
So in response to your questions, I offer the following:
a) for information outlining steps needed to write a basic debugger, study and muck around a bit with the jpda demo code. Much of the resources I found came directly from this forum and studying the source code.
b) the task of developing an OOP visual simulator can be as simple as combining the functionality in the jdb debugger with a simple graphical editor. The answer to this question really depends on HOW MUCH you want the application to do. Questions you need to ask is "What Visualization techniques do I need to incorporate?", "What kind of things do I want to view?" "What debugging functionality do I want?"
c) a good debugger you can reuse is JSwat http://www.bluemarsh.com/java/jswat/
d) and if you so wish you definitely can reuse the jdb debugger (this is what I have done!). However you do need to consider porting this to some graphical editor to display your visuals (or you can build your own)
Hope that helps, and if you come up with some neat stuff, feel free to share your ideas!
Thanks foxman1 for that. It was really beneficial. I'm just going through some of the ideas you suggested. I'm thinking of either using jdb or JSwat to help me make this OOP simulator. I've still got a few questions (and am sure I'll have some in the future). Good thing is that i've had a play around with jdb and it's given me some good ideas.
1. Where can I find the jpda demo code? (or was it the debugger you were referring to?)
2. Does JSwat have any documentation relating to its source code?
Btw, how do I give you the duke points, as you really have helped me out with this.
The jpda demo code is found under the demo directory of your java sdk. As far as JSwat is concerned, the only documentation relating to the source code is the internal documentation itself. The version I'm currently running is 1.7.1 and I've hacked into it a bit to add some other graphical stuff.
Glad I'm able to help. To award duke points, just click on the green plus sign next to the duke icon above the post you want to award points to. Look forward to hear about your progress