Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb@sourceware.org
Cc: "Steve Ellcey " <sellcey@mips.com>
Subject: Re: Simulator question about argc/argv
Date: Fri, 31 May 2013 18:54:00 -0000	[thread overview]
Message-ID: <201305311454.30037.vapier@gentoo.org> (raw)
In-Reply-To: <201305311453.05333.vapier@gentoo.org>

[-- Attachment #1: Type: Text/Plain, Size: 1873 bytes --]

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.
> 
> 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 :).
> 
> 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 
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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-05-31 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 16:48 Steve Ellcey 
2013-05-31 16:50 ` Andrew Pinski
2013-05-31 18:53 ` Mike Frysinger
2013-05-31 18:54   ` Mike Frysinger [this message]
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=201305311454.30037.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb@sourceware.org \
    --cc=sellcey@mips.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