[lldb-dev] How to debug LLDB server?
Todd Fiala via lldb-dev
lldb-dev at lists.llvm.org
Sun Oct 11 10:51:53 PDT 2015
On Wed, Oct 7, 2015 at 8:03 PM, Bruce Mitchener via lldb-dev <
lldb-dev at lists.llvm.org> wrote:
> In the LLDB project, you have 3 different defines:
>
> LLDB_CONFIGURATION_DEBUG
> LLDB_CONFIGURATION_RELEASE
> LLDB_CONFIGURATION_BUILD_AND_INTEGRATION
>
> I can easily set this up to be set for the various build types in cmake,
> but I'd like to make sure we all agree about what should happen first:
>
> CMAKE_BUILD_TYPE = Debug: Add LLDB_CONFIGURATION_DEBUG
> CMAKE_BUILD_TYPE = RelWithDebinfo: Add LLDB_CONFIGURATION_RELEASE
> CMAKE_BUILD_TYPE = Release: Add LLDB_CONFIGURATION_BUILD_AND_INTEGRATION
>
For Release, you will not want to use
LLDB_CONFIGURATION_BUILD_AND_INTEGRATION. That has a very specific meaning
in Apple-land and that skips several steps under assumptions that do not
hold true for developer builds (at least on the Xcode side). Pretty much
don't ever use that for local builds. I think we would want to use
LLDB_CONFIGURATION_RELEASE here.
> CMAKE_BUILD_TYPE = RelWithDebinfo: Add LLDB_CONFIGURATION_RELEASE
For that one, does the LLDB_CONFIGURATION_RELEASE contain debug info? If
it doesn't, we'd want to arrange for debug info to be there.
FWIW - I'm looking at getting full symbols into liblldb.so in cmake builds
under some condition so that items like:
'log enable --stack ...' actually have the symbols in liblldb.so (as you
and I were discussing on another thread). Assuming I can get that working,
we'll have an orthogonal dimension of debuginfo, for the normally private
bits. Essentially something like LLDB_EXPORT_LIBLLDB_PRIVATE_SYMBOLS or
some such thing...
>
> This seems right to me as there are some usages of
> LLDB_CONFIGURATION_RELEASE that appear to be useful with debugging.
>
> Does that seem to be correct?
>
> - Bruce
>
>
> On Thu, Oct 8, 2015 at 2:44 AM, Greg Clayton via lldb-dev <
> lldb-dev at lists.llvm.org> wrote:
>
>> We set this manually in the Xcode project for "Debug" and "DebugClang"
>> build variants. The cmake should be able to do the same, but I am not sure
>> if it is. Feel free to make it do so. I am not very good with cmake, so I
>> won't be much help.
>>
>> Greg
>>
>> > On Oct 7, 2015, at 11:09 AM, Eugene Birukov <eugenebi at hotmail.com>
>> wrote:
>> >
>> > Thanks!
>> >
>> > A newbie question then: how to trigger LLDB_CONFIGURATION_DEBUG when I
>> run cmake? I am sure that I built debug version, but packet timeout is
>> still 1 to me.
>> >
>> > (gdb) p m_packet_timeout
>> > $1 = 1
>> >
>> >
>> > > Subject: Re: [lldb-dev] How to debug LLDB server?
>> > > From: gclayton at apple.com
>> > > Date: Wed, 7 Oct 2015 11:04:45 -0700
>> > > CC: lldb-dev at lists.llvm.org
>> > > To: eugenebi at hotmail.com
>> > >
>> > > Most calls for lldb-server should use an instance variable
>> GDBRemoteCommunication::m_packet_timeout which you could then modify. But
>> this timeout you are talking about is the time that the expression can take
>> when running. I would just bump these up temporarily while you are
>> debugging to avoid the timeouts. Just don't check it in.
>> > >
>> > > So for GDB Remote packets, we already bump the timeout up in the
>> GDBRemoteCommunication constructor:
>> > >
>> > > #ifdef LLDB_CONFIGURATION_DEBUG
>> > > m_packet_timeout (1000),
>> > > #else
>> > > m_packet_timeout (1),
>> > > #endif
>> > >
>> > >
>> > > Anything else is probably expression timeouts and you will need to
>> manually bump those up in order to debug, or you could do the same thing as
>> the GDB Remote in InferiorCallPOSIX.cpp:
>> > >
>> > > #ifdef LLDB_CONFIGURATION_DEBUG
>> > > options.SetTimeoutUsec(50000000);
>> > > #else
>> > > options.SetTimeoutUsec(500000);
>> > > #endif
>> > >
>> > >
>> > > > On Oct 7, 2015, at 10:33 AM, Eugene Birukov via lldb-dev <
>> lldb-dev at lists.llvm.org> wrote:
>> > > >
>> > > > Hello,
>> > > >
>> > > > I am trying to see what is going inside LLDB server 3.7.0 but there
>> are a lot of timeouts scattered everywhere. Say, InferiorCallPOSIX.cpp:74
>> sets hard-coded timeout to 500,000us, etc. These timeouts fire if I spend
>> any time on breakpoint inside server and make debugging experience
>> miserable. Is there any way to turn them all off?
>> > > >
>> > > > BTW, I am using LLDB as a C++ API, not as standalone program, but I
>> have debugger attached to it and can alter its memory state.
>> > > >
>> > > > Thanks,
>> > > > Eugene
>> > > >
>> > > > _______________________________________________
>> > > > lldb-dev mailing list
>> > > > lldb-dev at lists.llvm.org
>> > > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>> > >
>>
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
--
-Todd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20151011/a5b1fc7b/attachment-0001.html>
More information about the lldb-dev
mailing list