Author Topic: Symbol browser shows duplicate entries when sorted, except when sorted by access  (Read 8455 times)

Offline Micool121

  • Multiple posting newcomer
  • *
  • Posts: 15
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]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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.

Offline Micool121

  • Multiple posting newcomer
  • *
  • Posts: 15
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]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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)
« Last Edit: December 28, 2009, 08:44:11 am by ollydbg »
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 Micool121

  • Multiple posting newcomer
  • *
  • Posts: 15
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 ;)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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
« Last Edit: December 28, 2009, 02:00:22 pm by ollydbg »
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.