This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Set argc and argv in insight


Gene Smith wrote:

Clarification: This is Insight's console, not an OS console.

Correct. The "Console Window" as it is called in the Window menu.


I think you can also enter "run arg1 arg2 .." to set the arguments (arguments are space separated). Enter just "set args" with no arguments to clear the argument list for subsequent runs. Put "set args ..." in gdbinit to have the args always set and used.

All those options are valid ways to do it. I checked in patches to better sync arguments between gdb and Insight, but if you specify "set args" in your .gdbinit, it will probably be overridden by whatever may be stored in Insight's session preferences. I did not test that case, just the case of "set args" and the target preferences dialog.


2) File->Target Settings... there is a place to enter arguments
Would that be the place that says "Command to issue after attaching:"? That doesn't sound like arguments.

Nope. If you are using an "Exec" target, i.e., debugging natively (target==host), then the one entry box is relabeled "Arguments". The "after attaching" thing is for something else entirely; it allows you to run any command after attaching to the target but before loading/running it. This was used by various embedded platforms to do necessary board initialization, particularly w.r.t. memory configuration on a certain JTAG emulator that I worked on long ago. It is not really intended for natives, but I guess it would work.


If you are using a cross debugger (host != target), then you must use the "set args" method. The target preferences dialog will not allow you to enter arguments (because this is typically impossible to do with embedded systems).

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]