public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Set argc and argv in insight
@ 2009-04-23 12:45 arkkimede
  2009-04-23 16:16 ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: arkkimede @ 2009-04-23 12:45 UTC (permalink / raw)
  To: insight

How I can pass the parameters argc and argv to a program running in
the insight debugger?
TIA
Daniele

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set argc and argv in insight
  2009-04-23 12:45 Set argc and argv in insight arkkimede
@ 2009-04-23 16:16 ` Keith Seitz
       [not found]   ` <b4503c170904231028n81901b4sdb175596c9e852de@mail.gmail.com>
  2009-04-29 21:58   ` Gene Smith
  0 siblings, 2 replies; 5+ messages in thread
From: Keith Seitz @ 2009-04-23 16:16 UTC (permalink / raw)
  To: arkkimede; +Cc: insight

arkkimede wrote:
> How I can pass the parameters argc and argv to a program running in
> the insight debugger?

Two options:

1) Open a console window and enter the normal gdb command ("set args ...")
2) File->Target Settings... there is a place to enter arguments

If you usually use the console window to run your executable (like I 
do), use #1. If you're a button pusher, use #2. There was always a 
disconnect between these two methods.

I'll put this annoyance on my list of things to do before the next release.

Keith

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set argc and argv in insight
       [not found]   ` <b4503c170904231028n81901b4sdb175596c9e852de@mail.gmail.com>
@ 2009-04-23 18:45     ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2009-04-23 18:45 UTC (permalink / raw)
  To: Carfield Yim; +Cc: arkkimede, insight

Carfield Yim wrote:
  > BTW, may be next release move "exec" as default?

"Exec" should be the default for native targets. It appears that this 
got broken, so I will also fix that before the final release.

Keith

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set argc and argv in insight
  2009-04-23 16:16 ` Keith Seitz
       [not found]   ` <b4503c170904231028n81901b4sdb175596c9e852de@mail.gmail.com>
@ 2009-04-29 21:58   ` Gene Smith
  2009-04-29 22:08     ` Keith Seitz
  1 sibling, 1 reply; 5+ messages in thread
From: Gene Smith @ 2009-04-29 21:58 UTC (permalink / raw)
  To: insight

Keith Seitz wrote:
> arkkimede wrote:
>> How I can pass the parameters argc and argv to a program running in
>> the insight debugger?
> 
> Two options:
> 
> 1) Open a console window and enter the normal gdb command ("set args ...")
Clarification: This is Insight's console, not an OS console.
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.


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

I don't usually pass arguments since I mainly use insight and gdb for 
embedded work. But occasionally I do and always forget how.

> 
> If you usually use the console window to run your executable (like I 
> do), use #1. If you're a button pusher, use #2. There was always a 
> disconnect between these two methods.
> 
> I'll put this annoyance on my list of things to do before the next release.
> 
> Keith
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set argc and argv in insight
  2009-04-29 21:58   ` Gene Smith
@ 2009-04-29 22:08     ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2009-04-29 22:08 UTC (permalink / raw)
  To: Gene Smith; +Cc: 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-29 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 12:45 Set argc and argv in insight arkkimede
2009-04-23 16:16 ` Keith Seitz
     [not found]   ` <b4503c170904231028n81901b4sdb175596c9e852de@mail.gmail.com>
2009-04-23 18:45     ` Keith Seitz
2009-04-29 21:58   ` Gene Smith
2009-04-29 22:08     ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).