News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Command line arguments evaluation

Started by danselmi, August 29, 2014, 02:47:28 PM

Previous topic - Next topic

danselmi

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.next.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

Is anbody maintaining the cbDiff plugin?

regards danselmi
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

MortenMacFly

Quote from: danselmi on August 29, 2014, 02:47:28 PM
Is anbody maintaining the cbDiff plugin?
Not to my knowledge. In fact I rarely used it... is it still working OK?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

danselmi

Quote from: MortenMacFly on August 29, 2014, 04:51:17 PM
Quote from: danselmi on August 29, 2014, 02:47:28 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 is still working.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

MortenMacFly

...btw: with respect to the patch:

This line:
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

danselmi

Quote from: MortenMacFly on September 05, 2014, 08:19:59 AM
...btw: with respect to the patch:

This line:
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?
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

MortenMacFly

Quote from: danselmi on September 05, 2014, 09:38:41 AM
Which wx version have you tested? 2.8 or 3.0?
Ooops - I forgot to tell: wx30, 64 bit.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

danselmi

Quote from: MortenMacFly on September 05, 2014, 08:19:59 AM
...
This should be fixed before a possible commit.
Please test with the attached patch.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

MortenMacFly

Patch tested and this one works for all of my builds.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

seahawkibiza

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?

oBFusCATed

Quote from: danselmi on August 29, 2014, 02:47:28 PM
wxWidgets bug which brings old arguments on new Parse() runs is already corrected, see here: 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:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]