[lldb-dev] Remote debugging with lldb
filcab+lldb-dev at gmail.com
Tue Sep 6 11:10:42 PDT 2011
On Fri, Sep 2, 2011 at 19:03, Greg Clayton <gclayton at apple.com> wrote:
> On Sep 2, 2011, at 2:04 PM, Filipe Cabecinhas wrote:
> > One way to fix this is to allow 'target create' (or another command) to
> tell the debugger which executable file we're using. That way, we could make
> it the executable image and then call CompleteAttach (or redo some of the
> steps) in order to get everything working (including the DYLD plugin). Is
> this a good way to do that? Or do you prefer to just have lldb talk to
> itself (and lldb-platform)?
> Exactly! You should be able to specify the local copy of the file you have.
> We will always check the UUIDs of the executable files you have loaded when
> dyld comes along. For instance, locally you have a binary "/tmp/a.out".
> Remotely this file is in "/usr/local/bin/a.out".
> You can start lldb, set the platform, set the file and attach:
> % lldb
> (lldb) platform select ...
> (lldb) target create /tmp/a.out
> (lldb) process connect ....
> Now when the dynamic loader plug-in gets info about a remote binary, it
> will say the path is at "/usr/local/bin/a.out", but we will notice that the
> UUID in the binary matches, so we don't care what the local path is.
> LLDB currently really needs to have local copies of the files in order to
> debug. The architecture you select when you create the target really helps
> to specify which sets of plug-ins get loaded.
But you can't do that right now. As of now, if you didn't "platform
connect", m_remote_platform_sp is NULL. That way, you'll just get an error
when issuing the "target create" command, because you can't resolve the
executable (see PlatformDarwin.cpp:83).
I was thinking about adding the code to resolve the executable in relation
to the platform's sysroot (I suppose I would just concatenate the
directories and try to resolve the FileSpec). That way, we would be able to
create a target before connecting.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev