Author Topic: Debugger PlugIn Extension proposal (+Patch)  (Read 6798 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Debugger PlugIn Extension proposal (+Patch)
« on: November 19, 2005, 06:36:57 pm »
Dear devs,

it's me again. (Oh no! :lol:)
I've studied the latest changes and improvements concerning the debugger plugin. Great! In a recent post (http://forums.codeblocks.org/index.php/topic,1317.0.html) I have proposed a patch that allows a user to load a GDB script including commands that are being sent to the debugger line-by-line. With the recent changes I had another (for my purposes even better) idea that I've implemented:

I have extended the menu of the debugger tree with another option "Add watch script". This allows a user to load a file that contains watches on variables line-by-line. When is it useful? Imagine you have a program and use (e.g.) std::vector and want to watch specific or all element(s) of this vector. You would have to add each of them using "Add watch" which takes time. Furthermore the watches are lost after the restart of Code::Blocks. With my patch you can load the file and all watches listed there will be added automatically.

I would like to hear you comments on that.

Morten.

ToDo:
- Currently each watch is imported as WatchType "Unspecified" this should be changed so that the file contain another column with the type.
- Allow the user to save the list of (current) active watches to a file in the "Watch script" (XML?) format for easy re-loading
- With the current implementation sometimes the debugger tree gets weird. Maybe I am adding the watches too fast... ;-)
- (...)


[attachment deleted by admin]
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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #1 on: November 19, 2005, 11:22:00 pm »
Added in CVS :)
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #2 on: November 20, 2005, 02:42:47 pm »
Added in CVS :)
Whohoo! That was fast. Thank you, I really appreciate that. Well, of course because the idea seems to be accepted I have further developd this feature. Now I added the functionality to save the watches that are currently active in the watch list. Find the patch attached (based on the CVS-HEAD of today). I would be glad, if you add this, too (if you like it).

Just a short note: I have renamed the ID/method "idAddWatchScript" to "idLoadWatchFile" and generally "WatchScript" to "WatchFile" (because it isn't really a script) for an obvious reason.

With best regards,

Morten.


[attachment deleted by admin]
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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #3 on: November 20, 2005, 06:51:17 pm »
Patched :)
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #4 on: November 21, 2005, 11:04:51 am »
Patched :)
Just in this very moment I've compiled the current CVS head - Very nice! :D

Thanks a lot.

Morten.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #5 on: November 21, 2005, 11:26:36 am »
I am sorry to stress this again, but I might also have implemented a bug. :?
If the watch file contains more than a single watch the debugger tree gets weird. I have attached a screenshot to show what I mean. However - if I add the three watches separately (using "Add watch") it works. So it can't be a problem with the watches itsself. The debugger tree swicthes back to "normal" again, if I remove a single watch. I assumed a timing problem so I tried to introduce a "Usleep" after the "AddWatch" in the "void DebuggerTree::OnLoadWatchFile(wxCommandEvent& event)" method but this doesn't help. I tried several other things but it seems a reasonable solution goes beyond my knowledge. :(

Could you help, please?

Morten.

[attachment deleted by admin]
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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #6 on: November 21, 2005, 11:58:54 am »
Fixed :)
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #7 on: November 21, 2005, 04:19:25 pm »
Fixed :)
Thank you very much - of course, it works! I've seen that there were an awfull lot of changes to the debugger plugin, hopefully they were not all caused by this issue. :shock:

In the end this really helps me (and I hope other people as well) a lot. See, I am using loads of math in my development, thus, vectors and matrices are quite common. It was always hard to debug specific values of such constructs (e.g. trace of a matrix) with whatever debugger I was using. These changes introduce a very handy way to do so. I owe you something, hopefully I can return the favour at some day.

Morten.
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 takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #8 on: November 21, 2005, 05:28:47 pm »
I owe you something, hopefully I can return the favour at some day.

Yes, keep developing in and for Code::Blocks and spreading the word :P

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Debugger PlugIn Extension proposal (+Patch)
« Reply #9 on: November 21, 2005, 06:35:01 pm »
Quote from: MortenMacFly
I've seen that there were an awfull lot of changes to the debugger plugin, hopefully they were not all caused by this issue.

No, they were not :)
Coincidentally, the debugger plugin is under active development so updates are common.
Be patient!
This bug will be fixed soon...