unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: 66604@debbugs.gnu.org
Subject: bug#66604: [PATCH] Gud LLDB completions
Date: Fri, 20 Oct 2023 19:28:39 +0200	[thread overview]
Message-ID: <m2h6mlyzi0.fsf@Pro.fritz.box> (raw)
In-Reply-To: <m2bkctsdwv.fsf@Pro.fritz.box> ("Gerd Möllmann"'s message of "Fri, 20 Oct 2023 13:59:12 +0200")

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Mattias Engdegård <mattias.engdegard@gmail.com> writes:
>
>> 20 okt. 2023 kl. 13.12 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
>>
>>> That's interesting, the -p PID seems to make the difference.  Could you
>>> please confirm?  No idea what to make of that, ATM.
>>
>> I get the same odd behaviour by starting lldb without arguments and then issuing
>>
>>   attach ‹pid›
>>   b redisplay_internal
>>   c
>>
>> but not when starting Emacs from inside lldb as per your recipe, so it's a matter of attaching vs spawning.
>
> Indeed. How strange.

Strangeness A:

I do

  M-x lldb RET emacs RET

with a

  (trace-function 'gud-lldb-marker-filter)
  
to observe what the process filter sees.  I'm doing some stuff in lldb,
then kill the process, and attach to another running Emacs to see the
difference in what arrives in Emacs between the case of not attching to
a process and attaching to one.

Here is part of the trace output:

======================================================================
1 -> (gud-lldb-marker-filter "settings show use-color \n")
1 <- gud-lldb-marker-filter: "settings show use-color \n"
======================================================================
1 -> (gud-lldb-marker-filter "use-color (boolean) = false\n(lldb) ")
1 <- gud-lldb-marker-filter: "use-color (boolean) = false\n(lldb) "
======================================================================
1 -> (gud-lldb-marker-filter "process kill\n")
1 <- gud-lldb-marker-filter: "process kill\n"
======================================================================
1 -> (gud-lldb-marker-filter "Process 95787 exited with status = 9 (0x00000009) killed\n(lldb) ")
1 <- gud-lldb-marker-filter: "Process 95787 exited with status = 9 (0x00000009) killed\n(lldb) "
======================================================================
1 -> (gud-lldb-marker-filter "attach  95179\n")
1 <- gud-lldb-marker-filter: "attach  95179\n"
======================================================================
1 -> (gud-lldb-marker-filter "Process 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP\n    frame #0: 0x000000018720a8b4 libsystem_kernel.dylib`mach_msg2_trap + 8\nlibsystem_kernel.dylib`mach_msg2_trap:\n->  0x18720a8b4 <+8>: ret    \n\nlibsystem_kernel.dylib`macx_swapon:\n    0x18720a8b8 <+0>: mov    x16, #-0x30               ; =-48 \n    0x18720a8bc <+4>: svc    #0x80\n    0x18720a8c0 <+8>: ret\n(lldb) ")
1 <- gud-lldb-marker-filter: "Process 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP\n    frame #0: 0x000000018720a8b4 libsystem_kernel.dylib`mach_msg2_trap + 8\nlibsystem_kernel.dylib`mach_msg2_trap:\n->  0x18720a8b4 <+8>: ret    \n\nlibsystem_kernel.dylib`macx_swapon:\n    0x18720a8b8 <+0>: mov    x16, #-0x30               ; =-48 \n    0x18720a8bc <+4>: svc    #0x80\n    0x18720a8c0 <+8>: ret\n(lldb) "
======================================================================
1 -> (gud-lldb-marker-filter "n\n")
1 <- gud-lldb-marker-filter: "n\n"
======================================================================
1 -> (gud-lldb-marker-filter "(lldb) ")
1 <- gud-lldb-marker-filter: "(lldb) "
======================================================================
1 -> (gud-lldb-marker-filter "[1G[JProcess 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over\n    frame #0: 0x000000018721cd30 libsystem_kernel.dylib`mach_msg2_internal + 80\nlibsystem_kernel.dylib`mach_msg2_internal:\n->  0x18721cd30 <+80>: cbz    w0, 0x18721cdd0           ; <+240>\n    0x18721cd34 <+84>: tbnz   w26, #0x6, 0x18721cd70    ; <+144>\n    0x18721cd38 <+88>: mov    w28, #0x7                 ; =7 \n    0x18721cd3c <+92>: movk   w28, #0x1000, lsl #16\n[1G[J(lldb)  [8G")
1 <- gud-lldb-marker-filter: "[1G[JProcess 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over\n    frame #0: 0x000000018721cd30 libsystem_kernel.dylib`mach_msg2_internal + 80\nlibsystem_kernel.dylib`mach_msg2_internal:\n->  0x18721cd30 <+80>: cbz    w0, 0x18721cdd0           ; <+240>\n    0x18721cd34 <+84>: tbnz   w26, #0x6, 0x18721cd70    ; <+144>\n    0x18721cd38 <+88>: mov    w28, #0x7                 ; =7 \n    0x18721cd3c <+92>: movk   w28, #0x1000, lsl #16\n[1G[J(lldb)  [8G"
======================================================================
1 -> (gud-lldb-marker-filter "\n")
1 <- gud-lldb-marker-filter: "\n"
======================================================================
1 -> (gud-lldb-marker-filter "(lldb) ")
1 <- gud-lldb-marker-filter: "(lldb) "
======================================================================
1 -> (gud-lldb-marker-filter "[1G[JProcess 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over\n    frame #0: 0x000000018721cd34 libsystem_kernel.dylib`mach_msg2_internal + 84\nlibsystem_kernel.dylib`mach_msg2_internal:\n->  0x18721cd34 <+84>: tbnz   w26, #0x6, 0x18721cd70    ; <+144>\n    0x18721cd38 <+88>: mov    w28, #0x7                 ; =7 \n    0x18721cd3c <+92>: movk   w28, #0x1000, lsl #16\n    0x18721cd40 <+96>: cmp    w0, w28\n[1G[J(lldb)  [8G")
1 <- gud-lldb-marker-filter: "[1G[JProcess 95179 stopped\n* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over\n    frame #0: 0x000000018721cd34 libsystem_kernel.dylib`mach_msg2_internal + 84\nlibsystem_kernel.dylib`mach_msg2_internal:\n->  0x18721cd34 <+84>: tbnz   w26, #0x6, 0x18721cd70    ; <+144>\n    0x18721cd38 <+88>: mov    w28, #0x7                 ; =7 \n    0x18721cd3c <+92>: movk   w28, #0x1000, lsl #16\n    0x18721cd40 <+96>: cmp    w0, w28\n[1G[J(lldb)  [8G"

Look at these escape sequences that suddenly appear when attaching to a
process! I don't even know what "<esc>[1G" and "<esc>[8G" do. I can't
find them in the list of ANSI sequences.

Xterm has something like that

CHA	Cursor Horizontal Absolute	CSI Ps G	Move cursor to Ps-th column of the active row (default=1).

But that makes no sense at all...

Don't know what happens after that that with the sequences in Emacs, but
this is already so weird that I need a pause :-)





  reply	other threads:[~2023-10-20 17:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 11:25 bug#66604: [PATCH] Gud LLDB completions Gerd Möllmann
2023-10-18 13:37 ` Mattias Engdegård
2023-10-18 14:42   ` Gerd Möllmann
2023-10-18 15:14     ` Mattias Engdegård
2023-10-18 15:23       ` Gerd Möllmann
2023-10-18 16:05         ` Mattias Engdegård
2023-10-18 16:57           ` Gerd Möllmann
2023-10-18 18:55             ` Gerd Möllmann
2023-10-19 10:34               ` Mattias Engdegård
2023-10-19 10:48                 ` Gerd Möllmann
2023-10-19 11:36                   ` Mattias Engdegård
2023-10-19 11:50                     ` Gerd Möllmann
2023-10-19 12:29                       ` Mattias Engdegård
2023-10-19 13:08                         ` Gerd Möllmann
2023-10-19 13:22                           ` Mattias Engdegård
2023-10-20  6:04                             ` Gerd Möllmann
2023-10-20 10:42                               ` Mattias Engdegård
2023-10-20 11:12                                 ` Gerd Möllmann
2023-10-20 11:50                                   ` Mattias Engdegård
2023-10-20 11:59                                     ` Gerd Möllmann
2023-10-20 17:28                                       ` Gerd Möllmann [this message]
2023-10-20 17:47                                         ` Gerd Möllmann
2023-10-21 10:32                                           ` Gerd Möllmann
2023-10-21 10:51                                             ` Mattias Engdegård
2023-10-21 12:33                                               ` Gerd Möllmann
2023-10-21 10:37                                         ` Mattias Engdegård
2023-10-21 10:50                                           ` Gerd Möllmann
2023-10-23  5:31                                             ` Gerd Möllmann
2023-10-23 17:18                                               ` Mattias Engdegård
2023-10-23 17:57                                                 ` Gerd Möllmann
2023-10-23 20:51                                                   ` Mattias Engdegård
2023-10-24  4:35                                                     ` Gerd Möllmann
2023-10-24  8:47                                                       ` Mattias Engdegård
2023-10-24  8:52                                                         ` Gerd Möllmann
2023-10-24 10:00                                                           ` Mattias Engdegård
2023-10-24 10:27                                                             ` Gerd Möllmann
2023-10-24 18:12                                                               ` Mattias Engdegård
2023-10-25  4:29                                                                 ` Gerd Möllmann
2023-10-18 15:24       ` Gerd Möllmann
2023-10-19  6:31     ` Visuwesh
2023-10-19  6:56       ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h6mlyzi0.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=66604@debbugs.gnu.org \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).