From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23212 invoked by alias); 1 Jun 2013 06:21:07 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 23153 invoked by uid 89); 1 Jun 2013 06:21:00 -0000 X-Spam-SWARE-Status: No, score=-9.5 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_PASS,TW_QE autolearn=ham version=3.3.1 Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 01 Jun 2013 06:20:59 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id A6CDE33E26F; Sat, 1 Jun 2013 06:20:57 +0000 (UTC) From: Mike Frysinger To: Andrew Pinski Subject: Re: Simulator question about argc/argv Date: Sat, 01 Jun 2013 06:21:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) Cc: gdb@sourceware.org, Steve Ellcey References: <201305311955.29482.vapier@gentoo.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2844779.jUvy9BE64A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201306010221.04262.vapier@gentoo.org> X-Virus-Found: No X-SW-Source: 2013-06/txt/msg00001.txt.bz2 --nextPart2844779.jUvy9BE64A Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 2677 On Friday 31 May 2013 22:25:24 Andrew Pinski wrote: > On Fri, May 31, 2013 at 4:55 PM, Mike Frysinger wrote: > > On Friday 31 May 2013 14:53:04 Mike Frysinger wrote: > >> On Friday 31 May 2013 12:47:54 Steve Ellcey wrote: > >> > Some new tests have been added to the GCC testsuite (cilk tests) that > >> > check the value of argc and they expect it to be 1 if there are no > >> > arguments to the test program (and there are none) but I am getting 0 > >> > when I run the tests under the gnu simulator. Does anyone know why > >> > this is? I don't know if this is specific to my target (mips-mti-el= f) > >> > or a general simulator problem. Perhaps it is related to my linker > >> > script? The mips-mti-elf target is built with newlib. Could someone > >> > else who uses the gnu simulator and newlib try this. It works fine > >> > for me under the qemu simulator. > >>=20 > >> unfortunately, the argc/argv handling tends to be target specific and > >> spread across newlib, libgloss, and the sim (target specific pieces).= =20 > >> you might even see different behavior if the env is gdb rather than the > >> run frontend :). > >>=20 > >> i'd have to dig into the specific mips lower startup code to see how it > >> transfers things, but this does work for Blackfin targets: > >=20 > > ok, there's a bit of history here :). you can start here: > > http://sourceware.org/ml/newlib/2012/msg00134.html > > ... > > however, considering Jie's findings in the referenced thread, and no one > > has spoken up since, and it seems everyone's sim (except for Blackfin & > > SuperH) have been broken, then i guess it's time to call it. let's > > recommend people implement SYS_arg{c, n, nlen}, and document the > > process. hell, i really need to bite my tongue and write *any* sim > > documentation as i don't believe anyone has ever written any :(. >=20 > This won't help non-gdb based simulators where the problem also exist. > I test gdb and gcc using a non-gdb based simulator all the time. The > environment is designed for a bare metal environment where there is no > argv or argc (well the bootloader does pass arguments down to the > program but it is hard to do using the simulator except using a > separate file and it never passes the application name either even via > the bootloader). perhaps, but it doesn't preclude fixing the GNU sim (not to be pedantic, bu= t=20 `run` isn't gdb based, it's entirely standalone). this is a long standing= =20 issue and it isn't unreasonable for people to expect this to work. > I think it is better to just fix the GCC testsuite rather than fixing > the simulators. or make it XFAIL when the sim is known to suck. -mike --nextPart2844779.jUvy9BE64A Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJRqZLQAAoJEEFjO5/oN/WBG4sQANlxloTR+qcxuQX07pf6HL1B iT+4aBCvvb0MUpASVoKOdeDHr048NmJ3JHL/Ezj9wA4Ykw5NTa5J1CRLSUoz2E7y xomDnf2GcGolTe0h3107LArNMKb1nfW7OXaIFbDhOjChqbT/wyORdb+VzMgG+x9i cpkaTmKiZPBrUWGGlzkuG42GIqIOKnXBxk+pBqnVS+sxGTCzROjWl7TwKzhUFqCM q59E4s2y6Iiy2zBS3LrGDqxX2tNom7kIgNHtMCGwIbmwMY6ZcCWjqK7Evr0QaG4R VSwLOFHr00Tce6OZhFInzaUhRiTV7X+sKVukvWSNdIY/H7noifYMA1SO9B1if1ms 2KOa/yG7I9gXldc6cc2CtUyaBYGUmYTuaL4XBqshqyAcTaLLduxrvNncLQHrBTHq cNQoAovc50g2XXzNIgv5p9PillEqG+ThKXncwkbTUcPLEIc20LNxydPgKMiYnSjJ SFJ+5kRf5Nghafu54Akvvuu+cJsxrd68vjBLnNC5B4cS7fabg+RFWa9oDWT90L4A R2z2cLCy1Z/7SeyWjagbmeVyNdpS7p3cUBSwdc+EvA88OKN/PQjlcjvQ9vqal3TR XSsfgbxa3QGIjajyo7PheNPi9xk8Du8lmmQu22h5/VwWcNC7oqK1TeJIRDsKEWs5 UNoFaIuzxRbjryEZYyNC =y2xR -----END PGP SIGNATURE----- --nextPart2844779.jUvy9BE64A--