Subject: bug#62858: 30.0.50; Typo in gdb-mi.el

From: Eli Zaretskii <[email-masked]>
Date: Sat, 15 Apr 2023 17:14:47 +0300

> Date: Sat, 15 Apr 2023 15:14:35 +0200
> From:  Manuel Giraud via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> I do not think that it generates a bug but while browsing "gdb-mi.el", I
> noticed the following at line 2409:
> --8<---------------cut here---------------start------------->8---
>     ("=" . (("thread-created" . (gdb-thread-created . atomic))
>             ("thread-selected" . (gdb-thread-selected . atomic))
>             ("thread-existed" . (gdb-ignored-notification . atomic))
> --8<---------------cut here---------------end--------------->8---
> 
> Should it not be "thread-exited"?  There is no reference to
> "thread-existed" in the GDB info.

You are right.  But I think the snafu here is even more than just a
typo.  This code was introduced in commit 6ff2c8f1f, where Stefan
(CC'ed) took a patch by Jean-Philippe Gravel and improved it.  But as
part of that change, Stefan made this typo, and also made
gdb-thread-exited a function that no one calls, which was not what
happened with the original code.

So I think we need to fix that with the patch below.

Stefan, any comments?

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 8db1672..27f04e0 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2406,7 +2406,7 @@ gdbmi-bnf-result-state-configs
     ("+" . ())
     ("=" . (("thread-created" . (gdb-thread-created . atomic))
             ("thread-selected" . (gdb-thread-selected . atomic))
-            ("thread-existed" . (gdb-ignored-notification . atomic))
+            ("thread-exited" . (gdb-thread-exited . atomic))
             ('default . (gdb-ignored-notification . atomic)))))
   "Alist of alists, mapping the type and class of message to a handler function.
 Handler functions are all flagged as either `progressive' or `atomic'.