comp.lang.ada
 help / color / mirror / Atom feed
From: "John B. Matthews" <nospam@nospam.invalid>
Subject: Re: gdb hijacks my argument list
Date: Tue, 05 Jan 2010 16:19:22 -0500
Date: 2010-01-05T16:19:22-05:00	[thread overview]
Message-ID: <nospam-DD3E3E.16192105012010@news.aioe.org> (raw)
In-Reply-To: hi03m6$fsl$1@news.albasani.net

In article <hi03m6$fsl$1@news.albasani.net>,
 Leslie <jlturriff@centurytel.net> wrote:

> John B. Matthews wrote:
> 
> > In article <hhvlc7$nc8$1@news.albasani.net>,
> >  Leslie <jlturriff@centurytel.net> wrote:
> > 
> >> Niklas Holsti wrote:
> >> 
> >> > gdb --args testtoken ' (name testtoken endchar \) <
> >> > > testtoken.adb | (trace) count lines|cons '
> >> 
> >> I get exactly the same result as before:
> > 
> > This older version of gdb lacks the --args feature,

Looking again, my gdb has an --args option; it just doesn't work. :-)

> > but `set args` and `show args` seem to work. Some of the tokens in 
> > your arg string appear to be shell operators and commands. You may 
> > have to evaluate the string in a shell and feed the result to args.
>
> The single quotes should deactivate the "specialness" of those
> operators.  In any case, the entire string is being rejected,
> not just parts of it, and no substitutions are made by shell.

You're right about the quotes, but I was mistaken about shell expansion. 
It seems gdb uses the environments $SHELL (or /bin/sh) to expand args:

<http://sourceware.org/gdb/current/onlinedocs/gdb/Arguments.html>

(gdb) set args $((7 * 6))
(gdb) r
Starting program: argtest $((7 * 6))
42

> However, I must say 'thank you very much,' because 'set args'
> does the trick.
> 
> Thank you very much.

Excellent!

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>



  reply	other threads:[~2010-01-05 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05  1:06 gdb hijacks my argument list Leslie
2010-01-05 11:39 ` Niklas Holsti
2010-01-05 15:21   ` Leslie
2010-01-05 16:15     ` John B. Matthews
2010-01-05 19:25       ` Leslie
2010-01-05 21:19         ` John B. Matthews [this message]
2010-01-05 17:34     ` Niklas Holsti
2010-01-05 19:18       ` Leslie
2010-01-05 19:36         ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox