Extending the GDB debugger for data visualization

Niko Sams niko.sams at gmail.com
Sat Jul 18 07:23:09 UTC 2009


On Sat, Jul 18, 2009 at 02:17, Manoj Rajagopalan<rmanoj at umich.edu> wrote:
> Hi all,
>
>   I am trying to write a basic visualization plugin for data. I have
> familiarized myself with KDevelop's interaction with GDB using the GDB/MI
> interface. I now know how to fetch arrays of data from memory within
> KDevelop.
>
>   To be able to plot this as 1D or 2D data, I was thinking of:
>
> (a)  introducing a menu item in the debugger menu which would create a dialog
> that would accept some expression which would evaluate to a pointer, and
> accept integer inputs for number of rows, columns, strides etc which would
> define the extent of the data to be read and how it is to be interpreted,
>
> (b) including some token text for this in the variables window either in
> the "Evaluate" or "Watch" variables list,
>
> (c) floating a non-modal window with the visualization in it,
A dock-view would be much better.

>
> (d) Introduce a command-line 'command' for the visualization, like "graph
> <pointer-expression> <other params...>" like with DDD. I could trap this
> particular command in the CLI interface and act specially on it while sending
> all other CLI commands through to the regular GDB/CLI code-path,
>
> (e) Introduce a 'tabulate' command similar to the 'graph' command above that
> would show a spreadsheet view of the data as opposed to graphing. Perhaps at
> a later stage we could permit some spreadsheet ops for inspection of data.
Hmmm, this is a gdb cli, how could the user know that there are special kdevelop
commands?
The main usecase for this cli is for users that are used to plain gdb.

>
>
>
> The floating window would show a dummy image when its data goes out of
> debugger scope or we could even kill the window.
>
> I request information with the KDE 3 API for questions below. Once I complete
> and test the development I can port this to KDE 4. Please bear with me.
>
> 1. Is there a special KDE/KDevelop class I should use for the floating window?
>
> 2. Is there a better way than to use a floating window, say a dockable window?
>
> 3. Does this approach sound OK/useful? Item (d) and (e) could be done last.
Just look how other code does it. I'm not familiar with kdevelop3.

And I still think you should give kdevelop4 a try, because:
* Kdevelop3 is dead
* for kdevelop4 you could do this debugger independet
* if your plugin is useful it will get actually released
ofcourse it's up to you...

Niko




More information about the KDevelop-devel mailing list