News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Symbol browser shows duplicate entries when sorted, except when sorted by access

Started by Micool121, December 26, 2009, 06:34:41 PM

Previous topic - Next topic

Micool121

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]

ollydbg

Quote from: Micool121 on December 26, 2009, 06:34:41 PM
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?
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.

Jenna

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.

Micool121

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]

Jenna

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.

ollydbg

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. :(
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.

Jenna

Quote from: 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. :(

I use a dummy here ( /tmp )and it works, you can not compile it anyway, so it doesn't matter what you have there.

ollydbg

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:
       gfxScene(spsysDiagram * diagram);
In CPP:

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)
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.

Micool121

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 ;)

ollydbg

Quote from: Micool121 on December 28, 2009, 11:39:36 AM
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
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.