From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCHv4 2/2] gdb: Initial baremetal riscv support
Date: Mon, 05 Mar 2018 22:35:00 -0000 [thread overview]
Message-ID: <0ed7c3b8244b601b2f80f75316620192@simark.ca> (raw)
In-Reply-To: <20180305104543.GA2612@embecosm.com>
On 2018-03-05 05:45, Andrew Burgess wrote:
> Simon,
>
> Thanks for the continued feedback. The only changes in this revision
> are in the new test. I believe I've addressed all of the points you
> made:
>
> - Test file renamed.
> - General cleanup, redundant code removed.
> - Use of clean_restart where appropriate.
> - Use of 'fail' after 'runto_main'.
> - Use of get_valueof where appropriate.
> - Use of gdb_assert where appropriate.
> - The integer only set is also included now.
>
> One interesting change that cropped up with this change is that I now
> run the tests _after_ having the inferior program call a function that
> uses the FPU. The reason is that on one machine I was seeing test
> failures in some cases.
>
> The reason I believe is due to lazy enabling of the FPU on x86-64
> targets. I think that what happens is this:
>
> 1. Program starts, FPU is disabled. Contents of $fctrl and $fstat
> registers is random garbage.
> 2. User makes an inferior call from GDB, GDB stores complete
> register state.
> 3. Inferior function uses the FPU, the kernel enables the FPU and
> places some sane defaults into the $fctrl and $fstat registers.
> 4. Inferior function completes and control returns to GDB, GDB
> restores the contents of the $fctrl and $fstat registers
> (original random garbage) however, the FPU is now enabled.
> 5. Use calls another inferior function from GDB, the FPU is now
> already enabled but has random garbage in its control registers,
> this sometimes results in a SIGFPU exception.
>
> I then noticed that the gdb.base/structs.exp test also fails for me on
> the "problem" machine.
>
> What I don't know is why this issue is limited to one particular
> machine, I'm guessing its something special about the OS/GCC/libraries
> but I've not tracked it down yet.
>
> Still, I thought it was interesting enough to mention, but I don't
> think it needs to block this patch from moving forward.
Ok, I don't know more about the FPU than you do, and your explanation
seems reasonable.
The patch LGTM.
Thanks!
Simon
next prev parent reply other threads:[~2018-03-05 22:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 19:15 [PATCH] " Andrew Burgess
2018-02-13 19:49 ` Eli Zaretskii
2018-02-19 20:01 ` Simon Marchi
2018-02-27 1:09 ` [PATCHv2] " Andrew Burgess
2018-02-27 3:33 ` Simon Marchi
2018-03-02 20:09 ` [PATCHv3 0/2] Initial RiscV Support Andrew Burgess
2018-03-02 20:10 ` [PATCHv3 2/2] gdb: Initial baremetal riscv support Andrew Burgess
2018-03-03 6:27 ` Simon Marchi
2018-03-05 10:46 ` [PATCHv4 " Andrew Burgess
2018-03-05 22:35 ` Simon Marchi [this message]
2018-03-06 11:06 ` Yao Qi
2018-03-06 11:35 ` Yao Qi
2018-03-03 7:40 ` [PATCHv3 " Eli Zaretskii
2018-03-02 20:10 ` [PATCHv3 1/2] gdb/amd64: Ignore zero sized fields when calling functions Andrew Burgess
2018-03-03 6:29 ` Simon Marchi
2018-02-27 3:37 ` [PATCHv2] gdb: Initial baremetal riscv support Simon Marchi
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=0ed7c3b8244b601b2f80f75316620192@simark.ca \
--to=simark@simark.ca \
--cc=andrew.burgess@embecosm.com \
--cc=eliz@gnu.org \
--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