From: Luis Machado <lgustavo@codesourcery.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fixup gdb.python/py-value.exp for bare-metal aarch64-elf
Date: Fri, 07 Oct 2016 15:07:00 -0000 [thread overview]
Message-ID: <33a4a07e-7d59-bdb8-a87b-9f6aea6e76d2@codesourcery.com> (raw)
In-Reply-To: <CAH=s-POjpMXdk1JU0Vd5QC+fR_u1Mezvz3FwnOjkyWBOPUtYTQ@mail.gmail.com>
On 10/07/2016 09:48 AM, Yao Qi wrote:
> On Fri, Oct 7, 2016 at 1:08 PM, Luis Machado <lgustavo@codesourcery.com> wrote:
>>
>> I went back and read the standard and we're dealing with a freestanding
>> environment for bare metal here.
>>
>> The descriptions above seem to make sense for a hosted environment, but not
>> for a freestanding one, correct?
>>
>
> IMO, bare metal != freestadning environment. Since "main" function is used,
> it is a hosted environment. See
> https://gcc.gnu.org/onlinedocs/gcc/Standards.html
I'm slightly confused. Are you implying that using main makes this a
hosted environment even though there is no underlying OS facility at play?
The documentation states freestanding environments can use any type of
startup routine they want, only having to honor a small subset of clauses.
This seems to imply that the use of "main" is allowed and the lack of
underlying OS facilities make it freestanding.
Skipping the discussion of whether we have a hosted x freestanding
environment, the testcase itself uses main/argc/argv. Does that mean it
is supposed to be exercised only on hosted environments or only on
targets providing sane argc/argv values?
>
> "a hosted environment, which is not required, in which all the library
> facilities are provided and startup is through a function int main
> (void) or int main (int, char *[])."
>
> On the other hand, in the C standard, function "main" is only mentioned in
> the section of "5.1.2.2 Hosted environment".
>
They are mentioned there because it is a requirement for a hosted
environment but, as mentioned above, freestanding programs could have a
function called main as the startup function. There is no restriction on
that part, correct?
More importantly, does it really matter, from a gdb testsuite point of
view, whether the freestanding implementation provides main/argc/argv or
not? The tests get exercised anyway, with only a small adjustment being
required to make it not crash due to an assumption that is not always
true (presence of argc/argv).
next prev parent reply other threads:[~2016-10-07 15:07 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 [this message]
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
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=33a4a07e-7d59-bdb8-a87b-9f6aea6e76d2@codesourcery.com \
--to=lgustavo@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.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