git: 192a5729e5 - main - handbook: add a section on remote debugging via LLDB

Guangyuan Yang ygy at FreeBSD.org
Mon Dec 28 21:17:14 UTC 2020


The branch main has been updated by ygy:

URL: https://cgit.FreeBSD.org/doc/commit/?id=192a5729e55ebddd239731df215b973d39581a29

commit 192a5729e55ebddd239731df215b973d39581a29
Author:     Guangyuan Yang <ygy at FreeBSD.org>
AuthorDate: 2020-12-28 16:26:55 +0000
Commit:     Guangyuan Yang <ygy at FreeBSD.org>
CommitDate: 2020-12-28 21:15:57 +0000

    handbook: add a section on remote debugging via LLDB
    
    PR:             251709
    Obtained from:  Moritz Systems
    Submitted by:   Michał Górny <mgorny at moritz.systems>
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    bcr
    Discussed with: dim, emaste
    Differential Revision:  https://reviews.freebsd.org/D27524
---
 .../books/developers-handbook/tools/chapter.xml    | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/en_US.ISO8859-1/books/developers-handbook/tools/chapter.xml b/en_US.ISO8859-1/books/developers-handbook/tools/chapter.xml
index c7d538f58f..2ce196350e 100644
--- a/en_US.ISO8859-1/books/developers-handbook/tools/chapter.xml
+++ b/en_US.ISO8859-1/books/developers-handbook/tools/chapter.xml
@@ -1655,6 +1655,48 @@ else if (pid == 0) {		/* child */
 	  <userinput>expr PauseMode = 0</userinput> and wait
 	  for the <function>sleep()</function> call to return.</para>
       </sect3>
+
+      <sect3>
+	<title>Remote Debugging Using LLDB</title>
+
+	<note>
+	  <para>The described functionality is available starting with
+	    LLDB version 12.0.0.  Users of &os; releases containing an
+	    earlier LLDB version may wish to use the snapshot
+	    available in <link
+	    xlink:href="&url.books.handbook;/ports-using.html">ports
+	    or packages</link>, as
+	    <package>devel/llvm-devel</package>.</para>
+	</note>
+
+	<para>Starting with LLDB 12.0.0, remote debugging is supported
+	  on &os;.  This means that <command>lldb-server</command>
+	  can be started to debug a program on one host, while
+	  the interactive <command>lldb</command> client connects
+	  to it from another one.</para>
+
+	<para>To launch a new process to be debugged remotely, run
+	  <command>lldb-server</command> on the remote server
+	  by typing</para>
+
+	<screen>&prompt.user; <userinput>lldb-server g <replaceable>host:port</replaceable> -- <replaceable>progname</replaceable></userinput></screen>
+
+	<para>The process will be stopped immediately after launching,
+	  and <command>lldb-server</command> will wait for the client
+	  to connect.</para>
+
+	<para>Start <command>lldb</command> locally and type
+	  the following command to connect to the remote
+	  server:</para>
+
+	<screen>(lldb) <userinput>gdb-remote <replaceable>host:port</replaceable></userinput></screen>
+
+	<para><command>lldb-server</command> can also attach to
+	  a running process.  To do that, type the following
+	  on the remote server:</para>
+
+	<screen>&prompt.user; <userinput>lldb-server g <replaceable>host:port</replaceable> --attach <replaceable>pid-or-name</replaceable></userinput></screen>
+      </sect3>
     </sect2>
 
     <sect2>


More information about the dev-commits-doc-all mailing list