From: Kevin Buettner <kevin@buettner.to>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fixup gdb.python/py-value.exp for bare-metal aarch64-elf
Date: Fri, 07 Oct 2016 18:21:00 -0000 [thread overview]
Message-ID: <20161007112053.70106e51@pinnacle.lan> (raw)
In-Reply-To: <1475771231-1739-1-git-send-email-lgustavo@codesourcery.com>
On Thu, 6 Oct 2016 11:27:11 -0500
Luis Machado <lgustavo@codesourcery.com> wrote:
> I noticed that testing aarch64-elf gdb with a physical board
> ran into issues with gdb.python/py-value.exp. Further investigation showed
> that we were actually trying to dereference a NULL pointer (argv) when trying
> to access argv[0].
>
> Being bare-metal, argv is not guaranteed to be there. So we need to make sure
> argv is sane before accessing argv[0].
>
> After fixing that, i noticed we were assuming a value of 1 for argc, which is
> also not true, as i see 0 in my tests.
>
> The following patch fixes up the test program to check for a NULL argv and also
> touches the testcase itself to expect either 0 or 1 for argc depending on the
> presence of argv, which is something we check early in the test.
>
> This gives me full passes for aarch64-elf when running gdb.python/py-value.exp
> and doesn't regress things on x86-64.
>
> Ok?
FWIW, I've run into some of these same problems while testing against
some of the simulators. In such an environment, I think it makes
sense to pass in NULL for argv.
I'd like to see your patch (or something like it) go in. I think it's easier to
adjust the tests than it is to adjust the startup code in a bunch of different
places.
Kevin
prev parent reply other threads:[~2016-10-07 18:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 16:27 Luis Machado
2016-10-07 10:23 ` Yao Qi
2016-10-07 11:42 ` Luis Machado
2016-10-07 12:09 ` Luis Machado
2016-10-07 14:48 ` Yao Qi
2016-10-07 15:07 ` Luis Machado
2016-10-07 16:52 ` Yao Qi
2016-10-07 17:00 ` Luis Machado
2016-10-10 17:04 ` Luis Machado
2016-10-11 8:18 ` Yao Qi
2016-10-07 18:21 ` Kevin Buettner [this message]
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=20161007112053.70106e51@pinnacle.lan \
--to=kevin@buettner.to \
--cc=gdb-patches@sourceware.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