[lldb-dev] Remote debug a program running on FreeBSD from Mac OS X

Greg Clayton gclayton at apple.com
Thu May 7 10:12:40 PDT 2015


Check the gdb-remote packet log. It seems you are losing connection to your lldb-server and that causes the process to die with -1 and "lost connection". To see the log:

(lldb) log enable -t -f /tmp/packet.log gdb-remote packets

This will log all GDB remote packets, including the ones that the "lldb-server platform" is sending, but you might be able to see how far your program is making it...

Greg

> On May 7, 2015, at 10:02 AM, Dr. Rolf Jansen <rj at obsigna.com> wrote:
> 
> I built lldb (+clang/llvm) from trunk on the FreeBSD 10.1-RELEASE-p9 box and on the Mac OS X 10.10.3 client. Is remote debugging of an executable on FreeBSD possible from within lldb on Mac OS X? Considering the simple "hello.c" below, I can launch the executable which resides on FreeBSD remotely via lldb on the Mac OS X client, but the session is then immediately stopped with the following message:
> 
> Process 17299 exited with status = -1 (0xffffffff) lost connection
> 
> 
> What am I doing wrong? Here comes, what I achieved so far:
> 
> hello.c:
> 
> #include <stdio.h>
> 
> int main(int argc, const char *argv[])
> {
>   printf("Hello, World!\n");
>   getchar();
>   return 0;
> }
> 
> 
> On the FreeBSD box:
> 
> # cd ~/helloworld
> # clang -O0 -g hello.c -o hello
> # ~/install/LLVM/llvm/build/bin/lldb-server platform —listen *:1234
> 
> 
> On the Mac OS X client:
> 
> $ scp -rp root at server:helloworld helloworld
> $ cd helloworld
> $ ~/install/LLVM/build/bin/lldb
> (lldb) version
> lldb-340.99.0
> (lldb) platform select remote-freebsd
>      Host: Darwin 14.3.0 (MBPRJ.local)
> Host: Darwin 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64
>  Platform: remote-freebsd
> Connected: no
> (lldb) target create ./hello
> Current executable set to './hello' (x86_64).
> (lldb) platform connect connect://192.168.222.35:1234
>      Host: Darwin 14.3.0 (MBPRJ.local)
> Host: Darwin 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64
>  Platform: remote-freebsd
>    Triple: x86_64-unknown-freebsd10.1
> OS Version: 10.1 (00199506)
>    Kernel: FreeBSD 10.1-RELEASE-p9 #1: Fri Apr 10 07:28:09 BRT 2015     root at server.mydomain.org:/usr/obj/usr/src/sys/GENERIC_IPsec
>  Hostname: server.mydomain.org
> Connected: yes
> (lldb) b hello.c:5
> Breakpoint 1: where = hello`main + 30 at hello.c:5, address = 0x000000000040086e
> (lldb) platform process launch
> (lldb) Process 17299 exited with status = -1 (0xffffffff) lost connection
> 
> 
> Best regards
> 
> Rolf
> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list