[lldb-dev] logging in lldb

Chris Bieneman via lldb-dev lldb-dev at lists.llvm.org
Tue Dec 6 09:43:10 PST 2016


> On Dec 6, 2016, at 9:32 AM, Pavel Labath <labath at google.com> wrote:
> 
> Ah, I totally forgot about the llvm DEBUG macro. I would be open to
> trying merge these two approaches together. However, I think our's is
> a much more heavy-weight system, so it might be too heavy for llvm,
> and I am not sure how much would we be willing to lose in the process:
> - we have two level logging architecture ("process" category in "lldb" channel)

This might not map to LLVM, but it might be worth looking into.

> - logging can be enabled/disabled at runtime

This actually should be doable in LLVM. Since the LLVM DEBUG macro controls the -debug=... flag, I can't immediately see a reason why that wouldn't work for runtime toggling.

> - logs can be redirected to various destinations

The LLVM logging uses streams, so I don't think this is really different. You just change the stream under it.

-Chris

> 
> Maybe it will be possible to design it in a way that the complexity is
> apparent to those who wish to use it. I'll need to think about that...
> 
> pl
> 
> 
> On 6 December 2016 at 17:06, Chris Bieneman <beanz at apple.com> wrote:
>> My only concern reading this is that LLVM already has a similar mechanism for channel-based logging that is used throughout the backends. Is there a reason to invent our own? Maybe we can take what is in LLVM, enhance it and use shared functionality?
>> 
>> There are a few differences between your solution and the LLVM one, but I'm not sure they are sufficient to justify creating a new solution.
>> 
>> The LLVM debug logging solution is documented in the LLVM Programmers Manual here:
>> http://llvm.org/docs/ProgrammersManual.html#the-debug-macro-and-debug-option
>> 
>> -Chris
>> 
>>> On Dec 6, 2016, at 8:57 AM, Pavel Labath <labath at google.com> wrote:
>>> 
>>> On 6 December 2016 at 16:51, Jim Ingham <jingham at apple.com> wrote:
>>>> Sorry, I'm being dense.  What is Dxxxxx?
>>>> 
>>>> Jim
>>>> 
>>>>> On Dec 6, 2016, at 8:23 AM, Pavel Labath <labath at google.com> wrote:
>>>>> 
>>>>> I have created straw-man implementation of such an interface in
>>>>> Dxxxxx, together with some examples of how it's used, and I'd like to
>>>> 
>>> 
>>> https://reviews.llvm.org/D27459 :D
>>> 
>>> Sorry, I forgot to replace this by actual revision when I submitted the code.
>>> 
>>> pl
>> 



More information about the lldb-dev mailing list