Author Topic: Symbols-Browser - Search "ABC" (unknown) hangs CB  (Read 4006 times)

Offline BjoernP

  • Multiple posting newcomer
  • *
  • Posts: 11
Symbols-Browser - Search "ABC" (unknown) hangs CB
« on: July 24, 2006, 03:36:29 am »
Hi all,
so back again, my second posting ever.  :D

Annoying buggy-thing seen for some time since:
When typing some unknown tag into the "Search" field of the symbol browser, CB hangs not responding, or seems so. System-Load is full, codeblocks.exe on top. Not so, if the doggy finds something in time. Maybe it's really still looking for it, then: limit depth of search-tree, have timeout, "Cancel Search" option (within some "Search running..." std-dialog)?
 
Anybody can repdoduce, working on this, any clue?

If needed, I will like to debug the beast the other day round and see what I can fix.


G'Night for now,
Björn

Rev 2778, WinXP, gcc-3.4.5
gcc-4.3-tdm (mingw), gcc-4.2.1-dw2 (mingw) << CB wx 2.8 (cvs WX_2_8_BRANCH)  << CB wx-2.9.x (cvs head) WinXP

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Symbols-Browser - Search "ABC" (unknown) hangs CB
« Reply #1 on: July 24, 2006, 04:02:18 am »
Rev. 2766 and I could reproduce it.

Offline BjoernP

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Symbols-Browser - Search "ABC" (unknown) hangs CB
« Reply #2 on: July 24, 2006, 10:13:10 pm »
The bug does not appear on every project, but does on the CB-Project itself. Feels like size matters here.

Added these lines into classbrowser.cpp +403:
Code
 
    tree->SelectItem( parent );
    tree->EnsureVisible( parent );
    tree->SetIndent(0); // ? Thought this would scroll tree-window to the left, this won't do it.
    tree->Update();
    wxMilliSleep(50);
...just for the fun if it.

Search goes to the bottom, then jumps up an down the tree again, from wxCRC32 up to the TypeInfo templates in SqPlus and or wxBase64 and down again. No pattern here, but the search sticks to the bottom of the tree.
After some time CB freezes up - maybe system's recursion limit exceeded, but no messages.
Maybe something acout the TreeIds messed up, duplicates?

IMHO:Can this search not be done more efficiently?  Recursion is evil, man!   8)

I had actually expected something like a token-lookup into a map-like thing in the class-browser, holding all the parsed symbols and attached info.
So shouldn't we rather ask the builder of the tree (Parser::BuildTree) where to find the wanted gizmo instead of scanning the whole wxTree?

Just my 2 cent...

BjoernP
gcc-4.3-tdm (mingw), gcc-4.2.1-dw2 (mingw) << CB wx 2.8 (cvs WX_2_8_BRANCH)  << CB wx-2.9.x (cvs head) WinXP