Passing command line arguments to dbg

Discussion about CodeLite development process and patches
Xavi
CodeLite Enthusiast
Posts: 12
Joined: Mon Apr 19, 2010 4:52 pm
Genuine User: Yes
IDE Question: C++

Passing command line arguments to dbg

Post by Xavi »

I don't understand well the commands "-exec-run " + args or "target remote "+ comm + " " + args of DbgGdb::Run()
But in the typical main( int argc, char ** argv ), argc is always 1; the ejutable program name.
It would be better to set the arguments, if any, with the command "set args" + args

OT: I guess root sources of wxScintilla now (wxWidgets > 2.8) is in the adaptation of {wxWidgets.svn}\src\stc
Is it right?
--
Xavi
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Passing command line arguments to dbg

Post by eranif »

Xavi wrote:I don't understand well the commands "-exec-run " + args or "target remote "+ comm + " " + args of DbgGdb::Run()
But in the typical main( int argc, char ** argv ), argc is always 1; the ejutable program name.
It would be better to set the arguments, if any, with the command "set args" + args
codelite does not use the standard CLI interface of gdb, it uses the MI interface (its the Machine Interface of gdb).

using

Code: Select all

(gdb)set args <arguments>... 
(gdb)run
is similar to

Code: Select all

(gdb)run <arguments>
codelite uses:

Code: Select all

-exec-run <arguments>
Anyways, what is the problem that you are trying to solve?
Xavi wrote:"target remote "+ comm + " "
This is the way codelite connect to gdbserver to allow remote debugging
Xavi wrote:OT: I guess root sources of wxScintilla now (wxWidgets > 2.8) is in the adaptation of {wxWidgets.svn}\src\stc
Is it right?
No, codelite uses its own source which are fork of the last maintained version of wxScintilla (1.62) - the sources are up to date to version 2.2 of scintilla + many changes I made into them.
STC is another component (similar to wxScintilla) - but they are not the same.

Eran
Make sure you have read the HOW TO POST thread
Xavi
CodeLite Enthusiast
Posts: 12
Joined: Mon Apr 19, 2010 4:52 pm
Genuine User: Yes
IDE Question: C++

Re: Passing command line arguments to dbg

Post by Xavi »

Anyways, what is the problem that you are trying to solve?
With GNU gdb (GDB) 7.1.50.20100702-cvs configured as "i686-w64-mingw32"
in the typical main( int argc, char ** argv ), argc is always 1.

I need to use the Startup Commands to take the arguments .-
set args <and paste Program Arguments:>
No, codelite uses its own source which are fork of the last maintained version of wxScintilla (1.62) - the sources are up to date to version 2.2 of scintilla + many changes I made into them.
Okay, please could you apply the patch attached to adapt scintilla > 2.12

--
Xavi
You do not have the required permissions to view the files attached to this post.
Xavi
CodeLite Enthusiast
Posts: 12
Joined: Mon Apr 19, 2010 4:52 pm
Genuine User: Yes
IDE Question: C++

Re: Passing command line arguments to dbg

Post by Xavi »

Some information about this .-

http://ftp.gnu.org/old-gnu/Manuals/gdb- ... tml#SEC231
http://sourceware.org/gdb/current/onlin ... -Execution

Maybe they need to do -exec-arguments args
Set the inferior program arguments, to be used in the next `-exec-run'.

-exec-run says nothing of arguments.

HTH,
Best regards
--
Xavi
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Passing command line arguments to dbg

Post by eranif »

Xavi wrote:Okay, please could you apply the patch attached to adapt scintilla > 2.12
Applied

Eran
Make sure you have read the HOW TO POST thread
Xavi
CodeLite Enthusiast
Posts: 12
Joined: Mon Apr 19, 2010 4:52 pm
Genuine User: Yes
IDE Question: C++

Re: Passing command line arguments to dbg

Post by Xavi »

Thanks,
The attached patch works fine.
I have not touched anything in the remote debugger, I guess that is used in the way .-

http://ftp.gnu.org/old-gnu/Manuals/gdb- ... tml#SEC135

and more arguments may be useful.

HTH,
Best regards
--
Xavi
You do not have the required permissions to view the files attached to this post.
Post Reply