This is an archive of the discontinued LLVM Phabricator instance.

Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
ClosedPublic

Authored by tfiala on Oct 21 2015, 4:29 PM.

Details

Reviewers
granata.enrico
Summary

This change fixes data formatters for libstdc++ 6.0.21:

  • Adds std::string data formatter support in C++ (rather than Python) for 6.0.21+.
  • Uses std::list count field support when present.
  • Fixes std container and std::string failing tests on Ubuntu 15.10 x86_64.
  • Fixes what looks like a broken compilation on TOT which assumes libc++ is used but doesn't guarantee it, then uses libc++ details, which breaks when compiling with libstdc++. (The test would later figure it out, but only after the failing build step). Modified the using of libc++ to define a LLDB_USING_LIBCPP flag when we're really compiling with it, and conditionally compile the libc++-specific code so it doesn't break when built with libstdc++.

Anybody on the Linux/BSD side, feel free to review.

This has been tested on Ubuntu 14.04 x86_64 (with libstdc++ 6.0.20) and Ubuntu 15.10 x86_64 (with libstdc++ 6.0.21). Both built using clang-3.6 and using clang-3.6 inferiors.

Diff Detail

Event Timeline

tfiala updated this revision to Diff 38063.Oct 21 2015, 4:29 PM
tfiala retitled this revision from to Fix libstdc++ data formatters on Ubuntu 15.10 x86_64.
tfiala updated this object.
tfiala added a reviewer: granata.enrico.
tfiala added a subscriber: lldb-commits.
granata.enrico accepted this revision.Oct 21 2015, 4:59 PM
granata.enrico edited edge metadata.

Looks good to me

This revision is now accepted and ready to land.Oct 21 2015, 4:59 PM
labath added a subscriber: labath.Oct 22 2015, 2:04 AM
labath added inline comments.
test/make/Makefile.rules
304

Thanks for fixing the build.

When I get libc++ detection and skipping logic centralized, I'd like to remove this magic and make self.build() fail with a hard error in the case when the Makefile requests libc++ use, but the library is not present. The skipping logic should fire before self.build(), but it we still end up attempting to build, then that's something we should know about.

How does that sound?

Yeah, if you can make that happen, that sounds good to me. This is a "if you have libc++, please build with it, otherwise skip this test"-kinda test... :-)

tfiala closed this revision.Oct 22 2015, 8:14 AM

Forgot to mark this as closed:

Closed by commit:

------------------------------------------------------------------------
r250965 | tfiala | 2015-10-21 17:23:38 -0700 (Wed, 21 Oct 2015) | 4 lines

Fix libstdc++ data formatters on Ubuntu 15.10 x86_64

Also, I forgot to mention that I only added the string formatter support for remote host (i.e. lldb-server/debugserver) connections. For those systems using in-host attaching (I think *BSD), the string formatter will not display with host memory content. It would be a smallish fix, but since I don't have a system to test that on, I didn't want to implement that. The string formatter should fall back to printing the raw content in that case.