Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Micool121 on December 26, 2009, 06:34:41 pm

Title: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Micool121 on December 26, 2009, 06:34:41 pm
Symbol browser shows duplicate entries when sorted in bottom tree, except when sorted by access :

I'm starting a new project and I noticed that the symbol browser has duplicates functions entries. I'm using 5911 build with ubuntu 9.10

the bug may be a sorting issue, because the sort by access is correct ( see pictures ) although other sorting options shows duplicates entries.

This appears to be a specific issue for 5911 on both win32 and linux , I've cheked : symbol browser worked fine in build 5859 on both.

[attachment deleted by admin]
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: ollydbg on December 27, 2009, 01:26:04 am
This appears to be a specific issue for 5911 on both win32 and linux , I've cheked : symbol browser worked fine in build 5859 on both.
So, this is not a serious bug :D, I will check it. Can you supply a test code so that we can reproduce this bug?
Is this reproduced in the latest SVN trunk build CB?
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Jenna on December 27, 2009, 10:13:30 am
If you provide a simple test-code, I can checkke whether it i sreally a sorting or a parser-issue, because double-entries in the same namespace should (of course) not happen.

It might take some time, because I'm not at home for the next three or four days.
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Micool121 on December 27, 2009, 12:51:05 pm
Hello, thank you for your answers ;)

Here attached you will find an extract of my project showing the issue. ( It just shows some classes and is not compilable )

I didn't checked it with the latest SVN unfortunately  :(

Regards,

[attachment deleted by admin]
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Jenna on December 27, 2009, 03:21:35 pm
There is indeed a sorting bug, but it is in sort-by-access, because the double-entries come from the parser and the symbols-browser should show them.
They show a parser bug/issue, that should be fixed in the parser and not in the classbrowserbuilderthread.
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: ollydbg on December 28, 2009, 08:32:04 am
I can't open the project, because C::B always ask for variables definition like "qt4" and others. But I didn't have qt installed in my computer. :(
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Jenna on December 28, 2009, 08:36:01 am
I can't open the project, because C::B always ask for variables definition like "qt4" and others. But I didn't have qt installed in my computer. :(

I use a dummy here ( /tmp )and it works, you can not compile it anyway, so it doesn't matter what you have there.
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: ollydbg on December 28, 2009, 08:38:09 am
Ok, using dummy folder works.

I guess this is caused by a patch to fix the function argument. There is a patch supplied by visualfc, he add some code to get the "real function argument", so, these function prototypes give the same entry.

int fun( int a = 0 );
int fun( int b = 0 );



Edit:
Ok, this is a problem by add Tokens. For example, in the sample code there is something like this:

In header:
Code
        gfxScene(spsysDiagram * diagram);
In CPP:

Code
gfxScene::gfxScene(spsysDiagram * diagram)
{
    setSceneRect(QRectF(0,0,1600,1200) ); //
    rightBorder = 10;
    topBorder = 20;
    offsetShadow = 8;
    dragging = false;
    linkedDiagram = diagram;

}

When the parser meet the first function prototype, it add a Token(declaration), but the argument is striped.
When the parser meet the second function implementation, it checks a Token is already exist, but it can't find one, so, he just add another Token(has both declaration and implementation in the same place)
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: Micool121 on December 28, 2009, 11:39:36 am
Ok I understand, one thing let me perplexed is that some functions are corectly parsed , and some others are not.

At the begining I thought it was becase of caracter encoding issues but it's seem not to be related to that... (some file are UTF-8 encoded, some others are windows-1252). I tryed to use UTF-8 everywhere: it gave the same behaviour.

An other thing :adding a single space chr after the semicolon of "  gfxScene(spsysDiagram * diagram); " in the header modifies the way the parser recognises the functions, adding comments does the same... give it a try.

I hope this helps ;)
Title: Re: Symbol browser shows duplicate entries when sorted, except when sorted by access
Post by: ollydbg on December 28, 2009, 12:30:49 pm
An other thing :adding a single space chr after the semicolon of "  gfxScene(spsysDiagram * diagram); " in the header modifies the way the parser recognises the functions, adding comments does the same... give it a try.

I can confirm this, I will look into it.

Edit

As a reminder, see this SVN log message:

rev 5873

Quote
* do not remove doubles in the symbols-browser; they reflect a parser issue, that can not be handled correctly by the symbols browser, and removed doubles most likely contain information that gets lost otherwise