4 ms·
The visualization aspect looks quite interesting, but I'm not sure how many things this can do that a quality IDE already doesn't. The example uses the author
by realharo 10y ago
The visualization aspect looks quite interesting, but I'm not sure how many things this can do that a quality IDE already doesn't.
The example uses the author mentions ("Following code paths from method to method", "Finding where an interface is implemented and which methods get overridden", "Exploring dependencies between types and functions") all sound like pretty standard features today. Plus with an IDE you get the benefit of having them right there in the editor/debugger/etc. and much more.
I would however really like something for inspecting the run-time structure of an application's objects. Most debugger views are really clunky for looking at large amounts of data, and even the pretty-print features often don't help much. Having a zoomable graph with the objects right there in front of me would really bring my productivity to the next level.
- noselasd 10y agoThe DDD debugger has(had ? Not sure it's maintained anymore) pretty useful visualization of data - e.g. like https://bcaptain.files.wordpress.com/2013/06/ddd.png https://bcaptain.files.wordpress.com/2013/06/ddd.png
- realharo 10y agoThat's a good start, I'll try that out when I have some time. This specific screenshot however - a linked list - shows a situation where you most likely don't care about the exact structure like this - you only care that it's a list of elements, so most debuggers would show it to you like that - just as a list. The specific raw structure only obscures the parts you care about. Visual Studio allows describing your custom data structures like this using XML files (https://msdn.microsoft.com/en-us/library/jj620914.aspx https://msdn.microsoft.com/en-us/library/jj620914.aspx), or even custom graphical controls (https://code.msdn.microsoft.com/windowsdesktop/Writing-graphical-debugger-a17e3d75 https://code.msdn.microsoft.com/windowsdesktop/Writing-graph...) and gdb allows you to write a pretty-printer in Python (using an API which I can't find any documentation for :/ ), but it's all kinda clunky and still doesn't deal well with large amounts of data. My ideal tool would be something that combines both of these things - you have - An object graph that you can zoom in/out of that shows raw objects (just like in that DDD screenshot). - An easy way to describe a custom view for your own objects (you can also switch to the raw view for an object, or switch between different defined views, etc.). Just like VS/gdb/lldb allow you to do, but a lot easier and more powerful. You could for example view a specific dictionary that contains complex objects in a tabbed interface, where the keys are tab titles, etc. - A way to live edit these custom views - so that you can rapidly create them without restarting the debugger and restoring the state many times (Visual Studio supports this for the .natvis files). - A powerful searching/filtering/transformation mechanism (e.g. for every object that satisfies this condition, show only this property and sort by that, etc.). - Some way to save these configured views + filters + transformations, etc.
- Pete_D 10y agogdb's pretty printing API is documented in the texinfo manual, most usefully this page: http://sourceware.org/gdb/current/onlinedocs/gdb/Writing-a-Pretty_002dPrinter.html http://sourceware.org/gdb/current/onlinedocs/gdb/Writing-a-P.... I use it a lot, and love it, but I haven't used VS's XML thing to compare. For looking up API documentation I usually drop into `python-interactive` from within gdb and do e.g. `help(gdb.printing)`. Though, you're still limited to string representations that way. If I want to examine a really complex datatype, I'll sometimes write a gdb command to dump some kind of GraphViz output and run it through dot. Or come up with a json representation and explore it using jq or ad-hoc python filters. Looking at your ideal tool checklist - I think it would be possible to build this on top of gdb. I wrote a prototype a while ago that would launch a HTTP server from the gdb prompt, and then you could control it via websockets. Never took it past recreating the prompt with an <input> tag, but someone who was better at front-end work could conceivably do all sorts of nifty data visualizations with it.
- realharo 10y agoAh, thanks, especially these two parts help a lot https://sourceware.org/gdb/current/onlinedocs/gdb/Values-From-Inferior.html#Values-From-Inferior https://sourceware.org/gdb/current/onlinedocs/gdb/Values-Fro... https://sourceware.org/gdb/current/onlinedocs/gdb/Types-In-Python.html#Types-In-Python https://sourceware.org/gdb/current/onlinedocs/gdb/Types-In-P... Not sure why I had so much trouble finding that back when I needed to change an existing printer.
- db48x 10y agoYou would care about the pointers in that linked list if one of them had gone awry.
- westoncb 10y agoI'm working on a new kind of tool on those lines—would appreciate any feedback on whether the format I've designed so far would be useful to you (or others). http://westoncb.com/projects/avd http://westoncb.com/projects/avd (I've been thinking about ways of getting to deal with arbitrary object graphs, but an important requirement was to keep it language-independent, so it just deals with common data structure formats at the moment: lists, trees, tables, graphs, hashmaps, etc. —my thinking is most difficult to debug algos are performing operations on these anyhow.)
- cellularmitosis 10y agoThis is amazing! Is the UI OpenGL? Is the visualization program a separate process? I'm guessing the main process sends info about the monitored data structures over a socket?
- westoncb 10y ago> I'm guessing the main process sends info about the monitored data structures over a socket? Correct! The UI/server is Java/OpenGL.