[libcxx-commits] [PATCH] D56913: decoupling Freestanding atomic<T> from libatomic.a

Jim Ingham via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 4 12:41:00 PST 2019


lldb data formatters can be written using the lldb SB API's from either Python or from C++, and lldb can load both Python modules defining data formatters or shared libraries ditto.  One of the reasons we structured the data formatters the way we did was just so that library authors could support their own formatters.  Somehow, however, most library authors have been content for us to do the work for them ;-)  But if the libc++ maintainers wanted to take over maintaining the lldb data formatters for C++, there's nothing technical stopping them from doing so.  The SB API's are lldb's stable API's so data formatters written this way will work across a wide range of lldb versions.  We'd have to figure out packaging issues and the like, but if there's interest on your end this should be doable (*).

BTW, another suggestion that has been floated is to come up with a debugger independent representation of the "important bits" of a class from which debuggers could synthesize a data formatter.  I'm not sure how easy it would be to come up with a rich enough description but up-sides would be that multiple debuggers could then support the rich view of the class, and the specification could live in the headers themselves, so distribution wouldn't be a problem.  This idea does seem like a bigger project...

(*) Note, for reasons of expediency the current C++ data formatters are written using the lldb_private API's, which are not for external use.  That was in hindsight an unfortunate choice, it does mean the formatters would have to be rewritten from their current form to live separately from lldb.

Jim

> On Mar 4, 2019, at 12:04 PM, Louis Dionne via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> ldionne added a comment.
> 
> In D56913#1417198 <https://reviews.llvm.org/D56913#1417198>, @davide wrote:
> 
>> In D56913#1417184 <https://reviews.llvm.org/D56913#1417184>, @__simt__ wrote:
>> 
>>> In D56913#1417172 <https://reviews.llvm.org/D56913#1417172>, @davide wrote:
>>> 
>>>> This commit broke the atomic lldb data formatter.
>>>> 
>>>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/21037/
>>>> 
>>>> @shafik @jingham
>>> 
>>> 
>>> It looks like LLDB is naming internal names here. Unfortunately, it now needs to learn the new names. On the plus side, there is now a single stable internal name for all compilation paths for this header, whereas it used to differ. So the final result ought to be seen as an improvement.
>> 
>> 
>> Nobody disagrees but the formatter has to be fixed, hence the two people cc:ed.
> 
> 
> Sorry -- I should have run the tests for the LLDB formatters. This is not the first time it happens.
> 
> However, seeing how error-prone it is to change something in libc++ without running the LLDB tests, would it make sense to test the data formatters as part of libc++ itself? One way to see the data formatters is as something that libc++ provides to work nicely with LLDB instead of as something LLDB tries to provide for libc++. When seen that way, it makes more sense that the data formatters use private parts of libc++, and the tests should be part of libc++'s test suite. I don't know how big of a change this is, but I'd encourage LLDB folks to consider this as this would reduce a cause of semi-frequent mistakes.
> 
> 
> Repository:
>  rL LLVM
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D56913/new/
> 
> https://reviews.llvm.org/D56913
> 
> 
> 



More information about the libcxx-commits mailing list