Deprecate MI version 1

Message ID 20220921164737.3258130-1-tom@tromey.com
State Superseded
Headers
Series Deprecate MI version 1 |

Commit Message

Tom Tromey Sept. 21, 2022, 4:47 p.m. UTC
  MI version 1 is long since obsolete.  Rather than remove it
immediately (though I did send a patch for that), instead let's
deprecate it in GDB 13 and then remove it for GDB 14.
---
 gdb/NEWS | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Simon Marchi Sept. 21, 2022, 5:07 p.m. UTC | #1
On 2022-09-21 12:47, Tom Tromey wrote:
> MI version 1 is long since obsolete.  Rather than remove it
> immediately (though I did send a patch for that), instead let's
> deprecate it in GDB 13 and then remove it for GDB 14.
> ---
>  gdb/NEWS | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gdb/NEWS b/gdb/NEWS
> index 555ef2ddf77..e834e97dacc 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,8 @@
>  
>  *** Changes since GDB 12
>  
> +* MI version 1 is deprecated, and will be removed in GDB 14.
> +
>  * GDB now supports dumping memory tag data for AArch64 MTE.  It also supports
>    reading memory tag data for AArch64 MTE from core files generated by
>    the gcore command or the Linux kernel.


LGTM.  Do you think it would be worth printing a warning when
initializing an mi1 interp, something like this?  There might be some
people using / maintaing some frontend somewhere that are more likely to
see this than the NEWS file.


From f2d148e8787d1c4b4c1c4218646a87157f5fac82 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Wed, 21 Sep 2022 13:06:47 -0400
Subject: [PATCH] warn

Change-Id: Ia38707b24ce0d0ab519b189464ded828f5669c27
---
 gdb/interps.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/interps.c b/gdb/interps.c
index 3a9c590b8c87..c26bc0f0f6fd 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -171,11 +171,16 @@ interp_set (struct interp *interp, bool top_level)
   if (interpreter_p != interp->name ())
     interpreter_p = interp->name ();
 
+  bool warn_about_mi1 = false;
+
   /* Run the init proc.  */
   if (!interp->inited)
     {
       interp->init (top_level);
       interp->inited = true;
+
+      if (streq (interp->name (), "mi1"))
+	warn_about_mi1 = true;
     }
 
   /* Do this only after the interpreter is initialized.  */
@@ -185,6 +190,10 @@ interp_set (struct interp *interp, bool top_level)
   clear_interpreter_hooks ();
 
   interp->resume ();
+
+  if (warn_about_mi1)
+    warning (_("MI version 1 is deprecated and will be removed in a future "
+	       "version, please upgrade to a newer MI version."));
 }
 
 /* Look up the interpreter for NAME.  If no such interpreter exists,

base-commit: fbe8f9569eb56a007cace0be366dd137e2821e2a
  
Tom Tromey Sept. 21, 2022, 6:38 p.m. UTC | #2
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> LGTM.  Do you think it would be worth printing a warning when
Simon> initializing an mi1 interp, something like this?  There might be some
Simon> people using / maintaing some frontend somewhere that are more likely to
Simon> see this than the NEWS file.

It would be fine by me.

Tom
  
Simon Marchi Sept. 22, 2022, 4:11 p.m. UTC | #3
On 2022-09-21 14:38, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> LGTM.  Do you think it would be worth printing a warning when
> Simon> initializing an mi1 interp, something like this?  There might be some
> Simon> people using / maintaing some frontend somewhere that are more likely to
> Simon> see this than the NEWS file.
> 
> It would be fine by me.
> 
> Tom

Feel free to integrate it in your patch if you'd like.

Simon
  
Luis Machado Sept. 22, 2022, 5 p.m. UTC | #4
On 9/21/22 18:07, Simon Marchi via Gdb-patches wrote:
> 
> 
> On 2022-09-21 12:47, Tom Tromey wrote:
>> MI version 1 is long since obsolete.  Rather than remove it
>> immediately (though I did send a patch for that), instead let's
>> deprecate it in GDB 13 and then remove it for GDB 14.
>> ---
>>   gdb/NEWS | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/gdb/NEWS b/gdb/NEWS
>> index 555ef2ddf77..e834e97dacc 100644
>> --- a/gdb/NEWS
>> +++ b/gdb/NEWS
>> @@ -3,6 +3,8 @@
>>   
>>   *** Changes since GDB 12
>>   
>> +* MI version 1 is deprecated, and will be removed in GDB 14.
>> +
>>   * GDB now supports dumping memory tag data for AArch64 MTE.  It also supports
>>     reading memory tag data for AArch64 MTE from core files generated by
>>     the gcore command or the Linux kernel.
> 
> 
> LGTM.  Do you think it would be worth printing a warning when
> initializing an mi1 interp, something like this?  There might be some
> people using / maintaing some frontend somewhere that are more likely to
> see this than the NEWS file.
> 
> 
>>From f2d148e8787d1c4b4c1c4218646a87157f5fac82 Mon Sep 17 00:00:00 2001
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Date: Wed, 21 Sep 2022 13:06:47 -0400
> Subject: [PATCH] warn
> 
> Change-Id: Ia38707b24ce0d0ab519b189464ded828f5669c27
> ---
>   gdb/interps.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/gdb/interps.c b/gdb/interps.c
> index 3a9c590b8c87..c26bc0f0f6fd 100644
> --- a/gdb/interps.c
> +++ b/gdb/interps.c
> @@ -171,11 +171,16 @@ interp_set (struct interp *interp, bool top_level)
>     if (interpreter_p != interp->name ())
>       interpreter_p = interp->name ();
>   
> +  bool warn_about_mi1 = false;
> +
>     /* Run the init proc.  */
>     if (!interp->inited)
>       {
>         interp->init (top_level);
>         interp->inited = true;
> +
> +      if (streq (interp->name (), "mi1"))
> +	warn_about_mi1 = true;
>       }
>   
>     /* Do this only after the interpreter is initialized.  */
> @@ -185,6 +190,10 @@ interp_set (struct interp *interp, bool top_level)
>     clear_interpreter_hooks ();
>   
>     interp->resume ();
> +
> +  if (warn_about_mi1)
> +    warning (_("MI version 1 is deprecated and will be removed in a future "
> +	       "version, please upgrade to a newer MI version."));
>   }

We should probably be more explicit about deprecating it for GDB 13 and then removing
it in GDB 14. What do you think?
  
Simon Marchi Sept. 22, 2022, 6:04 p.m. UTC | #5
> We should probably be more explicit about deprecating it for GDB 13 and then removing
> it in GDB 14. What do you think?

Yeah, good idea.

Simon
  

Patch

diff --git a/gdb/NEWS b/gdb/NEWS
index 555ef2ddf77..e834e97dacc 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@ 
 
 *** Changes since GDB 12
 
+* MI version 1 is deprecated, and will be removed in GDB 14.
+
 * GDB now supports dumping memory tag data for AArch64 MTE.  It also supports
   reading memory tag data for AArch64 MTE from core files generated by
   the gcore command or the Linux kernel.