This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH V2] ABI changes for MPX.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: "Tedeschi, Walfred" <walfred dot tedeschi at intel dot com>, gdb-patches at sourceware dot org
- Date: Fri, 18 Dec 2015 21:24:52 +0400
- Subject: Re: [PATCH V2] ABI changes for MPX.
- Authentication-results: sourceware.org; auth=none
- References: <1450358624-11596-1-git-send-email-walfred dot tedeschi at intel dot com> <83bn9pyqv8 dot fsf at gnu dot org> <AC542571535E904D8E8ADAE745D60B1944507386 at IRSMSX104 dot ger dot corp dot intel dot com> <83poy3x03a dot fsf at gnu dot org>
> Thanks, I understand now. So why would a GDB user want to set
> mpx-bnd-init-on-return to zero? The result will always be a bound
> violation, no?
If I understand correctly, which is a fairly big if, it will
depend on how far in the function's execution you've gone through.
If you return early enough that the bound registers are still
uninitialized, then you want to initialize them to make sure that
there will be no bound violation due to the premature return.
On the other hand, there might be some situations where you know
the bound registers have been set, and you want to preserve their
value, rather than blindly setting it to zero. For instance, what
if there was, in fact, a bound violation. Setting it to zero would
change the program's behavior by canceling the reporting of that
PS: FWIW, I dislike the term "initialize", here, because it always
begs the question: "initialize to what?". If this is the
terminology used in the reference documentation and is known
to the community working on those chips, then I guess we have
to go with the flow. But otherwise, I personally would advocate
for another term, such as "reset" or "set to zero".
Just my 2 cents.