From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3474 invoked by alias); 31 May 2013 18:54:29 -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 3464 invoked by uid 89); 31 May 2013 18:54:28 -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; Fri, 31 May 2013 18:54:28 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E0F5233E26A; Fri, 31 May 2013 18:54:26 +0000 (UTC) From: Mike Frysinger To: gdb@sourceware.org Subject: Re: Simulator question about argc/argv Date: Fri, 31 May 2013 18:54:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) Cc: "Steve Ellcey " References: <201305311453.05333.vapier@gentoo.org> In-Reply-To: <201305311453.05333.vapier@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4485410.2ipYrqvOI0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201305311454.30037.vapier@gentoo.org> X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00147.txt.bz2 --nextPart4485410.2ipYrqvOI0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 1838 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-elf) > > 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). 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: and the example of passing in additional args: $ bfin-elf-run ./a.out 99 2 $ bfin-elf-gdb -q -ex 'target sim' -ex load -ex 'run 99' -ex q bfin/a.out=20 Connected to the simulator. Loading section .init, size 0x12 lma 0x0 Loading section .text, size 0x89f8 lma 0x14 Loading section .fini, size 0xe lma 0x8a0c Loading section .rodata, size 0x618 lma 0x8a1c Loading section .eh_frame, size 0x4 lma 0x9034 Loading section .ctors, size 0x8 lma 0xa038 Loading section .dtors, size 0x8 lma 0xa040 Loading section .jcr, size 0x4 lma 0xa048 Loading section .data, size 0x8bc lma 0xa04c Start address 0x14 Transfer rate: 313376 bits in <1 sec. Starting program: /usr/local/src/gnu/gdb/sim/bfin/a.out 99 2 Program exited normally. -mike --nextPart4485410.2ipYrqvOI0 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) iQIcBAABAgAGBQJRqPHlAAoJEEFjO5/oN/WBaesQAKmsBIBvu9G+y2+i3s1tU27o cvutLHbn5cxrLVJBzPgRB57289qn6snCuJ39lqW9CZWYQJVk7jicpfhPtn+j2fNN DO5wRSTtHzcEd8FGfAqi43/Ukgx5SZC8BMJYf72J4kk6u2BDoa2mscYu2SGfsm3v yQFBUsWxVy07q0X6vkI8slKqZH+8zz90SPvsoOIc8ZRHCbUVImie5JVkZkltlHJX A63rii0j+fPZYeHONCfQSnT+iIHxLKVykTtaB926b2b6e5+7G1yWCarntJ7U6awq YFUFWzPiFsqQCWvJ0g5HuPcKTNYgTiS+BRHA58aItiUcntdEzxIhQ5DTdip/WbHe yamJ12GF+zYJspH0EsCAiovy9meUyqq8+0NmyVgJZLAujojMb8fho9MrtUK7CD2r k7x3L5tSmHxMwEallqxI2cQc+Cd+cwWTtcPc4b2C00RZMEkzO/CfqA0YdOSFjMpl txty+RHRiBX/phJHzwo56icxIDGLg2KSIvbDN1OMzAbiWdn2byzNfjTT0wgSQs4M S1XUSaBBuj1ipjYRnwrzygHAyVCu2eDrteZGCTh08V36SD3Om3+3SUC4VTh5EI4D E4XoGsys9YNEjm2ejuuN/5ojxKXCbjv9aG6vtmAg4ZGHlKy3uUbu46ovbdHG0zcn /NYOuKe4pyPOVqbFd82g =bsYs -----END PGP SIGNATURE----- --nextPart4485410.2ipYrqvOI0--