[1/1] gdb: Deprecate MPX commands.

Message ID 20240307121111.2010241-1-christina.schimpe@intel.com
State New
Headers
Series [1/1] gdb: Deprecate MPX commands. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Schimpe, Christina March 7, 2024, 12:11 p.m. UTC
  This patch deprecates the MPX commands "show/set mpx bound".
Intel listed Intel(R) Memory Protection Extensions (MPX) as removed
in 2019.  Following gcc v9.1, the linux kernel v5.6 and glibc v2.35,
deprecate MPX in GDB.
---
 gdb/NEWS            | 3 +++
 gdb/doc/gdb.texinfo | 3 +++
 gdb/i386-tdep.c     | 6 ++++--
 3 files changed, 10 insertions(+), 2 deletions(-)
  

Comments

Eli Zaretskii March 7, 2024, 12:34 p.m. UTC | #1
> From: "Schimpe, Christina" <christina.schimpe@intel.com>
> Date: Thu,  7 Mar 2024 12:11:11 +0000
> 
> This patch deprecates the MPX commands "show/set mpx bound".
> Intel listed Intel(R) Memory Protection Extensions (MPX) as removed
> in 2019.  Following gcc v9.1, the linux kernel v5.6 and glibc v2.35,
> deprecate MPX in GDB.
> ---
>  gdb/NEWS            | 3 +++
>  gdb/doc/gdb.texinfo | 3 +++
>  gdb/i386-tdep.c     | 6 ++++--
>  3 files changed, 10 insertions(+), 2 deletions(-)

Thanks.

> diff --git a/gdb/NEWS b/gdb/NEWS
> index 2638b3e0d9c..d8ac0bb06a7 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,9 @@
>  
>  *** Changes since GDB 14
>  
> +* The MPX commands "show/set mpx bound" have been deprecated, as Intel
> +  listed MPX as removed in 2019.

This part is okay.

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -26652,6 +26652,9 @@ whose bounds are to be changed, @var{lbound} and @var{ubound} are new values
>  for lower and upper bounds respectively.
>  @end table
>  
> +Both commands are deprecated and will be removed in future versions of
> +@value{GDBN}.  MPX itself was listed as removed by Intel in 2019.

"Will be removed" or "might be removed"?  IOW, are we certain we will
definitely remove this, or do we just want to warn users that we
might?

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
  
Schimpe, Christina March 7, 2024, 12:40 p.m. UTC | #2
Hi Eli, 

Thanks a lot for your quick reply.

> "Will be removed" or "might be removed"?  IOW, are we certain we will
> definitely remove this, or do we just want to warn users that we might?

Our goal would be to deprecate the MPX commands for gdb 15, if possible.
Please let me know if there is a problem with that or if there is something required to track this properly for gdb 15. I am not familiar with the procedure. I am adding Joel due to that to this conversation.

We would like to remove MPX for gdb 16.  So yes, we certainly will remove MPX. Hopefully for gdb 16 already.

BR + thanks a lot in advance,
Christina

> -----Original Message-----
> From: Eli Zaretskii <eliz@gnu.org>
> Sent: Thursday, March 7, 2024 1:35 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH 1/1] gdb: Deprecate MPX commands.
> 
> > From: "Schimpe, Christina" <christina.schimpe@intel.com>
> > Date: Thu,  7 Mar 2024 12:11:11 +0000
> >
> > This patch deprecates the MPX commands "show/set mpx bound".
> > Intel listed Intel(R) Memory Protection Extensions (MPX) as removed in
> > 2019.  Following gcc v9.1, the linux kernel v5.6 and glibc v2.35,
> > deprecate MPX in GDB.
> > ---
> >  gdb/NEWS            | 3 +++
> >  gdb/doc/gdb.texinfo | 3 +++
> >  gdb/i386-tdep.c     | 6 ++++--
> >  3 files changed, 10 insertions(+), 2 deletions(-)
> 
> Thanks.
> 
> > diff --git a/gdb/NEWS b/gdb/NEWS
> > index 2638b3e0d9c..d8ac0bb06a7 100644
> > --- a/gdb/NEWS
> > +++ b/gdb/NEWS
> > @@ -3,6 +3,9 @@
> >
> >  *** Changes since GDB 14
> >
> > +* The MPX commands "show/set mpx bound" have been deprecated, as
> > +Intel
> > +  listed MPX as removed in 2019.
> 
> This part is okay.
> 
> > --- a/gdb/doc/gdb.texinfo
> > +++ b/gdb/doc/gdb.texinfo
> > @@ -26652,6 +26652,9 @@ whose bounds are to be changed,
> @var{lbound}
> > and @var{ubound} are new values  for lower and upper bounds
> respectively.
> >  @end table
> >
> > +Both commands are deprecated and will be removed in future versions
> > +of @value{GDBN}.  MPX itself was listed as removed by Intel in 2019.
> 
> "Will be removed" or "might be removed"?  IOW, are we certain we will
> definitely remove this, or do we just want to warn users that we might?
> 
> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
  
Eli Zaretskii March 7, 2024, 1:10 p.m. UTC | #3
> From: "Schimpe, Christina" <christina.schimpe@intel.com>
> CC: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
> 	"brobecker@adacore.com" <brobecker@adacore.com>
> Date: Thu, 7 Mar 2024 12:40:08 +0000
> 
> > "Will be removed" or "might be removed"?  IOW, are we certain we will
> > definitely remove this, or do we just want to warn users that we might?
> 
> Our goal would be to deprecate the MPX commands for gdb 15, if possible.
> Please let me know if there is a problem with that or if there is something required to track this properly for gdb 15. I am not familiar with the procedure. I am adding Joel due to that to this conversation.
> 
> We would like to remove MPX for gdb 16.  So yes, we certainly will remove MPX. Hopefully for gdb 16 already.

That's fine by me.  I just know from experience that deprecated
features can stay in GDB for many years, sometimes indefinitely.  But
if we indeed intend to remove the command, the text you proposed for
the manual is okay.

Thanks.
  
Joel Brobecker March 7, 2024, 1:30 p.m. UTC | #4
Hello,

> > "Will be removed" or "might be removed"?  IOW, are we certain we will
> > definitely remove this, or do we just want to warn users that we might?
> 
> Our goal would be to deprecate the MPX commands for gdb 15, if
> possible.  Please let me know if there is a problem with that or if
> there is something required to track this properly for gdb 15. I am
> not familiar with the procedure. I am adding Joel due to that to this
> conversation.

This is more a question for the GDB maintainers than for the release
manager, but from memory, I believe the process you're going through,
where you first deprecate the feature and also announce it in the NEWS
for one release and then remove it for the next release, is the process
that we agreed to go through in the GDB project.
  
Tom Tromey March 8, 2024, 4:20 p.m. UTC | #5
>>>>> Schimpe, Christina <christina.schimpe@intel.com> writes:

> This patch deprecates the MPX commands "show/set mpx bound".
> Intel listed Intel(R) Memory Protection Extensions (MPX) as removed
> in 2019.  Following gcc v9.1, the linux kernel v5.6 and glibc v2.35,
> deprecate MPX in GDB.

Thank you.  The code parts are ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Schimpe, Christina March 12, 2024, 2:35 p.m. UTC | #6
Hi all,

Thank you for the review. I've pushed the patch now.

Christina

> -----Original Message-----
> From: Tom Tromey <tom@tromey.com>
> Sent: Friday, March 8, 2024 5:21 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH 1/1] gdb: Deprecate MPX commands.
> 
> >>>>> Schimpe, Christina <christina.schimpe@intel.com> writes:
> 
> > This patch deprecates the MPX commands "show/set mpx bound".
> > Intel listed Intel(R) Memory Protection Extensions (MPX) as removed in
> > 2019.  Following gcc v9.1, the linux kernel v5.6 and glibc v2.35,
> > deprecate MPX in GDB.
> 
> Thank you.  The code parts are ok.
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
  

Patch

diff --git a/gdb/NEWS b/gdb/NEWS
index 2638b3e0d9c..d8ac0bb06a7 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,9 @@ 
 
 *** Changes since GDB 14
 
+* The MPX commands "show/set mpx bound" have been deprecated, as Intel
+  listed MPX as removed in 2019.
+
 * Building GDB and GDBserver now requires a C++17 compiler.
   For example, GCC 9 or later.
 
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 34cd567f811..6099d125a60 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -26652,6 +26652,9 @@  whose bounds are to be changed, @var{lbound} and @var{ubound} are new values
 for lower and upper bounds respectively.
 @end table
 
+Both commands are deprecated and will be removed in future versions of
+@value{GDBN}.  MPX itself was listed as removed by Intel in 2019.
+
 When you call an inferior function on an Intel MPX enabled program,
 GDB sets the inferior's bound registers to the init (disabled) state
 before calling the function.  As a consequence, bounds checks for the
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index b487a3f7478..0d4e30b9a4e 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -9132,17 +9132,19 @@  is \"default\"."),
 
   /* Add "bound" command for the show mpx commands list.  */
 
-  add_cmd ("bound", no_class, i386_mpx_info_bounds,
+  cmd_list_element *c = add_cmd ("bound", no_class, i386_mpx_info_bounds,
 	   "Show the memory bounds for a given array/pointer storage\
  in the bound table.",
 	   &mpx_show_cmdlist);
+  deprecate_cmd (c, nullptr);
 
   /* Add "bound" command for the set mpx commands list.  */
 
-  add_cmd ("bound", no_class, i386_mpx_set_bounds,
+  c = add_cmd ("bound", no_class, i386_mpx_set_bounds,
 	   "Set the memory bounds for a given array/pointer storage\
  in the bound table.",
 	   &mpx_set_cmdlist);
+  deprecate_cmd (c, nullptr);
 
   gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SVR4,
 			  i386_svr4_init_abi);