[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 21 05:35:47 PDT 2016

labath added a comment.

I don't know of any good source of documentation for this, but I am willing to answer any questions you might have about this. Basically, the idea of lldb-server is that you use the same code path for remote debugging as you to for local. So all the debugging is done in a separate process called lldb-server, with which the client then communicates when it needs something done.

If we want to get lldb-server working on freebsd, I would propose a plan like this:

- rename NativeProcessLinux into something more generic (NativeProcessPosix ?), make a new NativeProcessLinux, which inherits from that, but contains no code.
- get NativeProcessPosix building on FreeBSD. Now, you will likely get compile errors as we may be using some OS interfaces that don't exist on freebsd. We will need to figure out how we can either: a) use interfaces which are available on both platforms; b) abstract the functionality so it can implemented in the derived classes. The biggest offender here will be ptrace (at one point we used signalfd(), but that is gone now), as it operates a bit differently on the two OSs. For the implementation of the FreeBSD part of it, you can use the existing ProcessFreeBSD classes for inspiration. All the other
- get lldb-server test suite passing on FreeBSD (these are all the tests in tools/lldb-server), which test pure server functionality)
- switch lldb client to use lldb-server instead of ProcessFreeBSD
- get the rest of lldb tests passing
- remove ProcessFreeBSD

When we were getting lldb-server working for linux, it really helped having osx as a reference, because it already used the same flow. I imagine that it could be quite helpful for you as well, if you could get a linux machine/VM to be able to compare how the code behaves on two platforms, but I think it should be possible to do it without it.

So, if you want to get started, I propose you do a preliminary invetigation -- set the build system so that in builds NativeProcessLinux on FreeBSD, and see how much code do you have to delete, so that it compiles. This should give us an idea of the scope of the work.

good luck :)



More information about the lldb-commits mailing list