[lldb-dev] Remote Debugging on Linux

Vince Harron vharron at google.com
Wed Mar 4 06:55:23 PST 2015


I have only tried cross compiling lldb-server to 32bit.  I've hit issues
getting the host binaries to compile.
On Mar 4, 2015 5:51 AM, "Abhishek Aggarwal" <abhiinnitald at gmail.com> wrote:

> Hi Vince
>
> Do you mean that you are cross-compiling LLDB or are you cross-compiling
> only LLDB-server ?
> Can you share with me the procedure to do it? I couldn't find any
> documentation for it.
>
> On Fri, Feb 27, 2015 at 5:06 AM, Vince Harron <vharron at google.com> wrote:
>
>> We are focusing on cross compiling the 32bit LLDB server from x86_64.  We
>> will eventually need to compile the 32bit host binaries on Windows but we
>> aren't focused on 32 but Mac/Linux hosts.  Please feel free to get this
>> working.
>>
>> Vince
>>  On Feb 25, 2015 9:00 AM, "Abhishek Aggarwal" <abhiinnitald at gmail.com>
>> wrote:
>>
>>> Hi All
>>>
>>> Thanks a lot for all the inputs.
>>>
>>> @Greg: I could make it work using the lldb-platform. I had checked out
>>> source code of LLDB on Feb 16 and had built (Debug+Asserts) it on Fedora 20
>>> system (x86_64). I will like to make few comments which are inlined.
>>>
>>> @Vince: Are you building LLDB for x86_32 Linux ? I tried to build it
>>> (Debug build) for such a system and it fails during linking process because
>>> of lack of memory.
>>> In order to bring up x86_32 support, are you following a different
>>> approach ? I read the thread initiated by you "Transitioning to Linux local
>>> debugging via lldb-gdbserver" . Are you using this approach?
>>>
>>>
>>> On Tue, Feb 24, 2015 at 11:34 PM, Vince Harron <vharron at google.com>
>>> wrote:
>>>
>>>> It's only really tested on x86_64->x86_64.  We are bringing up x86_32
>>>> and arm32/64 now-ish, MIPS soon to follow.
>>>>
>>>> Please let us know if you hit any problems!
>>>>
>>>>
>>>> On Tue, Feb 24, 2015 at 3:52 PM, Greg Clayton <gclayton at apple.com>
>>>> wrote:
>>>>
>>>>> The first way to do this is to use the lldb-platform to allow you to
>>>>> view and launch processes on the remote host.
>>>>>
>>>>> On the remote machine launch lldb-server:
>>>>>
>>>>
>>>
>>>> remote.foo.com% lldb-server platform --listen=2000 --stay-alive
>>>>>
>>>>>
>>> I had to replace "lldb-server platform" by "lldb-platform" because right
>>> now, building lldb doesn't generate any binary with name lldb-server.
>>>
>>>
>>>> Then on your host machine:
>>>>>
>>>>> host.bar.com% lldb
>>>>> (lldb) platform select remote-linux
>>>>> (lldb) platform connect connect://remote.foo.com:2000
>>>>>
>>>>> Now you have a live connection to a platform server on the remote host
>>>>> so you can list existing processes:
>>>>>
>>>>> (lldb) platform process list
>>>>> (lldb) platform process attach --pid ...
>>>>>
>>>>> Or you can launch:
>>>>>
>>>>> (lldb) file /path/to/binary
>>>>> (lldb) process launch -- arg1 arg2
>>>>>
>>>>> The platform will launch a lldb-server to debug your programs on the
>>>>> other system.
>>>>>
>>>>>
>>> This thing worked pretty well.
>>>
>>>
>>>>
>>>>>
>>>>> The other is to just directly debug a process. In this case we don't
>>>>> go through the platform, we just start lldb-server on
>>>>>
>>>>> remote.foo.com% lldb-server gdbserver host.bar.com:2000 -- arg1 arg2
>>>>>
>>>>>
>>> Again , I replaced "lldb-server gdbserver" by lldb-gdbserver.
>>>
>>>
>>>> Then attach to it:
>>>>>
>>>>> host.bar.com% lldb
>>>>> (lldb) file /path/to/binary
>>>>> (lldb) process connect connect://remote.foo.com:2000
>>>>>
>>>>>
>>> While running process connect command, I got the following error
>>>        "error: remote connections are not supported"
>>>
>>>
>>>
>>>> Now you will be stopped at the program entry point and ready to debug a
>>>>> single process.
>>>>>
>>>>> All of this is of course using the top of tree SVN sources. It will
>>>>> change a bit if you are using older sources.
>>>>>
>>>>
>>> The above error might be because my source code is old. But I am not
>>> sure given that the source code is 9 days old.
>>>
>>>
>>>>
>>>>> Greg
>>>>>
>>>>>
>>>>> > On Feb 24, 2015, at 6:09 AM, Abhishek Aggarwal <
>>>>> abhiinnitald at gmail.com> wrote:
>>>>> >
>>>>> > Hi All
>>>>> >
>>>>> > I am new to LLDB. I want to remotely debug some applications. Both
>>>>> the host and target OS is Linux.
>>>>> >
>>>>> > I went through few discussions in this list regarding remote
>>>>> debugging but I am still unclear about how to do it.
>>>>> > I could figure out from the discussions that there are 2 ways to do
>>>>> remote debugging: lldb-platform and lldb-gdbserver
>>>>> >
>>>>> > I don't know which one of them is fully functional for Linux. I
>>>>> would highly appreciate some comments here.
>>>>> >
>>>>> >
>>>>> > Thanks
>>>>> > Abhiinnit
>>>>> > _______________________________________________
>>>>> > lldb-dev mailing list
>>>>> > lldb-dev at cs.uiuc.edu
>>>>> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> lldb-dev mailing list
>>>>> lldb-dev at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Vince Harron | Technical Lead Manager | vharron at google.com |
>>>> 858-442-0868
>>>>
>>>
>>> Thanks
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150304/4c4c1d32/attachment.html>


More information about the lldb-dev mailing list