Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Datastructures Visually

I've got some Java code which builds a data structure (approx 500 small interlinked objects) from data in some files and I'd really like to visualise the resulting structure. I hope that seeing it will allow me to optimise, not the code, but the data itself.

I'm wondering if there is a debugger that will do this or perhaps a way I can dump the data and have a tool build me a pretty graph of the data structure.

I hope that makes sense.

like image 242
Tom Duckering Avatar asked Dec 30 '25 22:12

Tom Duckering


2 Answers

I've solved this before by dumping all my objects to Dot format, for GraphViz, and then used GraphViz to visualize the data, but not in real time. I had a command that would start a dump visitor that would walk the structure. Anyways it was about a second to dump and a few more to balance the graph when working with about 3000 nodes.

like image 169
Robert Gould Avatar answered Jan 02 '26 11:01

Robert Gould


In C++, the tool I've used for doing something similar is the GNU Data Display Debugger DDD. According to the manual, you can use JDB as the debugging backend. I've never tried it, but it might be worth a shot -- I had great success using DDD to create graphs of the complex data structures.

like image 32
Alex Jordan Avatar answered Jan 02 '26 12:01

Alex Jordan