[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70573: 30.0.50; Setting gud-gud-lldb-command-name does not take effe
From: |
Eli Zaretskii |
Subject: |
bug#70573: 30.0.50; Setting gud-gud-lldb-command-name does not take effect |
Date: |
Fri, 26 Apr 2024 09:29:21 +0300 |
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 70573@debbugs.gnu.org
> Date: Thu, 25 Apr 2024 21:25:48 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > It looks like this part:
> >
> > (interactive (list (gud-query-cmdline 'lldb)))
> >
> > is the culprit: the minor-mode, which is the argument to
> > gud-query-cmdline, should be 'gud-lldb, not 'lldb. Here's my
> > evidence:
> >
> > (when (and gud-comint-buffer
> > (buffer-name gud-comint-buffer)
> > (get-buffer-process gud-comint-buffer)
> > (with-current-buffer gud-comint-buffer (eq gud-minor-mode
> > 'gud-lldb)))
> >
> > Btw, this line seems also to be confused wrt the name of
> > gud-minor-mode:
> >
> > (setq-local gud-minor-mode 'lldb)
>
> I'm currently seriously confused by gud.el, I'm afraid. And I was
> already confused when I tried to mimic gud-gdb here, which does
>
> (interactive (list (gud-query-cmdline 'gud-gdb)))
>
> (when (and gud-comint-buffer
> (buffer-name gud-comint-buffer)
> (get-buffer-process gud-comint-buffer)
> (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)))
> (gdb-restore-windows)
> (error
> "Multiple debugging requires restarting in text command mode"))
>
> (gud-common-init command-line nil 'gud-gdb-marker-filter)
> (setq-local gud-minor-mode 'gdb)
I don't think the complications of GDB should concern you. AFAIU, the
above tries to handle the tricky situation where we have 2 GDB minor
modes: gdbmi and gud-gdb. There's no such problem with LLDB, AFAIU.
So I think you should copy-cat the other minor modes, like gud-pdb,
which don't have these complications.
> Would you agree that the interactive form should use gud-lldb, but that
> the setq-local is right? The setq-local is gud-gdb uses gdb, not
> gud-gdb. Or am I confusing myself here?
I think both should use gud-lldb, at least that's my understanding.
Look at gud-query-cmdline, gud-val, and gud-symbol, and you will see
that they encode the command name as gud-MINORMODE-SYMBOL, where
SYMBOL is "command-name" in this case. So if the command name's
symbol is gud-gud-lldb-command-name, then MINORMODE must be gud-lldb,
for this stuff to work.