Author Topic: Show debugging information on hover  (Read 18890 times)

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Show debugging information on hover
« on: May 06, 2010, 02:31:20 am »
Hi guys,

I recently checked out code blocks and it seems really nice. Best thing is it is intuitive and easy to use. A lot of effort must have gone behind this simplicity.

I was thinking of showing debugging information for variables when the mouse hovers on them. Ofcourse this would work only during debugging.
It resembles the idea first introduced in MSVC 2005(i might be wrong).

I use this feature in VS a lot, compared to the old way, where we need to add the variables to the watch, or scroll through it.

Do you think this would be useful for C::b and its users?

Another idea I had was visualizing a chunk of memory as 2d image. This is particularly useful when dealing with image processing algorithms. (I have been through a lot of frustrating experiences while debugging pixel by pixel)

-Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #1 on: May 06, 2010, 03:24:57 am »
Hi guys,

I recently checked out code blocks and it seems really nice. Best thing is it is intuitive and easy to use. A lot of effort must have gone behind this simplicity.

I was thinking of showing debugging information for variables when the mouse hovers on them. Ofcourse this would work only during debugging.
It resembles the idea first introduced in MSVC 2005(i might be wrong).

I use this feature in VS a lot, compared to the old way, where we need to add the variables to the watch, or scroll through it.

Do you think this would be useful for C::b and its users?
There is a simple version of this feature already implemented: Settings -> Compiler & Debugger -> Debugger -> Evaluate expression under the cursor
For the future a better version could be implemented but it depends if wxWidget could do it -> someone should do test if it is possible

Quote
Another idea I had was visualizing a chunk of memory as 2d image. This is particularly useful when dealing with image processing algorithms. (I have been through a lot of frustrating experiences while debugging pixel by pixel)
It is possible but someone should do it (it might be slow)

p.s. if you what a better debugging capabilities look at the debugger branch in svn
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #2 on: May 06, 2010, 03:33:02 am »
I had a look and it looks quite nice.
depends if wxWidget could do it -> someone should do test if it is possible

Which feature of wxWidgets do you wish to be tested?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #3 on: May 06, 2010, 03:40:33 am »
We need some control that looks like the one used in VS...

In the debugger branch C::B is moved to a wxPropGrid control for the watches window.
There was an idea to use the same control (wxPropGrid) for the tooltip.

1. Test if it is possible to put wxPropGrid in a wxTipWindowBase (see gdb_tipwindow.h/cpp for details)
2. Is it possible to make it autosizing (expanding/collapsing to change the size of the tip window)
3. Does it work on all platforms windows,linux,macos (reliably!)
« Last Edit: May 06, 2010, 01:48:34 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #4 on: May 06, 2010, 03:42:14 am »
alright, I'll have a look. My quarter is going on so its a bit tough to find a lot of time but summers for sure!


Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #5 on: May 06, 2010, 11:43:19 am »
I gave it shot without using the tip window base and property grid. I don't think property grid would support icons.
The file can be found here : http://ul.to/6tthfi

The app shows a piece of code in an inactive textbox. When you click on 'Hover Test' button, it simulates as if the mouse has been hovering the variable 'sph'. Rest is somewhat like visual studio.
Additionally one can edit values of variables which don't have any childs, similar to visual studio.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #6 on: May 06, 2010, 01:50:04 pm »
Can't run (and wouldn't run if I was) exe files (I'm on linux).
Can you provide some compilable source code or a simple screenshot?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #7 on: May 06, 2010, 05:19:43 pm »
Sure, I have uploaded the screenshot to imageshack: http://img695.imageshack.us/i/debugo.png/

I don't have a makefile for the linux version of the code (I am still used to VS) but I can upload the code
if you wish to see.

There's not much to the code. I use a custom control in place of a property grid and frameless dialog instead of
the 'tip window base'

The custom control has these properties
1. bool suggesting whether its expandable or not
2. Name of the attribute being displayed.
3. Icon for the attribute
4. Value of the attribute as a string

The dialog window has a list of these custom controls, one for each attribute

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #8 on: May 06, 2010, 05:39:40 pm »
Ah, looks good :)

Can the user edit the value of variables (like in VS)?
For example can he/she make x to be equal to 100, y = 21?

If the control can do that I can test it on linux (don't worry for the compilation :) )
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: Show debugging information on hover
« Reply #9 on: May 06, 2010, 05:49:19 pm »
The file can be found here : http://ul.to/6tthfi
I am unable to download this file (tried several computers).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #10 on: May 06, 2010, 06:05:29 pm »
Morten: here I've mirrored it: http://smrt.is-a-geek.org/codeblocks/DebugViz.rar (don't blame me if your computer dies in fire!)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #11 on: May 06, 2010, 06:12:42 pm »
Can the user edit the value of variables (like in VS)?

Yes it can. Basically the control displays a textbox when ever the values are editable.
It doesn't do any validation. Ideally I would have an observer pattern which notifies the
'datamodel' to do the validation. I think MVC would fit in nicely here.

An optimization would be to share the textbox across all instance of the custom control
since only textbox can be editable at any given time.

I am unable to download this file (tried several computers).
Strange, I am able to access it. May be its something do with the shortened version of uploaded.to to ul.to
Anyways, I have uploaded the code to a google code http://code.google.com/p/debugviz11/source/browse/#svn/trunk

A release exe is checked in too

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12198
    • Travis build status
Re: Show debugging information on hover
« Reply #12 on: May 06, 2010, 07:07:45 pm »
Ok, have it compiled, after the addition of some wxT(), here and there.

The usage of wxDialog is a no go on linux -> the wxDialog always has a border/caption.

Also you should implement the automatic closing of the dialog yourself, wxTipWindow seems to do it for you.
I've tried to port it to wxTipWindow, but I've got a crash...

Can you try to port it to wxTipWindow, or something that is 100% sure that will have no border on linux?
Also can you make the windows to collapse/hide automatically?

This is a good start, but the harder part is to be done: making the control work  :lol:
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #13 on: May 06, 2010, 08:52:30 pm »
I'll play around in linux and see how it goes.

Personally I would like the main popup window to go away when it looses focus or something,
but would like the child windows to be shown or hidden only by clicking on the + icon.

Offline shirsoft

  • Single posting newcomer
  • *
  • Posts: 9
Re: Show debugging information on hover
« Reply #14 on: May 07, 2010, 09:58:36 pm »
The usage of wxDialog is a no go on linux -> the wxDialog always has a border/caption.

I remember facing that issue on linux a few months ago, however running this code on ubuntu 9.10 with wxWidgets 2.8 and it works fine.
The dialog doesn't have a border!