[lldb-dev] Remote Debugging on Linux
Chaoren Lin
chaorenl at google.com
Thu Feb 26 15:19:39 PST 2015
Sorry, forgot to reply all last time. so there's some duplicate.
> I tried to build it (Debug build) for such a system and it fails during
> linking process because of lack of memory.
I ran into the same problem. Adding "-fuse-ld=gold -gsplit-dwarf" to your
C{XX}FLAGS while configuring should resolve this issue. Caveat: you have to
use gcc/gdb.
All of the instructions with lldb-platform and lldb-debugserver are now
outdated since we merged the two binaries.
> While running process connect command, I got the following error
> "error: remote connections are not supported"
Try
export PLATFORM_LINUX_FORCE_LLGS_LOCAL=1
before launching LLDB.
This fixes the problem for me. I'm not sure if it's worth the time to
investigate why, since we're eventually going to make that the default
anyway.
On Wed, Feb 25, 2015 at 6: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
>
>
> _______________________________________________
> 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/20150226/8d81d661/attachment.html>
More information about the lldb-dev
mailing list