bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66575: [PATCH] Gud lldb support


From: Gerd Möllmann
Subject: bug#66575: [PATCH] Gud lldb support
Date: Tue, 17 Oct 2023 12:03:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> 16 okt. 2023 kl. 16.09 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
>
>>> So what is the currently blessed way to communicate with LLDB?
>> 
>> Don't really know, I'm afraid.
>
> Maybe it's worth a try anyway, since lldb-mi still seems maintained as a 
> separate tool.
> (But don't let it hold up your contribution -- it's useful on its
> own.)

Maybe it would be worth it, don't know, but lldb-mi isn't even
installable via Homebrew at the moment...

>>> If thñe file name can have an absolute directory part, then it may run
>>> into trouble on Windows (C:\Some\Dir\File.c).
>> 
>> I guess I'll leave that as an exercise for someone having Windows :-).
>
> I don't, but we could try to be nice anyway. What about replacing
>
>   (group (1+ (not ":")))
>
> with something like
>
>   (group (opt (opt "\\\\?\\")         ; Windows fun
>               (in "a-zA-Z") ":")      ; floppy letter
>          (1+ (not ":")))
>
> and ignore NTFS Alternate Data Streams, as we ignore the possibility
> of colons in file names on other systems?

Hm.  I'd rather see someone run lldb on Windows, and tell us if it even
prints absolute file names.  It doesn't seem to do that on macOS.

> Onto your most recent patch -- looks fine in general, only a few notes:
>
>>  * Editing Changes in Emacs 30.1
>>  
>> ++++
>> +** New command 'lldb'.
>
> The text can be rearranged later on but this entry probably belongs under 
> 'Changes in Specialized Modes and Packages'.
>
>> +Run the LLDB debugger, analogous to the 'gud-gdb' command.  Note that
>> +might want to add these settings to your .lldbinit file, to reduce the
>
> Missing 'you' in the second sentence?
>
>> +output in the LLDB output when stepping through source files.
>> +
>> +settings set stop-line-count-before 0
>> +settings set stop-line-count-after 0
>
> Indent these lines by 4 spaces (NEWS has its own formatting rules).

Fixed, and moved.  Thanks.

> But shouldn't your new code issue these commands to lldb automatically? The 
> user might not always run lldb under Emacs.
>

I've thought about doing that as an initialization, but then it would
have to be manually undone once lldb is running, since .lldbinit is
loaded first, AFAIK, if enabled (default = no), which one could
suppress and load it later, but that might also not be what the user
wants. And so on...

So, to keep things simple, I'd rather leave the user's settings alone.
It doesn't make a difference, functionally.

>> +  ;; First line is the print command itself.
>> +  (unless (string-match (regexp-quote (gud-tooltip-print-command ""))
>
> Isn't this just (string-search ...) ? Or did you want a more precise
> match, in which case it probably should be anchored in some way and
> not just a substring search?

That's true.  I was too lazy to change that after experimenting with
this stuff :-).  I've changed that.

>> +# This is for M-x lldb: don't show source lines when stopping.
>> +settings set stop-line-count-before 0
>> +settings set stop-line-count-after 0
>
> As mentioned above, I'd hope we could do without this.

New version attached.  I guess I'll commit that soon :-).

Attachment: 0001-Gud-lldb-support-bug-66575.patch
Description: Final final patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]