GNU bug report logs - #66604
[PATCH] Gud LLDB completions

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Wed, 18 Oct 2023 11:27:02 UTC

Severity: normal

Tags: patch

Fixed in version 30.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #52 received at 66604 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 66604 <at> debbugs.gnu.org
Subject: Re: bug#66604: [PATCH] Gud LLDB completions
Date: Thu, 19 Oct 2023 14:29:26 +0200
19 okt. 2023 kl. 13.50 skrev Gerd Möllmann <gerd.moellmann <at> gmail.com>:
>>  script --language python -- print('Gud initialized')
>> 
>> is apparently sent twice. Perhaps something simpler can be sent, and
>> only once?
> 
> Hm, I'm sending it once

Sorry, you are perfectly right. The code is

  (gud-basic-call "script --language python -- print('Gud initialized')")
  (gud-basic-call "script --language python -- print('Gud initialized.')"))

so you are actually sending two slightly different commands.

>> 2. Sometimes there's an extra (second) space after the (lldb) prompt,
>> typically after stopping. No idea where that comes from.
> 
> Hm, I don't think I see that here.  Is it immediately after the stop, or
> does it come later?

Just after the stop. Transcript (with line numbers for reference):

01|(lldb) b exec_byte_code
02|Breakpoint 2: where = emacs`exec_byte_code + 20 at bytecode.c:476:33, address = 0x000000010b389b84
03|(lldb) c
04|Process 13507 resuming
05|(lldb) emacs was compiled with optimization - stepping may behave oddly; variables may not be available.
06|(lldb)  Process 13507 stopped
07|* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
08|    gud-info: (gud-lldb-stop :file ////Users/mattias/emacs/src/bytecode.c/// :line 476 :column 33)
09|Target 0: (emacs) stopped.
10|(lldb)  <cursor here>

In lines 5 and 6, an (lldb) prompt is printed although no input takes place there. No such prompts are seen when lldb runs in a terminal.
Line 6 also prefixes "Process" with an extra space which isn't present when running in a terminal either.

> It's a bit overkill ATM, but you must admit that it's elegant :-).

Overkill is the least of it. Just you wait until someone makes you debug some crafted source code that causes your Emacs to evaluate arbitrary Lisp expressions!

In general:
1. Don't use `eval` for parsing data.
2. Don't use `eval`.





This bug report was last modified 1 year and 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.