Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: danselmi on August 29, 2014, 02:47:28 pm

Title: Command line arguments evaluation
Post by: danselmi on August 29, 2014, 02:47:28 pm
Hi

Attached a patch to solve two issues:
1. The commandLine argument --file=c:\foo\bar.cpp:42
   should make CB open the file c:\foo\bar.cpp and show line 42.
   in fact it only opened the file without showing line 42.
   The reason for this is the colon after the drive letter.
2. If a cb instance is already running, the app of a second instance doesn't evaluate command line arguments given by plugins.
   With this patch, it becomes possible for plugins to receive command line arguments in the first instance (additional event).
   The realized solution does send the cmd line to the first instance where it is possible for plugins to check the Parse results.
   Patch to cbDiff-plugin http://forums.codeblocks.org/index.php/topic,12829.0.html (http://forums.codeblocks.org/index.php/topic,12829.0.html) to show the usage is also attached.

Any objections? If not, I will apply it in a few days.

wxWidgets bug which brings old arguments on new Parse() runs is already corrected, see here: http://trac.wxwidgets.org/changeset/77502 (http://trac.wxwidgets.org/changeset/77502)

Is anbody maintaining the cbDiff plugin?

regards danselmi
Title: Re: Command line arguments evaluation
Post by: MortenMacFly on August 29, 2014, 04:51:17 pm
Is anbody maintaining the cbDiff plugin?
Not to my knowledge. In fact I rarely used it... is it still working OK?
Title: Re: Command line arguments evaluation
Post by: danselmi on August 31, 2014, 07:30:20 pm
Is anbody maintaining the cbDiff plugin?
Not to my knowledge. In fact I rarely used it... is it still working OK?
Yes the version from https://github.com/ywx/cbDiff/trunk (https://github.com/ywx/cbDiff/trunk) is still working.
Title: Re: Command line arguments evaluation
Post by: MortenMacFly on September 05, 2014, 08:19:59 am
...btw: with respect to the patch:

This line:
Code
delete wxMessageOutput::Set(new cbMessageOutputNull); // no output
in app.cpp will cause a compilation error:

app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

This should be fixed before a possible commit.
Title: Re: Command line arguments evaluation
Post by: danselmi on September 05, 2014, 09:38:41 am
...btw: with respect to the patch:

This line:
Code
delete wxMessageOutput::Set(new cbMessageOutputNull); // no output
in app.cpp will cause a compilation error:

app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

This should be fixed before a possible commit.

Which wx version have you tested? 2.8 or 3.0?
Title: Re: Command line arguments evaluation
Post by: MortenMacFly on September 05, 2014, 10:15:03 am
Which wx version have you tested? 2.8 or 3.0?
Ooops - I forgot to tell: wx30, 64 bit.
Title: Re: Command line arguments evaluation
Post by: danselmi on September 11, 2014, 09:19:12 pm
...
This should be fixed before a possible commit.
Please test with the attached patch.
Title: Re:
Post by: MortenMacFly on September 30, 2014, 08:11:36 pm
Patch tested and this one works for all of my builds.
Title: Re: Command line arguments evaluation
Post by: seahawkibiza on April 01, 2015, 01:24:59 pm
I know, its a old thread, but I have the same problem.

I build from a fresh svn_trunk.

I use wheezy on armhf, wxWidgets 2.9.4 with opengl support

I get the same error
app.cpp:1096:44: error: cannot allocate an object of abstract type '{anonymous}::cbMessageOutputNull'
app.cpp:297:7: note:   since type '{anonymous}::cbMessageOutputNull' has pure virtual functions

but cant apply the patch, because is too old.

Any solutions?
Title: Re: Command line arguments evaluation
Post by: oBFusCATed on April 01, 2015, 05:16:41 pm
wxWidgets bug which brings old arguments on new Parse() runs is already corrected, see here: http://trac.wxwidgets.org/changeset/77502 (http://trac.wxwidgets.org/changeset/77502)
BTW. I think this same bug is causing http://sourceforge.net/p/codeblocks/tickets/133/

The passed file on the command line is opened twice and something bad happens:)