[lldb-dev] Enabling logging

Greg Clayton gclayton at apple.com
Tue Sep 23 09:56:05 PDT 2014


You might just try:

debugger.HandleCommand("log enable -f /tmp/log.txt lldb api")

> On Sep 23, 2014, at 5:40 AM, Mikhail Sosonkin <mike at nanotick.net> wrote:
> 
> Thank you for your responses. I've gotten some extra output but not
> much at all. This is how I'm doing it:
> 
>            SBDebugger debugger = SBDebugger::Create();
>            char* val[3] = { "api", "all", NULL };
>            debugger.EnableLog("lldb", (const char**)val);
>            debugger.SetLoggingCallback(log_cb, NULL);
> 
> The only this I get out is this line when I improperly kill the application:
> 
>           Went to stop the private state thread, but it was already
> invalid.Went to stop the private state thread, but it was already
> invalid.
> 
> Thanks,
> Mike.
> 
> On Mon, Sep 22, 2014 at 2:01 PM, Greg Clayton <gclayton at apple.com> wrote:
>> (lldb) log enable lldb api
>> 
>> The "lldb" is the log channel and "api" is one of many log categories available in the "lldb" channel.
>> 
>> To see all of the channels and their respective categories you can do:
>> 
>> (lldb) log list
>> 
>> Through the API you can do:
>> 
>> debugger.EnableLog("lldb", ["api"])
>> 
>> 
>>> On Sep 20, 2014, at 3:05 PM, Mikhail Sosonkin <mike at nanotick.net> wrote:
>>> 
>>> Hello Developers,
>>> 
>>> I'm trying to use the LLDB API for some experimentation. It seems that
>>> there are a lot of functions that contain logging statements such as
>>> this:
>>> 
>>> SBProcess
>>> SBTarget::Launch (SBLaunchInfo &sb_launch_info, SBError& error)
>>> {
>>>   Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
>>> 
>>>   SBProcess sb_process;
>>>   TargetSP target_sp(GetSP());
>>> 
>>>   if (log)
>>>       log->Printf ("SBTarget(%p)::Launch (launch_info, error)...",
>>>                    static_cast<void*>(target_sp.get()));
>>> 
>>> I'd like to enable them. So far, I've not been able to find anything
>>> in API/* that would let me do that. SBDebugger::EnableLog didn't help.
>>> 
>>> Would you point me in the right direction, please?
>>> 
>>> Thanks,
>>> Mike.
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> 




More information about the lldb-dev mailing list