connecting lldb to a qemu system-mode session.

I’m having a hard time trying to figure out how to get lldb to attach to a qemu system mode session.

Does lldb support something like: “target remote /tmp/gdb-socket0”?

Thanks,

You want the gdb-remote command. lldb has an apropos command, so for instance:

(lldb) apropos remote
The following commands may relate to 'remote':
  gdb-remote -- Connect to a process via remote GDB server. If no
                             host is specifed, localhost is assumed.

etc...

Jim

From: Jim Ingham <jingham@apple.com>
Sent: Thursday, October 21, 2021 2:31 PM
To: Sid Manning <sidneym@quicinc.com>
Cc: LLDB Dev <lldb-dev@lists.llvm.org>
Subject: Re: [lldb-dev] connecting lldb to a qemu system-mode session.

WARNING: This email originated from outside of Qualcomm. Please be wary
of any links or attachments, and do not enable macros.

You want the gdb-remote command. lldb has an apropos command, so for
instance:

(lldb) apropos remote
The following commands may relate to 'remote':
  gdb-remote -- Connect to a process via remote GDB server. If no
                             host is specifed, localhost is assumed.

I think I found the correct command:

process connect unix-connect:///tmp/gdb-socket

Would be what is needed when qemu is started using something like these options:

-chardev socket,path=/tmp/gdb-socket,port=::1234,server=on,wait=off,id=gdb0 -gdb chardev:gdb0

Thanks,