This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V4 2/2] Add mpx-bnd-init-on-return set/show command for inferior calls.
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Walfred Tedeschi <walfred dot tedeschi at intel dot com>
- Cc: palves at redhat dot com, brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Thu, 03 Mar 2016 22:34:19 +0200
- Subject: Re: [PATCH V4 2/2] Add mpx-bnd-init-on-return set/show command for inferior calls.
- Authentication-results: sourceware.org; auth=none
- References: <1456935689-1820-1-git-send-email-walfred dot tedeschi at intel dot com> <1456935689-1820-3-git-send-email-walfred dot tedeschi at intel dot com> <83ziug6dnw dot fsf at gnu dot org> <56D81A29 dot 3040007 at intel dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Cc: palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org
> From: Walfred Tedeschi <walfred.tedeschi@intel.com>
> Date: Thu, 3 Mar 2016 12:04:09 +0100
>
> NEWS:
> show mpx-bnd-init-on-return
> set mpx-bnd-init-on-return on i386 and amd64
> In case MPX-BND-INIT-ON-RETURN is true, bound registers
> will be initialized when the "return" command is used.
>
>
> gdb.texinfo:
> While calling functions from the debugger, of an Intel MPX enabled program,
> boundary registers have to be set to the INIT state before performing the
> call, to avoid boundary violations while performing the call. A bound is
> defined to be in the INIT state when the pointer associated to that boundary
> can access the whole memory, in this case the register bound register
> associated to it has value 0, e.g. if the register associated is bnd0raw
> its value will be @{0x0, 0x0@}.
>
> When you use the @code{return} command, the bound registers might
> cause boundary violations because they were not updated for the
> early return from the function.
> To countermand that, @value{GDBN} can force initialization of the
> bound registers when it performs the @code{return} command. This is
> controlled by the following option:
>
> @table @code
> @kindex set mpx-bnd-init-on-return
> When set to true bound registers will be set to the INIT state when
> using the "return" command.
> @kindex show mpx-bnd-init-on-return
> Show the state of mpx-bnd-init-on-return.
> @end table
>
> and info for the new command:
> add_setshow_boolean_cmd ("mpx-bnd-init-on-return", no_class,
> &mpx_bnd_init_on_return, _("\
> Set the bnd registers to INIT state when returning from a call."), _("\
> Show whether to set the bnd registers to INIT state when returning
> from a call."),
>
>
> Would that be ok with you?
Yes, except that please change the documentation of "show
mpx-bnd-init-on-return" in the manual to say the same as in the doc
string of the add_setshow_boolean_cmd call.
Thanks.