Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Steve Ellcey " <sellcey@mips.com>
To: <gdb@gcc.gnu.org>
Subject: Simulator question about argc/argv
Date: Fri, 31 May 2013 16:48:00 -0000	[thread overview]
Message-ID: <e51642e8-9972-421d-be36-5bcaec133fe3@BAMAIL02.ba.imgtec.org> (raw)


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.

% cat x.c
#include <stdio.h>
int main(int argc, char **argv)
{
  printf("%d\n", argc);
  return 0;
}

% mips-mti-elf-gcc x.c -Tmti32.ld -o x
% mips-mti-elf-run ./x
0
% mips-mti-elf-run ./x 99
0

Steve Ellcey
sellcey@mips.com


             reply	other threads:[~2013-05-31 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 16:48 Steve Ellcey  [this message]
2013-05-31 16:50 ` Andrew Pinski
2013-05-31 18:53 ` Mike Frysinger
2013-05-31 18:54   ` Mike Frysinger
2013-05-31 23:55   ` Mike Frysinger
2013-06-01  2:25     ` Andrew Pinski
2013-06-01  6:21       ` Mike Frysinger
2013-06-03 11:20 ` nick clifton

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=e51642e8-9972-421d-be36-5bcaec133fe3@BAMAIL02.ba.imgtec.org \
    --to=sellcey@mips.com \
    --cc=gdb@gcc.gnu.org \
    /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