This is the mail archive of the
mailing list for the GDB project.
Fwd: FW: [PATCH V5 1/2] Initialize bnd register before performing inferior calls.
- From: Walfred Tedeschi <walfred dot tedeschi at intel dot com>
- To: qiyaoltc at gmail dot com
- Cc: palves at redhat dot com, gdb-patches <gdb-patches at sourceware dot org>, brobecker at adacore dot com
- Date: Tue, 26 Apr 2016 16:35:52 +0200
- Subject: Fwd: FW: [PATCH V5 1/2] Initialize bnd register before performing inferior calls.
- Authentication-results: sourceware.org; auth=none
- References: <AC542571535E904D8E8ADAE745D60B19445B77C8 at IRSMSX104 dot ger dot corp dot intel dot com>
Walfred Tedeschi <email@example.com> writes:
BND registers should be initialized before performing an inferior call
to avoid undesired bound violations.
What are the undesired bound violations? Do have an example?
Resetting BND registers in the inferior call isn't right to me, the BND
setting isn't in effect in the inferior call. If the function can
trigger bound violations, it is expected that it still can trigger
violations in the inferior call.
Thanks a lot for your quick review! :)
That is true, but not unattended. In case BND registers are not set to
init state the current context value will be used for the inferior call.
Causing with a higher chance a BND violation.
The question is was that intended by the user? Likely not.
Also it will invalidate the inferior call usage. The inferior call will
finish before returning the result back to the user.
In any case the user can still set the values and examine a bound
violation and the its causes by setting the BND registers by stopping at
the prologue of the function being called.
Have i answered your question?
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928