This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Fixup gdb.python/py-value.exp for bare-metal aarch64-elf
- From: Luis Machado <lgustavo at codesourcery dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 7 Oct 2016 10:07:14 -0500
- Subject: Re: [PATCH] Fixup gdb.python/py-value.exp for bare-metal aarch64-elf
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <CAH=s-PPVmjR0h5bNKeUT8PuJTLEQJh4AhK206-+=nto4mL3sew@mail.gmail.com> <email@example.com> <CAH=s-POjpMXdk1JU0Vd5QC+fR_u1Mezvz3FwnOjkyWBOPUtYTQ@mail.gmail.com>
- Reply-to: Luis Machado <lgustavo at codesourcery dot com>
On 10/07/2016 09:48 AM, Yao Qi wrote:
On Fri, Oct 7, 2016 at 1:08 PM, Luis Machado <firstname.lastname@example.org> 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
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 "22.214.171.124 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).