Lines Matching +full:www +full:- +full:releases
8 As LLDB is generally split into 2 tools, ``lldb`` and ``lldb-server``
16 ----------------------
23 -DCMAKE_BUILD_TYPE=Debug \
24 -DLLDB_EXPORT_ALL_SYMBOLS=ON
37 ------------------
50 ./bin/lldb -- ./bin/lldb /tmp/test.o
100 $ ./bin/lldb -o "settings set prompt \"(lldb debugger) \"" -- \
101 ./bin/lldb -o "settings set prompt \"(lldb inferior) \"" /tmp/test.o
120 $ ./bin/lldb ./bin/lldb --attach-pid $(pidof lldb)
135 If you are doing this with ``lldb-server`` and find your breakpoint is never
137 ``lldb-server``. There are cases where code only used by ``lldb`` ends up
138 linked into ``lldb-server``, so the debugger can break there but the breakpoint
141 Debugging ``lldb-server``
142 -------------------------
145 ``lldb-server``. The spirit of these instructions applies but the specifics will
148 We suggest you read :doc:`/use/remote` before attempting to debug ``lldb-server``
153 The ``lldb-server`` options for your situation will depend on what part of it
156 ``lldb-server`` during the following command:
162 We can treat ``lldb-server`` as we treated ``lldb`` before, running it under
163 ``lldb``. The equivalent to having ``lldb`` launch the ``lldb-server`` for us is
164 to start ``lldb-server`` in the ``gdbserver`` mode.
166 The following commands recreate that, while debugging ``lldb-server``:
170 $ ./bin/lldb -- ./bin/lldb-server gdbserver :1234 /tmp/test.o
171 (lldb) target create "./bin/lldb-server"
172 Current executable set to '<...>/bin/lldb-server' (aarch64).
174 Process 1742485 launched: '<...>/bin/lldb-server' (aarch64)
178 $ ./bin/lldb /tmp/test.o -o "gdb-remote 1234"
180 Note that the first ``lldb`` is the one debugging ``lldb-server``. The second
182 interesting code path in ``lldb-server``.
187 If you are debugging a scenario where the ``lldb-server`` starts in ``platform``
193 ``target.process.follow-fork-mode`` or GDB's ``follow-fork-mode`` to
198 Another option is to let ``lldb-server`` start up, then attach to the process
203 Output From ``lldb-server``
206 As ``lldb-server`` often launches subprocesses, output messages may be hidden
209 You can tell it to enable logging using the ``--log-channels`` option. For
210 example ``--log-channels "posix ptrace"``. However that is not passed on to the
216 In these cases consider interactive debugging ``lldb-server`` or
224 $ strace -ff -o log -p $(pidof lldb-server)
226 This will log all syscalls made by ``lldb-server`` and processes that it forks.
227 ``-ff`` tells ``strace`` to trace child processes and write the results to a
228 separate file for each process, named using the prefix given by ``-o``.
234 log.<N>:execve("<...>/lldb-server", [<...> "gdbserver", <...>) = 0
237 ----------------
243 In the example below we're debugging an ``lldb-server`` ``gdbserver`` mode
246 For simplicity we'll use the same ``lldb-server`` as the debug server
248 (as in, GDB's debug server program) or a system installed ``lldb-server`` if you
254 $ <...>/bin/lldb-server gdbserver 0.0.0.0:54322 -- \
255 <...>/bin/lldb-server gdbserver 0.0.0.0:54321 -- /tmp/test.o
259 ``lldb`` to, to debug the second ``lldb-server``.
261 To trigger behaviour in the second ``lldb-server``, we will connect a second
269 --------------------------------------------|--------------------
270 lldb A debugs lldb-server on port 54322 -> | lldb-server A
272 lldb B debugs /tmp/test.o on port 54321 -> | lldb-server B
277 then ``lldb B`` to trigger ``lldb-server B`` to go into that code and hit the
278 breakpoint. ``lldb-server A`` is only here to let us debug ``lldb-server B``
282 -----------------------------
284 LLDB mostly follows the `GDB Remote Protocol <https://sourceware.org/gdb/onlinedocs/gdb/Remote-Prot…
288 `lldb-gdb-remote.txt <https://github.com/llvm/llvm-project/blob/main/lldb/docs/lldb-gdb-remote.txt>…
289 and `lldb/docs/lldb-platform-packets.txt <https://github.com/llvm/llvm-project/blob/main/lldb/docs/…
294 If you just want to observe packets, you can enable the ``gdb-remote packets``
299 (lldb) log enable gdb-remote packets
306 You can do this on the ``lldb-server`` end as well by passing the option
307 ``--log-channels "gdb-remote packets"``. Then you'll see both sides of the
315 You can enable this logging even when you are connecting to an ``lldb-server``
321 Say you want to make ``lldb`` send a packet to ``lldb-server``, then debug
326 away. You can change the ``plugin.process.gdb-remote.packet-timeout`` setting
329 Here's an example, first we'll start an ``lldb-server`` being debugged by
335 $ lldb -- lldb-server gdbserver :1234 -- /tmp/test.o
348 (lldb) settings set plugin.process.gdb-remote.packet-timeout 300
349 (lldb) gdb-remote 1234
351 Doing so triggers the breakpoint in ``lldb-server``, bringing us back into
357 * thread #1, name = 'lldb-server', stop reason = breakpoint 1.1
358 frame #0: 0x0000aaaaaacc6848 lldb-server<...>
359 …lldb-server`lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qSupporte…
360 -> 0xaaaaaacc6848 <+0>: sub sp, sp, #0xc0
364 Once you're done simply ``continue`` the ``lldb-server``. Back in the other
371 frame #0: 0x0000fffff7fcd100 ld-2.31.so`_start
372 ld-2.31.so`_start:
373 -> 0xfffff7fcd100 <+0>: mov x0, sp
378 -------------
412 * Use a `released version of LLDB <https://github.com/llvm/llvm-project/releases>`_.
421 * Start a virtual machine running a different version. ``qemu-system`` is
452 * Use ``qemu-system`` to emulate other operating systems e.g. FreeBSD.
456 * Use `QEMU user space emulation <https://www.qemu.org/docs/master/user/main.html>`_
457 to quickly test other architectures. Note that ``lldb-server`` cannot be used
461 space emulation for just ``lldb``, ``qemu-system`` for testing
462 ``lldb-server``).
465 ``lldb-server``. For example if you wanted to debug ``lldb`` running
466 inside ``qemu-user-s390x`` you would connect to the GDB stub provided
471 you're not using ``lldb-server``, but this is fine for features that
474 If you are running a full system using ``qemu-system``, you likely
475 want to connect to the ``lldb-server`` running within the userspace
488 Sometimes you will find ``lldb-server`` doing something with ptrace that causes
501 The program presented `here <https://eli.thegreenplace.net/2011/01/23/how-debuggers-work-part-1>`_
502 (`source <https://github.com/eliben/code-for-blog/blob/master/2011/simple_tracer.c>`_)
504 `the LLDB examples folder <https://github.com/llvm/llvm-project/tree/main/lldb/examples/ptrace_exam…
511 Once that is running as expected we can convert ``lldb-server``'s into calls in
512 this program. To get a log of those, run ``lldb-server`` with
513 ``--log-channels "posix ptrace"``. You'll see output like:
517 $ lldb-server gdbserver :1234 --log-channels "posix ptrace" -- /tmp/test.o
526 …o use a combination of the `ptrace documentation <https://man7.org/linux/man-pages/man2/ptrace.2.h…
540 First, go to the ``lldb-server`` terminal and press enter a few times to put
550 You'll see this from ``lldb-server``:
595 Finally, that "thing" is the ptrace calls you got from the ``lldb-server`` logs.
600 ---------------