Author Topic: Command entry in the debug log patch  (Read 14925 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Command entry in the debug log patch
« on: June 09, 2009, 11:54:26 pm »
Hello,
Here is a patch that adds an entry control in the debug log.
With this entry the user can send commands to the debugger easily.

This patch implements the basic functionality.
If the C::B devs think that the code is good and that is the proper way to add the entry,
further work can(will) be done (making it look like the script console).

Best regards

p.s. the patch is attached
« Last Edit: June 18, 2009, 11:24:23 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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Command entry in the debug log patch
« Reply #1 on: June 10, 2009, 03:54:53 am »
You are so smart and this plugin works perfectly. :D
Thank you very much!

By the way: should be added to trunk. :shock:
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Command entry in the debug log patch
« Reply #2 on: June 10, 2009, 10:53:02 am »
little suggestion :

wxString cmd = m_pLog->GetCommandEntry().GetValue()


Would it not be better to hide the fact there's a wxTextCtrl, and something like :
m_pLog->GetCommand(),

That way we can always change the implementation of the DebugTextCtrlLogger, and there's one user less to worry about.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #3 on: June 10, 2009, 11:02:33 am »
It could be done, but ClearCommandEntry() should also be added, because I clear the entry field on a command.

But do you think that the way/direction is right?

Edit:

Here is the patch modified to met the killerbot suggestion
« Last Edit: June 18, 2009, 11:24:37 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!]

mariocup

  • Guest
Re: Command entry in the debug log patch
« Reply #4 on: June 11, 2009, 03:30:47 pm »
Hi oBFusCATed,

I tested your modification and it has been really missing in CB for embedded development. The entry field is quite decent, so it is not so obvious for users. I would prefer:
1. A background color to distinguish the entry field from the rest of Debugger console or
2. Add a small Text like: Debugger Console Input:

I hope that your patch will be integrated soon in the trunk :-).


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #5 on: June 12, 2009, 11:16:00 pm »
Here is another improvement of the patch:  8) :lol: :roll:

1. Replaced the wxTextCtrl with a wxComboBox (implemented history)
2. Added execute button
3. Made the debugger(debug) to look like the regular debugger pane
4. Added a text describing the purpose of the entry

I've encapsulated the thing in the new class DebugLogPanel.
I wanted to put all the code in DebugTextCtrlLogger, but I don't know how to use the Connect method on it.

Any comments are welcome.
Best regards...
« Last Edit: June 18, 2009, 11:24:45 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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command entry in the debug log patch
« Reply #6 on: June 13, 2009, 06:39:27 pm »
Here is another improvement of the patch:  8) :lol: :roll:
It's getting better and better... :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #7 on: June 13, 2009, 08:12:19 pm »
Morten and others,
do you spot any problems that are stopping the patch from being applied to trunk?

Maybe an on/off option?

p.s. ctrl + v/c/x doesn't work, but I suppose this is a global problem
(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 killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Command entry in the debug log patch
« Reply #8 on: June 17, 2009, 11:29:44 pm »
Time for me to test this out myself (seems like I am always a few days/weeks behind  :(  ).

Are there any other improvements, fixes of issues in the pipeline for this patch ??


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #9 on: June 17, 2009, 11:33:45 pm »
I'm not using this feature, so I don't intent to spend more time on it.
Except for bug fixes, of course...
(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: 9694
Re: Command entry in the debug log patch
« Reply #10 on: June 18, 2009, 09:11:09 am »
do you spot any problems that are stopping the patch from being applied to trunk?
The only thing I'd like to see is a cosmetic change: So that the script log looks the same as the debugger's log. This means:
1.) In the script log: Add a label in front of the textbox
2.) In the debugger's log add the buttons (and functionality) for "Load from file" and "Clear output window". Especially the first one would be just "cool". ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #11 on: June 18, 2009, 09:30:45 am »
OK, I'll take a look tonight.

But do you think that "Load from file" would be useful? Have you used the one in the script console?
(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: 9694
Re: Command entry in the debug log patch
« Reply #12 on: June 18, 2009, 09:51:04 am »
But do you think that "Load from file" would be useful? Have you used the one in the script console?
Certainly. I have several scripts that clean up and prepare builds which I run from time to time. For the debugger I think it would be even more "nice" -> imagine initialisation commands or alike. However - I don't say you'll need to do that though. From my point of view the patch is nice just as it is. And it just works.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Command entry in the debug log patch
« Reply #13 on: June 18, 2009, 11:28:14 pm »
OK, Morten
I've added the clear button and load from file button.
I won't add the command static text in the script console because I'm not sure that I can edit the code without making damage (looks like it is generated by the wxSmith plugin)

The patch is sent to the patch tracker.
id: 002773

I've deleted all attachments with previous versions of the patch.

p.s. the load from file button executes "source filename" command, I don't know if it is appropriate, but it seems to work.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Command entry in the debug log patch
« Reply #14 on: June 19, 2009, 03:44:06 am »
@oBFusCATed
Thanks, the new patch works well!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.