Code::Blocks Forums

User forums => Nightly builds => Topic started by: killerbot on March 06, 2011, 06:15:02 pm

Title: The 06 March 2011 build (7040) is out.
Post by: killerbot on March 06, 2011, 06:15:02 pm
Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works (http://forums.codeblocks.org/index.php/topic,3232.0.html).

A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc451-TDM.7z

For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc451-TDM.7z

The 06 March 2011 build is out.
  - Windows :
   http://prdownload.berlios.de/codeblocks/CB_20110306_rev7040_win32.7z
  - Linux :
   none

Resolved Fixed:


Regressions/Confirmed/Annoying/Common bugs:


Title: Re: The 06 March 2011 build (7040) is out.
Post by: Jenna on March 06, 2011, 10:26:47 pm
Debian packages (binaries and sources) for 32-bit and 64-bit systems can be found in my repo (http://apt.jenslody.de/).
Title: Re: The 06 March 2011 build (7040) is out.
Post by: Phenom on March 23, 2011, 08:25:21 pm
I want to report something very annoying.

Open the project properties dialog and switch to the Build targets tab.
Select a target and edit something(type, output, working path.....) and after that click the white space below the project targets
listbox. All your modifications are lost....

Title: Re: The 06 March 2011 build (7040) is out.
Post by: killerbot on March 23, 2011, 10:24:42 pm
can't reproduce this, what am I missing ?
Title: Re: The 06 March 2011 build (7040) is out.
Post by: Phenom on March 24, 2011, 09:20:52 am
I think I wasn't clear enough. Hope the attached image helps.

Title: Re: The 06 March 2011 build (7040) is out.
Post by: MortenMacFly on March 24, 2011, 10:27:10 am
I think I wasn't clear enough. Hope the attached image helps.
This is by design. You should leave the window (e.g. text box...) you are editing before selecting another target. Otherwise your input in cancelled.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: Jenna on March 24, 2011, 11:01:04 am
I think I wasn't clear enough. Hope the attached image helps.
This is by design. You should leave the window (e.g. text box...) you are editing before selecting another target. Otherwise your input in cancelled.
That's quite unintuitive in my opinion and what's more, it behaves different on linux (that's why I never noticed it before).
And if I want to edit properties of more than one target I have to leave and reopen the dialog multiple times, very annoying.

It should either not happen (as on linux) or there should at least be an "Apply"-button and probably an annoying-dialog that warns that changes get lost, if the target is changed.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: fubo on March 24, 2011, 11:09:56 am
Found an issue in building project with multiple targets.
If you have target "a" and "b" and specify a custom variable "foo=dummy" in "b" without specifying it for "a", it is used also in "a". I can get rid of this by defining "foo=" in target "a".
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ahui886 on March 25, 2011, 03:07:04 am
great,well done
Title: Re: The 06 March 2011 build (7040) is out.
Post by: eternallite on March 30, 2011, 09:01:00 am
Hello! This is not really a big problem but I noticed that the new call tip doesn't bold the current argument you are on
while typing; for example, in SVN 6992, if a function f(int arg0, int arg1, int arg2) exists,
typing f(1, 2

while staying on 2, arg1 will appear bolded which is quite nifty but the new calltip doesn't seem
to be doing that :\

Anyway, wonderful job nonetheless :)
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on March 30, 2011, 09:17:26 am
Hello! This is not really a big problem but I noticed that the new call tip doesn't bold the current argument you are on
while typing; for example, in SVN 6992, if a function f(int arg0, int arg1, int arg2) exists,
typing f(1, 2

while staying on 2, arg1 will appear bolded which is quite nifty but the new calltip doesn't seem
to be doing that :\

Anyway, wonderful job nonetheless :)
I can confirm this on my self build rev 7071 (Windows,wx2.8.11), I will take sometime to check it.  :D
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 01, 2011, 04:50:19 am
Hello! This is not really a big problem but I noticed that the new call tip doesn't bold the current argument you are on
while typing; for example, in SVN 6992, if a function f(int arg0, int arg1, int arg2) exists,
typing f(1, 2

while staying on 2, arg1 will appear bolded which is quite nifty but the new calltip doesn't seem
to be doing that :\

Anyway, wonderful job nonetheless :)
I can confirm this on my self build rev 7071 (Windows,wx2.8.11), I will take sometime to check it.  :D

it seems the code: codecompletion.cpp line around 1446
Code
    int start = 0;
    int end = 0;
    int count = 0;
    int commas = m_NativeParser.GetCallTipCommas(); // how many commas has the user typed so far?
    wxArrayString items = m_NativeParser.GetCallTips(maxCalltipLineSizeInChars);
    std::set< wxString, std::less<wxString> > unique_tips; // check against this before inserting a new tip in the list
    wxString definition;
    for (unsigned int i = 0; i < items.GetCount(); ++i)
    {
        // allow only unique, non-empty items with equal or more commas than what the user has already typed
        if (unique_tips.find(items[i]) == unique_tips.end() && // unique
            !items[i].IsEmpty() && // non-empty
            commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied
        {
            unique_tips.insert(items[i]);
            if (count != 0)
                definition << _T('\n'); // add new-line, except for the first line
            definition << items[i];
            m_NativeParser.GetCallTipHighlight(items[i], &start, &end);
            ++count;
        }
    }
    if (!definition.IsEmpty())
        ed->GetControl()->CallTipShow(pos, definition);
//    Manager::Get()->GetLogManager()->DebugLog(_T("start=%d, end=%d"), start, end);
    // only highlight current argument if only one calltip (scintilla doesn't support multiple highlighting ranges in calltips)
    ed->GetControl()->CallTipSetHighlight(count == 1 ? start : 0, count == 1 ? end : 0);
}
the text between "start" and "end" will be highlight, but these interval was always wrong.  :(
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 01, 2011, 08:13:10 am
ok, debug a little, and I have found that the reason is:

recently, we use some pretty printer mechanism to do the call tip,
My test code is:
Code
void f11111(int arg0, int arg1, int arg2);

f11111(1111111,)
I just enter a commas in the last line.


so the code works wrong

Code

int commas = m_NativeParser.GetCallTipCommas(); // how many commas has the user typed so far?
    wxArrayString items = m_NativeParser.GetCallTips(maxCalltipLineSizeInChars);
    std::set< wxString, std::less<wxString> > unique_tips; // check against this before inserting a new tip in the list
    wxString definition;
    for (unsigned int i = 0; i < items.GetCount(); ++i)
    {
        // allow only unique, non-empty items with equal or more commas than what the user has already typed
        if (unique_tips.find(items[i]) == unique_tips.end() && // unique
            !items[i].IsEmpty() && // non-empty
            commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied
        {
            unique_tips.insert(items[i]);
            if (count != 0)
                definition << _T('\n'); // add new-line, except for the first line
            definition << items[i];
            m_NativeParser.GetCallTipHighlight(items[i], &start, &end);
            ++count;
        }
    }
Here, items[0]="void f11111(int arg0, int arg1, int arg2)"
and commas calculated by "m_NativeParser.GetCallTipCommas();" is 1

But see the statement:
Code
commas <= m_NativeParser.CountCommas(items[i], 1)) // commas satisfied

This will get false, because we pass a full string "void f11111(int arg0, int arg1, int arg2)", and CountCommas return ZERO. so we have No way to calculate the "start" and "end".

Maybe, the idea is: pass only the argument string which is "int arg0, int arg1, int arg2" to CountCommas() function, so the commas position should be satisfied.

Any ideas??? :D
Title: Re: The 06 March 2011 build (7040) is out.
Post by: Cubic on April 01, 2011, 02:51:10 pm
I don't know if this is related, but the call tip apparently appears only after the first comma is entered, and disappears for good if the first comma is deleted.
ex:
Code
void uninitGL(HWND hWnd);
No tip:
Code
uninitGL(hWnd);
Tip:
Code
uninitGL(,hWnd);
Tip disappears again and doesn't reappear:
Code
uninitGL();
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 01, 2011, 04:27:00 pm
It is not related (probably), but it is very annoying behavior, it is great that you've been able to reproduce it.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: Cubic on April 01, 2011, 11:01:01 pm
Another thing I noticed: This doesn't happen the first time code completition kicks in - the first time everything works fine, it is only after you deleted a -first- comma for the first time (while the tip is being shown) it starts behaving weird.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 02, 2011, 04:12:49 am
If I revert the change in rev 6997 around the line 1888 in nativeparser

revert to:
Code
            if (token->GetFormattedArgs() != _T("()"))
            {
                wxString s;
                BreakUpInLines(s, token->GetFormattedArgs(), chars_per_line);
                m_CallTips.Add(s);
            }
            else if (token->m_TokenKind == tkTypedef && token->m_ActualType.Contains(_T("(")))
                m_CallTips.Add(token->m_ActualType);

then, the highlight in call tip works fine.  :D
Title: Re: The 06 March 2011 build (7040) is out.
Post by: killerbot on April 02, 2011, 07:52:18 am
could you commit this ? Then we can include it in this weekends nightly build.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 02, 2011, 08:05:15 am
could you commit this ? Then we can include it in this weekends nightly build.
?me? or other guy??? :?

PS:
forget to mention there is a patch to avoid a recursive class hierarchy search which can avoid the crash of CC.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: MortenMacFly on April 02, 2011, 09:09:55 am
could you commit this ?
Please don't. This would disable the pretty print of tokens and (even worse) would leave unused code stubs.

I think oBFusCATed should look into it. He provided the pretty print part and I believe with the research done by ollydbg he might be able to fix this in a way that we can keep the pretty printing (I am personally quite used to it meanwhile).
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 02, 2011, 12:55:00 pm
Yes, I'll look at it :)
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 02, 2011, 03:02:12 pm
By reading the CC's source code these days, I just realize that "calltip" and "valuetip" are not the same thing. :D, I do not quite understand this before.

call tip is some tips showing when user were entering a function call statement, it assist the user by highlight the current function argument. call tips can fired by user adding a char, or by short cut key. it surely need to count the "commas" numbers user has already entered.

value tip is some tips that when you mouse hover an identifier, the tips contains the "type" information about the current token under mouse.

so, I think some comments which I created before in CC was wrong, I will try to fix them. :D
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 02, 2011, 07:47:13 pm
Probably something like that should fix the bug: http://smrt.is-a-geek.org/codeblocks/patches/call_tip_highlight1.patch

The patch is tested only on a small example, so please test and report if there are problems with it.
If there are no problems in the next week, I'll commit it.  :lol:
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 03, 2011, 08:07:58 am
Probably something like that should fix the bug: http://smrt.is-a-geek.org/codeblocks/patches/call_tip_highlight1.patch

The patch is tested only on a small example, so please test and report if there are problems with it.
If there are no problems in the next week, I'll commit it.  :lol:
nice, one thing I should suggest is :

Code
        while (--pos > 0)
        {
            const int style = searchData.control->GetStyleAt(pos);
            if (   searchData.control->IsString(style)
                || searchData.control->IsCharacter(style)
                || searchData.control->IsComment(style) )
            {
                continue;
            }

            const wxChar ch = searchData.control->GetCharAt(pos);
            if (ch == _T(';'))
                return;

this is a "backword" search, I think it should break on a "{".

so
Code
            if (ch == _T(';')  || ch == _T('{')  )
                return;

and, for a consistent, the "(" we call open parenthesis instead of open bracket.

see: in the parserthread.cpp
Code
namespace ParserConsts
{
    const wxString space           (_T(" "));
    const wxString spaced_colon    (_T(" : "));
    const wxString empty           (_T(""));
    const wxString equals          (_T("="));
    const wxString hash            (_T("#"));
    const wxString plus            (_T("+"));
    const wxString asterisk        (_T("*"));
    const wxString comma           (_T(","));
    const wxString commaclbrace    (_T(",}"));
    const wxString dash            (_T("-"));
    const wxString dot             (_T("."));
    const wxString colon           (_T(":"));
    const wxString dcolon          (_T("::"));
    const wxString semicolon       (_T(";"));
    const wxString semicolonopbrace(_T(";{"));
    const wxString semicolonclbrace(_T(";}"));
    const wxString lt              (_T("<"));
    const wxString gt              (_T(">"));
    const wxString gtsemicolon     (_T(">;"));
    const wxString quot            (_T("\""));
    const wxString kw_C            (_T("\"C\""));
    const wxString kw_CPP          (_T("\"C++\""));
    const wxString kw__asm         (_T("__asm"));
    const wxString kw_class        (_T("class"));
    const wxString kw_const        (_T("const"));
    const wxString kw_define       (_T("define"));
    const wxString kw_undef        (_T("undef"));
    const wxString kw_delete       (_T("delete"));
    const wxString kw_do           (_T("do"));
    const wxString kw_else         (_T("else"));
    const wxString kw_enum         (_T("enum"));
    const wxString kw_extern       (_T("extern"));
    const wxString kw_for          (_T("for"));
    const wxString kw_friend       (_T("friend"));
    const wxString kw_if           (_T("if"));
    const wxString kw_elif         (_T("elif"));
    const wxString kw_include      (_T("include"));
    const wxString kw_inline       (_T("inline"));
    const wxString kw_namespace    (_T("namespace"));
    const wxString kw_operator     (_T("operator"));
    const wxString kw_private      (_T("private"));
    const wxString kw_protected    (_T("protected"));
    const wxString kw_public       (_T("public"));
    const wxString kw_return       (_T("return"));
    const wxString kw_static       (_T("static"));
    const wxString kw_struct       (_T("struct"));
    const wxString kw_switch       (_T("switch"));
    const wxString kw_template     (_T("template"));
    const wxString kw_typedef      (_T("typedef"));
    const wxString kw_typename     (_T("typename"));
    const wxString kw_union        (_T("union"));
    const wxString kw_using        (_T("using"));
    const wxString kw_virtual      (_T("virtual"));
    const wxString kw_volatile     (_T("volatile"));
    const wxString kw_while        (_T("while"));
    const wxString opbrace         (_T("{"));
    const wxString opbracesemicolon(_T("{;"));
    const wxString clbrace         (_T("}"));
    const wxString tilde           (_T("~"));
};

So, I suggest using the name "FindFunctionOpenParenthesis". :D

I just test your patch, and works flawless. great job!!!
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 03, 2011, 12:53:09 pm
Ollydbg: I don't understand what you are trying to say...

I've just modified the code and tried to follow the style of the code around it...
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 03, 2011, 02:07:23 pm
Ollydbg: I don't understand what you are trying to say...
I mean the function name FindFunctionOpenBrace should be changed to FindFunctionOpenParenthesis.

Also, when counting the commas, it should stopped when meet a "{".
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 03, 2011, 02:28:13 pm
I mean the function name FindFunctionOpenBrace should be changed to FindFunctionOpenParenthesis.
This could be done.

Also, when counting the commas, it should stopped when meet a "{".
Why? Do you have a failing test case?
I think, it would stop earlier, so the change is not needed. By the way, I've not modified this searching code, I've just removed some member variables there.

BTW: This patch will fail with a function returning a function pointer, but at the moment the CC doesn't parse such functions correctly anyway :)
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 03, 2011, 03:35:42 pm
Also, when counting the commas, it should stopped when meet a "{".
Why? Do you have a failing test case?
I think, it would stop earlier, so the change is not needed. By the way, I've not modified this searching code, I've just removed some member variables there.

for example:
Code
c.g();
a.f(arg0,|);
this way, the backward search will stop at the first semicolon.

for example:

Code
for(...)
{
a.f(arg0,|);
}
You see, the backward search should stop at the first open brace.

Os, the backward search should stop after a "C statement".
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 03, 2011, 05:06:50 pm
I don't understand what is the problem here?
Can you show me a testcase where the code fails?
If you can't no changes to the code will be made!
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 04, 2011, 02:52:03 am
I don't understand what is the problem here?
Can you show me a testcase where the code fails?
If you can't no changes to the code will be made!
I just do a research a little, and found that the "backward search" is expat started in the parentheses.
So, e.g.
Code
for(...)
{
a.f(arg0,|);
}
This way, the "backward search" will stop at the open parenthesis of the a.f(. Let's say, the "backward search" stops at an un-balanced open parenthesis. So, this works OK normally.

But what dose the code:
Code
            if (ch == _T(';'))
                return;
I suspect: In a function call statement, in the parentheses, does any one will write a ";" ?
I think these will be no semicolon there.
The semicolon is just used to stop the "backward search" in some cases to avoid the "backward search" goes too far.

So, if the code:
Code
c.g();
a.f(arg0)|

or

for(...)
{
a.f(arg0)|
}

If the user mistakenly press the short cut to show tip, then, the "backward search" can safely be stopped at the "{" or ";" to save a lot of performance. Otherwise, the "backward search" will go to an earlier and wrong place.

Any ideas?

Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 04, 2011, 10:31:26 am
Any ideas?
Have you seen the initializers in c++-0x?
Your suggestion probably will break the call tip in this mode.

Also what you are talking about is not directly related to my patch, am I correct?
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 04, 2011, 01:33:24 pm
Any ideas?
Have you seen the initializers in c++-0x?
Your suggestion probably will break the call tip in this mode.
No, so maybe, we can leave it as it is.

Quote
Also what you are talking about is not directly related to my patch, am I correct?
correct! I can't find any thing wrong.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 04, 2011, 02:06:25 pm
No, so maybe, we can leave it as it is.
We can add a counter and if the counter is greater than 1000 characters (for example), we stop the search :)
Can you do some measurements, if this is really a performance problem?
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 04, 2011, 02:10:39 pm
No, so maybe, we can leave it as it is.
We can add a counter and if the counter is greater than 1000 characters (for example), we stop the search :)
Yes, 1000 chars is quite enough.

Code
Can you do some measurements, if this is really a performance problem?
add a timer to test it? and log out the time? :D

PS:
If we catch the new added char every time, then we can avoid counting the commas every time we do the calltip. :D I mean, we can only check the new added char, if it is a commas, then we can increase the previous value.
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 04, 2011, 03:10:58 pm
Code
Can you do some measurements, if this is really a performance problem?
add a timer to test it? and log out the time? :D
My idea you to do it, because I don't care, too much about it :)
Title: Re: The 06 March 2011 build (7040) is out.
Post by: oBFusCATed on April 09, 2011, 12:05:27 pm
The patch is committed, so please test again :)
Title: Re: The 06 March 2011 build (7040) is out.
Post by: ollydbg on April 09, 2011, 04:48:20 pm
The patch is committed, so please test again :)
Nice, it works fine!