Author Topic: Splitting debugger in two - specific debugger and common GUI  (Read 429101 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #30 on: August 15, 2009, 08:44:45 pm »
Thanks Jens, that was it.

Do someone knows why the code for recreating the menu is something like this:

Code

SetMenuBar(0L);
mbar = new wxMenuBar;
FillTheMenuBar(mbar);
SetMenuBar(mbar);


I'm asking because I'm using Manager::Get()->GetAppWindow()->GetMenuBar() to create the debug menu, not the wxMenuBar supplied to the BuildMenu method.
And I get a crash because the menubar is NULL while menu recreation.

Edit:
Another issue I have is that I can't create the debugger toolbar from the sdk.
At the moment every plugin should implement the BuildToolbar method, which fill pre-supplied toolbar with some content. This means that every plugin has one toolbar that is unique.
I want to have only one debugger toolbar, that is shared by all debugger plugins.

What I've tried so far:
Code
void DebuggerToolbarHandler::LoadToolbar()
{
    if(m_toolbar)
        return;
    m_toolbar = Manager::Get()->CreateEmptyToolbar();
    wxString my_16x16 = Manager::isToolBar16x16(m_toolbar) ? _T("_16x16") : _T("");
    Manager::AddonToolBar(m_toolbar, wxString(_T("debugger_toolbar")) + my_16x16);
//    m_toolbar->Realize();
    m_toolbar->SetInitialSize();
//    m_toolbar->Show();

    wxAuiManager* layout = Manager::Get()->GetAppMainFrame()->GetLayoutManager();
    layout->AddPane(m_toolbar, wxAuiPaneInfo().
                              Name(_T("Debugger Toolbar")).Caption(_("Debugger Toolbar")).
                              ToolbarPane().Top().Row(1));
    Manager::Get()->GetAppMainFrame()->DoUpdateLayout();
}


/// Manager::Get()->GetAppMainFrame() returns:
class IMainFrame
{
public:
    virtual wxAuiManager* GetLayoutManager() = 0;
    virtual void DoUpdateLayout() = 0;
};
// that is implemented by the MainFrame class in main.cpp

The toolbar is created but it is not shown. I know that because I was calling layout->Update instead of DoUpdateLayout and some strange window have been shown while CB was starting, then disappears.
« Last Edit: August 15, 2009, 11:34:31 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #31 on: August 31, 2009, 03:34:23 pm »
Here is a screen shot of the new watches window in action:
http://smrt.is-a-geek.org/codeblocks/dbg_refactor/cb_new_watch.png
(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 Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #32 on: August 31, 2009, 04:36:36 pm »
Here is a screen shot of the new watches window in action:
http://smrt.is-a-geek.org/codeblocks/dbg_refactor/cb_new_watch.png


I like it :D

Would it possible to add the tree branches to it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #33 on: August 31, 2009, 05:32:30 pm »
What are tree branches?
(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 Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #34 on: August 31, 2009, 05:33:57 pm »
What are tree branches?

The dotted lines that show the connection between a node and all its children.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #35 on: August 31, 2009, 06:37:07 pm »
I suppose no, because wxPropGrid might not support them at the moment (should look), but I can ask the it's creator, so he can add them (if not supported)
(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
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: Splitting debugger in two - specific debugger and common GUI
« Reply #37 on: September 01, 2009, 11:32:59 am »
Little problem,
I want when a watch is selected and the user presses f2, to be able to edit it.
But the F2 is an accelerator key and it is not passed to the handler, so now I use the Insert key.
Is there a way to handle f2 in my window?

p.s. Glad you like it, I hope that I'll post a patch with finished watches utill the end of the week.

Edit:
Argh  ... .. . Another problem:
The editor is refocused when a context menu in the watches window or the "logs and others" is closed (menu item is clicked).
This behavior prevents the implementation of the context menu watchesdlg->context menu -> rename (which does inplace rename).

Does someone knows something about that?
« Last Edit: September 01, 2009, 05:45:07 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #38 on: September 02, 2009, 07:24:22 pm »
OK, here is the second patch that shows my progress on this... (see post #18 for the previous message regarding progress and patches)

Here is the patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0002.patch

1. The toolbar is extracted (many problems here will fix them later)
2. The watches window have been rewritten (using wxPropGrid svn r1344+, 1.4.6 won't work because it doesn't allow the user to edit the name/label of the property)

Feadback is welcome....

p.s. If the patch is hard to apply, I can split it in many smaller ones (I use git-svn, so I can provide for every commit I've done to my local repo (50+ until today))
p.s.s. wxpropgrid is not added to the source tree, I'm using the one provided by the system... you need to have it visible to the compiler/linker...
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #39 on: September 07, 2009, 04:01:00 pm »
OK,
I've done 99% of the work.
What's left:
1. The config dialogs - the current implementation should work (with no additional work), we get a multiple debugger icons in the "Settings -> Compiler & Debugger" dialog. Is that enough?
2. The debugger panel/tab in the project properties dialog - same as the above, no work and we'll get multiple tabs
3. Data breakpoints, I'll do this in a minute :)
4. Some fixes here and there
5. Do some testing on windows

I hope, I can post a patch later tonight :)
Best regards....

Edit:
p.s. Here is the latest patch: http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0003.patch ....
« Last Edit: September 08, 2009, 01:32:42 am 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #40 on: September 09, 2009, 12:58:34 am »
OK, more progress

After titanic fight with the windows toolchain, a fight that I WON!
I present to you modified windows C::B http://smrt.is-a-geek.org/codeblocks/dbg_refactor/cb_new_watch_win.png

And here is a better patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0003_win_svn.patch
The previous one was impossible to apply. The current one works with Tortoise SVN's "Apply patch" (99% see below for more info)...

Could I ask the patch to be reviewed, so it can be fixed and included in trunk C::B as soon as possible? ( Morten?)

Best regards

p.s. to fully apply the patch you should move the images from plugins/debuggergdb/resources/*.png to sdk/resources/*.png
p.s.s. If the patch can't be applied I can provide an archive with the full source tree

« Last Edit: September 09, 2009, 09:14:09 am 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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #41 on: September 09, 2009, 07:09:30 am »
OK, more progress

After titanic fight with the windows toolchain, a fight that I WON!
I present to you modified windows C::B http://smrt.is-a-geek.org/codeblocks/dbg_refactor/cb_new_watch_win.png

And here is a better patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0003_win_svn.patch
The previous one was impossible to apply. The current one works with Tortoise SVN's "Apply patch" (99% see below for more info)...

Could I ask the patch to be reviewed, so it can be fixed and included in trunk C::B as soon as possible? ( Morten?)

Best regards

p.s. to fully apply the patch you should move the images from plugins/debuggergdb/resources/*.png to sdk/resources/*.png
p.s.s. If the patch can't be applied a can provide an archive with the full source tree



Wonderful job!

I'll download and test in my local copy!

Thanks!!!
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #42 on: September 09, 2009, 11:21:14 am »
And here is a better patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0003_win_svn.patch
[...]
Could I ask the patch to be reviewed, so it can be fixed and included in trunk C::B as soon as possible? ( Morten?)
Well - as guessed: The patch does not work. You have added binary data to the patch which will not work. Could you please provide me either with a patch that does not include images (the binary data) or really just send me the files (mac-fly@gmx.net will just do fine...).
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: Splitting debugger in two - specific debugger and common GUI
« Reply #43 on: September 09, 2009, 05:29:45 pm »
I've not added any binary files. I've move the images from the debugger/resources/*.png to sdk/resources
Unfortunately you'll have to do the moving manually :(
The rest of the patch should work... or it fails too?

On my windows I've "patch" cmd tool installed from UnixUtils (I think) and it doesn't work :(
But tortoisesvn (apply patch applied it OK I think).

If the patches don't work I can package the whole cb tree I have and put it on my web server, is that OK?
(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: Splitting debugger in two - specific debugger and common GUI
« Reply #44 on: September 09, 2009, 08:41:44 pm »
If the patches don't work I can package the whole cb tree I have and put it on my web server, is that OK?
The patch does not work as it contains binary data (yes - the *.patch file -> search for PNG inside).
If you want to you can put the whole source tree. Although I would prefer to have just the modified parts. But no problem if it's the whole tree. Just tell me the base SVN revision you used then.
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