This is an archive of the discontinued LLVM Phabricator instance.

Fix failing tests caused by lack of default debug info
ClosedPublic

Authored by vharron on Feb 27 2015, 11:30 AM.

Details

Summary

Linux clang 3.5+ doesn't have full debug info by default. This
change ensures that there is enough debug info for the tests to pass.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

Also modified expectedFailureClang to accept compiler version like
expectedFailureGcc

Diff Detail

Event Timeline

vharron updated this revision to Diff 20872.Feb 27 2015, 11:30 AM
vharron retitled this revision from to Fix failing tests caused by lack of default debug info.
vharron updated this object.
vharron edited the test plan for this revision. (Show Details)
vharron added reviewers: clayborg, ovyalov, sivachandra.
vharron added a subscriber: Unknown Object (MLST).
rnk added a subscriber: rnk.Feb 27 2015, 11:42 AM

It seems reasonable to tweak the tests to keep them green, but eventually we need to resolve this in LLDB.

sivachandra accepted this revision.Feb 27 2015, 12:47 PM
sivachandra edited edge metadata.

LGTM.

What I would really love to see is more descriptive commit message headers which are not one-line monsters. Most definitely up to you, but how about

"Use -fstandalone-debug for few tests to get around a Clang optimization."

test/lldbtest.py
560

Up to you, but this should probably be a different change, in line with my subject line suggestion.

This revision is now accepted and ready to land.Feb 27 2015, 12:47 PM

With reference to rnk's comment: "... but eventually we need to resolve this in LLDB"

All that I see in the DWARF generated by clang-3.5 is this:

< 2><0x00000037> DW_TAG_class_type

DW_AT_name                  "basic_string<char, std::char_traits<char>, std::allocator<char> >"
DW_AT_declaration           yes(1)

In which case, what can LLDB do?

They've suggested using the debug info from the libstdc++'s symbol file.

clayborg accepted this revision.Feb 27 2015, 1:19 PM
clayborg edited edge metadata.

Looks good, but we should document this with a more descriptive comments.

vharron closed this revision.Feb 27 2015, 5:21 PM

Committed r230831

Per Greg's request, updated comments as follows: (please let me known if this isn't what you had in mind)

+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+# targets. Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+ CFLAGS_EXTRAS := -fstandalone-debug
+endif

Commit comment (Siva's request)

Use -fstandalone-debug for few tests to get around a Clang optimization

clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail. This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

Thanks for changing the commit message.