Menu

#1061 Fix Symbol Browser compilation when CC_NO_COLLAPSE_ITEM is undefined

Next_Release
applied
Patch
2021-05-04
2021-01-26
No

Currently compilation of classbrowser.cpp fails when CC_NO_COLLAPSE_ITEM is not defined. This macro is defined in CBP files, but not when using autotools, so the fail was not detected when it should. The attached patch removes place holder GetId() call and adds the real code.

I think CC_NO_COLLAPSE_ITEM should be defined (or not) in all builds, current status is error prone and complicates debugging because the program behaves differently depending on how it was build.

1 Attachments

Discussion

  • Teodor Petrov

    Teodor Petrov - 2021-01-26

    I think CC_NO_COLLAPSE_ITEM should be defined (or not) in all builds

    Yes, it should, but I don't see you doing it in this patch.

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-01-26

    First, I don't know autotools. Second, before changing anything it must be decided if macro definition must be removed from the C::B projects or added to the makefile (or sources modified to ignore it altogether).

    IMHO, it is better to define the macro everywhere now and change the code after some months of mileage to ignore the macro .

     
  • Teodor Petrov

    Teodor Petrov - 2021-01-26
    • assigned_to: Morten MacFly
     
  • Lieven de Cock

    Lieven de Cock - 2021-01-30

    what's the status, since the build is still broken due to this ?

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-01-30

    The patch fixes compilation with autotools, a later patch should add CC_NO_COLLAPSE_ITEM to autotools or remove it from the CBP files. This is an optimization flag and its effect is minimal.

    I don't know if Morten MacFly knows this has been assigned to him.

     
  • Lieven de Cock

    Lieven de Cock - 2021-02-07

    I will apply this patch, but the CC_NO_COLLAPSE_ITEM subject remains open.

     
  • Lieven de Cock

    Lieven de Cock - 2021-02-07

    applied
    do we keep this open for the follow up discussion on CC_NO_COLLAPSE_ITEM ?

     
  • Teodor Petrov

    Teodor Petrov - 2021-02-07

    Yes, keep it open. Someone should step up and do the work.
    If I understand it correctly currently we'll ship different builds on linux and windows.

     

    Last edit: Teodor Petrov 2021-02-07
  • Miguel Gimenez

    Miguel Gimenez - 2021-02-09

    The attached patch removes checking of CC_NO_COLLAPSE_ITEM from code, leaving the code as if it were defined, and also removes the macro definition from the CBP files.

    This does not change anything when using CBP files, but makes linux build with autotools identical to the build with CBP.

     
  • Teodor Petrov

    Teodor Petrov - 2021-03-06

    Is this last patch still needed? Anything else to do here?

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-03-06

    Currently Linux and MSW generated binary differ slightly due to the absence of CC_NO_COLLAPSE_ITEM in Linux makefiles. This has little sense, and the most reliable way to fix this is removing support for this macro instead of messing with autotools.

     
  • Teodor Petrov

    Teodor Petrov - 2021-04-30

    I don't get this - why have you removed all the code and not just ifdef and make this code always enabled?

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-04-30

    I want the code always disabled (it is inside #ifndef).

    The code is a very minor optimization with major code obfuscation. I removed it because it will be hardly needed and I don't want/know how to mess with autotools to define CC_NO_COLLAPSE_ITEM

     
  • ollydbg

    ollydbg - 2021-05-03

    Hi, I see this patch is in our trunk now. (in r12314)

    I think the code wrapped by CC_NO_COLLAPSE_ITEM #if condition is for optimization.

    When a node is expand, the child nodes (sub tree) will get calculated.
    When a node is collapsed, the child nodes will get deleted.

    I don't think this is wrong here, do you? Because the symbol tree is big, and some node(scope) could have many child nodes, so keep the tree dynamic is good from my point of view.

    So, generally I think those code should be enabled by default.

     
  • ollydbg

    ollydbg - 2021-05-03
    • labels: SymbolBrowser --> SymbolBrowser, CodeCompletion
     
  • Miguel Gimenez

    Miguel Gimenez - 2021-05-03

    That code was already disabled (in MSW) long before the symbol browser was proscribed, only Linux used it, but I think it is because the author forgot about it. The code completion trees usually have shallow branches (they have few leaves), so keeping the branch when collapsing it is not a problem.

    The patch could be reverted, but then either CBP files or autotools files must be modified so both define CC_NO_COLLAPSE_ITEM or both have it undefined.

     
  • Teodor Petrov

    Teodor Petrov - 2021-05-04
    • status: open --> applied
    • assigned_to: Morten MacFly --> Teodor Petrov
     
  • Teodor Petrov

    Teodor Petrov - 2021-05-04

    @ollydbg If you think and can show a use case where this code is need feel free to restore it. For now I'm closing this ticket.

     

Log in to post a comment.