Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb@sources.redhat.com
Subject: Re: Question about args.exp test
Date: Wed, 21 Apr 2004 19:19:00 -0000	[thread overview]
Message-ID: <20040421184448.GB5956@nevyn.them.org> (raw)
In-Reply-To: <20040421164040.GS1307@cygbert.vinschen.de>

On Wed, Apr 21, 2004 at 06:40:40PM +0200, Corinna Vinschen wrote:
> Hi,
> 
> that's perhaps a dumb question but I don't understand what gdb.base/args.exp
> is testing in case of the 2nd and 3rd test.
> 
> Both tests are, according to the comment, testing to give empty arguments
> to the inferior.  The args application just prints argc and the whole
> argv vector unchanged to stdout.
> 
> Well, that's ok, but I don't understand this:
> 
> args.exp does not test the empty arguments being empty, but instead it
> tests if '', two apostrophes, are printed.  But that's not what the
> args application prints.  It just prints the empty string and a \n.
> 
> I'm just looking for arm and the arm simulator returns actually empty
> lines where the empty arguments are printed.  That looks correct to me,
> but the tests fail, due to the missing ''.
> 
> Why is args.exp expecting two apostrophes and who's supposed to add them?
> The args testapplication apparently isn't.

IIRC, the comments are wrong.  The tests can not be fixed for the ARM
simulator, though - I spent several days trying.  Trace the path that
argv takes through from the GDB prompt to the inferior main(), if you
want some gruesome entertainment:
  - it is word split by GDB before invoking the sim
  - it is reconstructed into a string by the sim/RDI interface
  - it is word split again in either newlib or libgloss, in handwritten
    assembly

The interface simply does not permit properly quoted arguments.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2004-04-21 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-21 18:33 Corinna Vinschen
2004-04-21 19:19 ` Daniel Jacobowitz [this message]
2004-04-22  8:07   ` Corinna Vinschen
2004-04-22 14:20     ` Daniel Jacobowitz
2004-04-22 14:27       ` Andrew Cagney
2004-04-22 14:30         ` Daniel Jacobowitz
2004-04-22 15:19           ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040421184448.GB5956@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox