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

Vince Harron vince at nethacker.com
Thu May 7 10:14:00 PDT 2015


We are actively working on getting the test suite to pass from OSX host to
a Linux target but there are still a lot of failures.  I don't think remote
debugging is supported at all on FreeBSD today.  (Even FreeBSD to FreeBSD)
 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150507/e416f701/attachment.html>


More information about the lldb-dev mailing list