From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10402 invoked by alias); 21 Apr 2004 18:44:51 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10382 invoked from network); 21 Apr 2004 18:44:49 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 21 Apr 2004 18:44:49 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BGMiH-0002PR-37 for ; Wed, 21 Apr 2004 14:44:49 -0400 Date: Wed, 21 Apr 2004 19:19:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: Question about args.exp test Message-ID: <20040421184448.GB5956@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <20040421164040.GS1307@cygbert.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040421164040.GS1307@cygbert.vinschen.de> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00126.txt.bz2 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