Menu

#1280 Command line parameter --multiple-instance not working in Nightly SVN12829

Undefined
open
nobody
None
Bug_Report
2022-07-21
2022-07-03
No

I am trying to make changes to C::B startup when there is no config file and debug the code to find an issue I am having that could be due to my code. To do this I have set the C::B parameters to "--personality debuging --multiple-instances", but the C::B debugee will not start....gr

I have traced it to the "--multiple-instances" parameter not working as in the following step 2 does not start another C::B instance on Windows:
1) Start a C::B instance
2) In a command prompt try to run C::B again using the following command line:
"C:\Program Files\CodeBlocks\codeblocks.exe" --personality=debuging --multiple-instances

I have also tried "--profile=debuging.
Step 2 above works if I do not include the "--personality=debuging" parameter......

Discussion

  • Andrew Cottrell

    Andrew Cottrell - 2022-07-03

    I tracked an issue to the following code snippet from app.cpp code block between lines 662-700:

            ConfigManager *appCfg = Manager::Get()->GetConfigManager("app");
            if (m_DDE && !m_Batch && appCfg->ReadBool("/environment/use_ipc", true))
            {
    ---- CODE SRC REMOVED ----      
                    log->Log("Ending application because another instance has been detected!");
    
                    // return false to end the application
                    return false;        
            }
    

    The if check above does not include any condition for the --multiple-instances parameter or the appCfg single_instance value. I have hacked my local code as following to get it working, but it needs more checking and testing before it can be classified as working or a real fix:

    ConfigManager *appCfg = Manager::Get()->GetConfigManager("app");
    if (
            m_DDE &&
            !m_Batch &&
            appCfg->ReadBool("/environment/use_ipc", true) &&
            appCfg->ReadBool("/environment/single_instance", true) &&
            !parser.Found("multiple-instance")
        )
    {
    

    The block of code after this one also needs to be looked at as they are similar in that they both try to detect multiple C::B instances but via different methods (in the code blocks in app.cpp), but they do different things once a multiple instances are detected. It may be possible to simplify the code to detect multiple C::B instances and then do something based on the command or config parameters instead of the over way around. Just a thought.

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-07-21

    Possibly related to ticket [#1083].

     

    Related

    Tickets: #1083


    Last edit: Miguel Gimenez 2022-07-21
    • Andrew Cottrell

      Andrew Cottrell - 2022-07-21

      I agree is is possibly related.

      BTW earlier this week I spotted an issue(C::B does not start) with the "--debug-log" parameter only when debugging C::B from C::B, but it works running C::B from a command line. I The issue in the code could be in the same area , but I have not looked into it in more detail. When I get time I will and raise another ticket with info in it. I thought I may mention it here just in case someone spots a fix for it while looking at this ticket.

       

      Last edit: Andrew Cottrell 2022-07-21

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.