Author Topic: The 20 February 2011 build (7017) is out.  (Read 63412 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 20 February 2011 build (7017) is out.
« Reply #15 on: February 25, 2011, 08:03:19 pm »
This patch fixes the problem for me, but I've not done extensive testing, so there are chances for other bugs...
Thanks! But probably it's better to use tkAnyContainer || tkAnyFunction?
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: The 20 February 2011 build (7017) is out.
« Reply #16 on: February 25, 2011, 08:30:34 pm »
Thanks I'll try these two :)

Probably it will look something like this:
Code
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,7 @@
 
 bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
 {
-    if (token.m_ParentIndex != -1)
+    if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) != 0)
     {
         if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
             return false;
I'm not totally sure that the condition is correct.
Loaden, Ollydbg can you look at it?
« Last Edit: February 25, 2011, 08:38:48 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: The 20 February 2011 build (7017) is out.
« Reply #17 on: February 25, 2011, 10:24:24 pm »
I never saw this, are there any steps to reproduce this ?
The steps for non gtk-style patched C::B is to switch to the VC 7.1 style, then restart C::B.
The other styles seem to work, I should check them :)
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #18 on: February 26, 2011, 11:33:22 am »
I never saw this, are there any steps to reproduce this ?
The steps for non gtk-style patched C::B is to switch to the VC 7.1 style, then restart C::B.
The other styles seem to work, I should check them :)
I still don't get this error.
Does it happen with self-compiled C::B or only in official nightlies provided by killerbot.
Does it also happen on platforms other than windows ?
I tested it on windows 7 professional 64-bit with self-compiled C::B from (really) clean sources.

EDIT:
Does it only happen if a plugin is used (probably cppcheck like mentined above) or does it happen always ?
« Last Edit: February 26, 2011, 11:36:07 am by jens »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #19 on: February 26, 2011, 12:02:27 pm »
The screenshot above was the first time I see it happen on windows. I'm mostly using gentoo linux 64bit + debuggers branch.

Just tried almost clean trunk (rHEAD) and the same problem happens.

Code
Index: update
===================================================================
--- update      (revision 7028)
+++ update      (working copy)
@@ -97,12 +97,12 @@
 rm excludes.txt
 
 echo Stripping debug info from output tree
-strip output/codeblocks${EXEEXT}
+###strip output/codeblocks${EXEEXT}
 # strip output/cb_share_config${EXEEXT}
 strip output/cb_console_runner${EXEEXT}
 # strip output/codesnippets${EXEEXT}
-strip output/*.${LIBEXT}
-strip output/share/codeblocks/plugins/*.${LIBEXT}
+###strip output/*.${LIBEXT}
+###strip output/share/codeblocks/plugins/*.${LIBEXT}
 
 if [ "x$MSYSTEM" = "x" ] ; then
   echo Creating launch-scripts
Index: src/main.cpp
===================================================================
--- src/main.cpp        (revision 7028)
+++ src/main.cpp        (working copy)
@@ -1055,9 +1055,11 @@
     PluginManager* m_PluginManager = Manager::Get()->GetPluginManager();
 
     // user paths first
-    wxString path = ConfigManager::GetPluginsFolder(false);
-    Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
-    int count = m_PluginManager->ScanForPlugins(path);
+    int count = 0;
+    wxString path;
+//    path = ConfigManager::GetPluginsFolder(false);
+//    Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
+//    count += m_PluginManager->ScanForPlugins(path);
 
     // global paths
     path = ConfigManager::GetPluginsFolder(true);
Index: CodeBlocks-unix.cbp
===================================================================
--- CodeBlocks-unix.cbp (revision 7028)
+++ CodeBlocks-unix.cbp (working copy)
@@ -159,7 +159,7 @@
                                <Option working_dir="devel" />
                                <Option type="0" />
                                <Option compiler="gcc" />
-                               <Option parameters="--debug-log --multiple-instance -ns -ni" />
+                               <Option parameters="--debug-log --multiple-instance -ns -ni -p debug" />
                                <Option projectLinkerOptionsRelation="2" />
                                <Compiler>
                                        <Add option="-DENABLE_BINRELOC" />

Edit:

This seems to fix it:
Code
Index: src/notebookstyles.cpp
===================================================================
--- src/notebookstyles.cpp      (revision 7028)
+++ src/notebookstyles.cpp      (working copy)
@@ -197,7 +197,7 @@
     int x_ext = 0;
     wxSize s = GetTabSize(dc, wnd, wxT("ABCDEFGHIj"), wxNullBitmap, true,
                             wxAUI_BUTTON_STATE_HIDDEN, &x_ext);
-    return s.y + 4;
+    return s.y + 6;
 }
 
 NbStyleFF2::NbStyleFF2() : wxAuiDefaultTabArt()
« Last Edit: February 26, 2011, 12:11:39 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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 20 February 2011 build (7017) is out.
« Reply #20 on: February 26, 2011, 01:10:02 pm »
Thanks I'll try these two :)

Probably it will look something like this:
Code
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,7 @@
 
 bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
 {
-    if (token.m_ParentIndex != -1)
+    if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) != 0)
     {
         if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
             return false;
I'm not totally sure that the condition is correct.
Loaden, Ollydbg can you look at it?
Oh my god, the PrettyPrintToken will call recursively. and the condition was too complex to understand. let me have a look deeply.
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #21 on: February 26, 2011, 07:27:52 pm »
The condition is something like: if the token has parents and the token is a container or a function, then pretty print the parent of the token.

Jens:
I think this patches works around the problem:
Code
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp    (revision 7028)
+++ src/src/main.cpp    (working copy)
@@ -724,6 +724,10 @@
     if (!Manager::IsBatchBuild())
     {
         m_pInfoPane = new InfoPane(this);
+
+        long closestyle = Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/tabs_close_on_all"))?wxAUI_NB_CLOSE_ON_ALL_TABS:0;
+        DoUpdateEditorStyle(m_pInfoPane, _T("infopane"), closestyle | wxAUI_NB_DEFAULT_STYLE);
+
         m_LayoutManager.AddPane(m_pInfoPane, wxAuiPaneInfo().
                                   Name(wxT("MessagesPane")).Caption(_("Logs & others")).
                                   BestSize(wxSize(clientsize.GetWidth(), bottomH)).//MinSize(wxSize(50,50)).
The problem happens, because wxAuiNotebook::UpdateTabCtrlHeight is called.
Inside it there is some call to the cloning of the ArtProvider and probably something is pointing to the wrong/old ArtProvider.
Unfortunately I don't understand the way wxAUI works, nor how C::B uses it, so I can't debug further.
I couldn't reproduce it with the auidemo in wx2.9's sources.

With this patch my other gtk_style patch ( http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch ) works super :)
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #22 on: February 26, 2011, 08:31:47 pm »
The condition is something like: if the token has parents and the token is a container or a function, then pretty print the parent of the token.

Jens:
I think this patches works around the problem:
[...]
The problem happens, because wxAuiNotebook::UpdateTabCtrlHeight is called.
Inside it there is some call to the cloning of the ArtProvider and probably something is pointing to the wrong/old ArtProvider.
Unfortunately I don't understand the way wxAUI works, nor how C::B uses it, so I can't debug further.
I couldn't reproduce it with the auidemo in wx2.9's sources.

Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 20 February 2011 build (7017) is out.
« Reply #23 on: February 27, 2011, 03:28:44 am »
The condition is something like:
Ok, I understand now, and it should work fine. So I totally agree this fix :D
so, what about this one:

Code
//if the token has parents and the token is a container or a function, then pretty print the parent of the token.
if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) )

Also, the sentence can added as comments. :D

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #24 on: March 03, 2011, 09:57:19 am »
Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.
Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
If I don't remove my patch and remove target->SetTabCtrlHeight(-1); it works...
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #25 on: March 03, 2011, 10:00:37 am »
Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.
Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
If I don't remove my patch and remove target->SetTabCtrlHeight(-1); it works...
Really weird, it still does not happen for me on any machine.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #26 on: March 03, 2011, 11:44:31 am »
I'm using wxGTK 2.8.11 (which is build from the wxPython sources), gtk+ 2.22.1.

And this patch: http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #27 on: March 07, 2011, 08:14:34 am »
I'm using wxGTK 2.8.11 (which is build from the wxPython sources), gtk+ 2.22.1.

And this patch: http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch
In the meantime, I get this issue also, but not always and if I get it, it happens for "Logs & others" and the "Management"-pane.
I use a modified (and enhanced) version of your gtk-notebook patch.
I still never get it without this patch.
I will set some debug-messages to find the real cause for this issue.
Your workaround works, but I like it more, if I find the real cause.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #28 on: March 08, 2011, 08:52:01 am »
@oBFusCATed :
Could you please test the attached patch (if possible) ?

It moves an improved version of your gtk-notebook stuff into notebookstyles.{cpp|h} and should also fix the issue that some of the notebooks do not use the correct TabArtProvider after a start of C::B.

Improvements to the gtk-notebook stuff:
Always use the close-icon provided by gtk (switching theme now also switches close-icon),
use the foreground-color provided by gtk for active and inactive tabs,
use different height for active tabs (as gtk does it),
use a focus rectangle as gtk does it.

On some themes the "Build messages" tab might be one (or two) pixels too large (height), because the used icon has the wrong size.
If the patch will be committed, I also commit a fixed icon.

If there aren't any objections, I will commit this patch (using gtk as TabArtProvider for auinotebooks if default tab-theme is used on wxGTK systems).
This needs gtk-2.0 as build-dependency on linux.

EDIT:
I just updated the patch to fix an issue with the focus-rectangle on the rightmost tab.
If the tab is clipped, but still has the focus, the focus-rectangle was partially drawn
« Last Edit: March 08, 2011, 09:51:31 am by jens »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #29 on: March 08, 2011, 10:07:18 am »
OK, I'll test tonight, but I prefer the style to be in separate file.
I had an idea to show it to the wx guys, so it can be included in wxGTK, by default.
But I'm lacking the motivation to talk to them:)
(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!]