[Lldb-commits] [PATCH] D29615: Convert Log class to llvm streams

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 6 19:23:51 PST 2017


> On Feb 6, 2017, at 7:19 PM, Pavel Labath via Phabricator via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> labath added a comment.
> 
> The log callback gets passed down from the SB API (in the SBDebugger constructor, no less). My best guess is that it is (was?) used to display the debugger log in some IDE window.

That's a pretty good guess.  It is used so that the logs from Xcode and the logs from lldb get interleaved and written to one place.  It's quite handy in some circumstances to see Xcode say "I was trying to do X" then lldb say "I was told to do X and did it this way."  Plus it means there's an easy way to funnel the whole log to one place.

It has to get passed in when you construct the debugger otherwise you stand to lose some log information.  We don't put it in a window, there's not much information in there that an ordinary user could understand, it would just be noise.  But we do tell people to generate appropriate logs and send them to us.

Jim


> 
> 
> 
> ================
> Comment at: source/Core/StreamCallback.cpp:22
> StreamCallback::StreamCallback(lldb::LogOutputCallback callback, void *baton)
> -    : Stream(0, 4, eByteOrderBig), m_callback(callback), m_baton(baton),
> -      m_accumulated_data(), m_collection_mutex() {}
> ----------------
> zturner wrote:
>> I find it rather odd that this was hardcoding big endian.  Was the endianness here important for some reason?
> I think that was there just because you needed to specify some value. As we were always printing strings, it did not matter anyway.
> 
> 
> https://reviews.llvm.org/D29615
> 
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list