Skip to content

Commit 1539c54

Browse files
Sterling-Augustinetstellar
authored andcommitted
Don't fail the shared_ptr test if libc++ has insufficient debug info.
Don't fail the shared_ptr test if libc++ has insufficient debug info. This addresses https://bugs.llvm.org/show_bug.cgi?id=48937 Differential Revision: https://reviews.llvm.org/D100610 (cherry picked from commit 0e83780)
1 parent bf25180 commit 1539c54

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ def invoke(self, arg, from_tty):
3737
compare_frame = gdb.newest_frame().older()
3838
testcase_frame = compare_frame.older()
3939
test_loc = testcase_frame.find_sal()
40+
41+
expectation_val = compare_frame.read_var("expectation")
42+
check_literal = expectation_val.string(encoding="utf-8")
43+
44+
# Heuristic to determine if libc++ itself has debug
45+
# info. If it doesn't, then anything normally homed there
46+
# won't be found, and the printer will error. We don't
47+
# want to fail the test in this case--the printer itself
48+
# is probably fine, or at least we can't tell.
49+
if check_literal.startswith("std::shared_ptr"):
50+
shared_ptr = compare_frame.read_var("value")
51+
if not "__shared_owners_" in shared_ptr.type.fields():
52+
print("IGNORED (no debug info in libc++): " +
53+
test_loc.symtab.filename + ":" +
54+
str(test_loc.line))
55+
return
56+
4057
# Use interactive commands in the correct context to get the pretty
4158
# printed version
4259

0 commit comments

Comments
 (0)