From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,eec8c4de47be074 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!aioe.org!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: gdb hijacks my argument list Date: Tue, 05 Jan 2010 16:19:22 -0500 Organization: The Wasteland Message-ID: References: <4b43251a$0$6270$4f793bc4@news.tdc.fi> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.1 Cancel-Lock: sha1:R3irc+OEzRtuOcaroYCJI8ti7qY= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news1.google.com comp.lang.ada:8621 Date: 2010-01-05T16:19:22-05:00 List-Id: In article , Leslie wrote: > John B. Matthews wrote: > > > In article , > > Leslie 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: (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