[Lldb-commits] [lldb] 785df61 - [lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces.

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 19 01:30:37 PST 2020


Author: Raphael Isemann
Date: 2020-02-19T10:30:11+01:00
New Revision: 785df616807fde4f13738f2fafd978de8202fb12

URL: https://github.com/llvm/llvm-project/commit/785df616807fde4f13738f2fafd978de8202fb12
DIFF: https://github.com/llvm/llvm-project/commit/785df616807fde4f13738f2fafd978de8202fb12.diff

LOG: [lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces.

Summary:
Currently when printing data types we include implicit scopes such as inline namespaces or anonymous namespaces.
This leads to command output like this (for `std::set<X>` with X being in an anonymous namespace):

```
(lldb) print my_set
(std::__1::set<(anonymous namespace)::X, std::__1::less<(anonymous namespace)::X>, std::__1::allocator<(anonymous namespace)::X> >) $0 = size=0 {}
```

This patch removes all the implicit scopes when printing type names in TypeSystemClang::GetDisplayTypeName
so that our output now looks like this:

```
(lldb) print my_set
(std::set<X, std::less<X>, std::allocator<X> >) $0 = size=0 {}
```

As previously GetDisplayTypeName and GetTypeName had the same output we actually often used the
two as if they are the same method (they were in fact using the same implementation), so this patch also
fixes the places where we actually want the display type name and not the actual type name.

Note that this doesn't touch the `GetTypeName` class that for example the data formatters use, so this patch
is only changes the way we display types to the user. The full type name can also still be found when passing
'-R' to see the raw output of a variable in case someone is somehow interested in that.

Partly fixes rdar://problem/59292534

Reviewers: shafik, jingham

Reviewed By: shafik

Subscribers: christof, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74478

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py
    lldb/source/DataFormatters/FormatManager.cpp
    lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
    lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py
    lldb/test/API/commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py
    lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 784d6ecd2ddf..0d1372497ef5 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2406,7 +2406,7 @@ def expect_expr(
                 "Unexpected failure with msg: " + eval_result.GetError().GetCString())
 
         if result_type:
-            self.assertEqual(result_type, eval_result.GetTypeName())
+            self.assertEqual(result_type, eval_result.GetDisplayTypeName())
 
         if result_value:
             self.assertEqual(result_value, eval_result.GetValue())

diff  --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 23ad6c67f887..cce893477d3b 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -193,7 +193,7 @@ void FormatManager::GetPossibleMatches(
     entries.push_back(
         {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
 
-    ConstString display_type_name(compiler_type.GetDisplayTypeName());
+    ConstString display_type_name(compiler_type.GetTypeName());
     if (display_type_name != type_name)
       entries.push_back({display_type_name, reason, did_strip_ptr,
                          did_strip_ref, did_strip_typedef});

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
index da2e916a5b9b..951bf2896fb0 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
@@ -159,7 +159,7 @@ bool LibcxxVariantSummaryProvider(ValueObject &valobj, Stream &stream,
   if (!template_type)
     return false;
 
-  stream.Printf(" Active Type = %s ", template_type.GetTypeName().GetCString());
+  stream << " Active Type = " << template_type.GetDisplayTypeName() << " ";
 
   return true;
 }

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 4092dc6ff78f..845318471fa1 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -3514,6 +3514,19 @@ ConstString TypeSystemClang::GetTypeName(lldb::opaque_compiler_type_t type) {
   return ConstString(qual_type.getAsString(printing_policy));
 }
 
+ConstString
+TypeSystemClang::GetDisplayTypeName(lldb::opaque_compiler_type_t type) {
+  if (!type)
+    return ConstString();
+
+  clang::QualType qual_type(GetQualType(type));
+  clang::PrintingPolicy printing_policy(getASTContext().getPrintingPolicy());
+  printing_policy.SuppressTagKeyword = true;
+  printing_policy.SuppressScope = false;
+  printing_policy.SuppressUnwrittenScope = true;
+  return ConstString(qual_type.getAsString(printing_policy));
+}
+
 uint32_t
 TypeSystemClang::GetTypeInfo(lldb::opaque_compiler_type_t type,
                              CompilerType *pointee_or_element_clang_type) {

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 2fd12c81c133..8864c601c5dc 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -597,9 +597,7 @@ class TypeSystemClang : public TypeSystem {
 
   ConstString GetTypeName(lldb::opaque_compiler_type_t type) override;
 
-  ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) override {
-    return GetTypeName(type);
-  }
+  ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) override;
 
   uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type,
                        CompilerType *pointee_or_element_compiler_type) override;

diff  --git a/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py b/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py
index 17d82957fa0b..1484dd25e84c 100644
--- a/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py
@@ -25,7 +25,7 @@ def test(self):
         self.expect_expr("std::abs(-42)", result_type="int", result_value="42")
         self.expect_expr("std::div(2, 1).quot", result_type="int", result_value="2")
         # Using types from std.
-        self.expect_expr("(std::size_t)33U", result_type="size_t", result_value="33")
+        self.expect_expr("(std::size_t)33U", result_type="std::size_t", result_value="33")
         # Calling templated functions that return non-template types.
         self.expect_expr("char char_a = 'b'; char char_b = 'a'; std::swap(char_a, char_b); char_a",
                     result_type="char", result_value="'a'")

diff  --git a/lldb/test/API/commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py b/lldb/test/API/commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
index 67313a77ce02..6b817c882ad8 100644
--- a/lldb/test/API/commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
+++ b/lldb/test/API/commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
@@ -27,6 +27,6 @@ def test(self):
         self.runCmd("settings set target.import-std-module true")
         self.expect_expr("std::abs(-42)", result_type="int", result_value="42")
         self.expect_expr("std::div(2, 1).quot", result_type="int", result_value="2")
-        self.expect_expr("(std::size_t)33U", result_type="size_t", result_value="33")
+        self.expect_expr("(std::size_t)33U", result_type="std::size_t", result_value="33")
         self.expect("expr char char_a = 'b'; char char_b = 'a'; std::swap(char_a, char_b); char_a",
                     substrs=["(char) $3 = 'a'"])

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py
index a9983dd045e9..efbc4c538798 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py
@@ -17,8 +17,7 @@ class TestDataFormatterLibcxxForwardList(TestBase):
     def setUp(self):
         TestBase.setUp(self)
         self.line = line_number('main.cpp', '// break here')
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 2ff3d63d004d..9081edc2bfc6 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -19,8 +19,7 @@ def setUp(self):
         TestBase.setUp(self)
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test_with_run_command(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index 5cd6e45bf8a1..bd7962f2f54d 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -17,7 +17,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
     def setUp(self):
         TestBase.setUp(self)
         ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test_with_run_command(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index 022a46bdd285..3fd25752da5a 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -17,8 +17,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
 
     def setUp(self):
         TestBase.setUp(self)
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test_with_run_command(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index 021307eb781c..591e536a3ca4 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -16,13 +16,12 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
 
     def setUp(self):
         TestBase.setUp(self)
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     def getVariableType(self, name):
         var = self.frame().FindVariable(name)
         self.assertTrue(var.IsValid())
-        return var.GetType().GetCanonicalType().GetName()
+        return var.GetType().GetDisplayTypeName()
 
     def check_ii(self, var_name):
         """ This checks the value of the bitset stored in ii at the call to by_ref_and_ptr.

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
index dd3d8be4ae91..6813b6eca395 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
@@ -1,9 +1,6 @@
 #include <string>
 #include <set>
 
-typedef std::multiset<int> intset;
-typedef std::multiset<std::string> stringset;
-
 int g_the_foo = 0;
 
 int thefoo_rw(int arg = 1)
@@ -16,7 +13,7 @@ int thefoo_rw(int arg = 1)
 	return g_the_foo;
 }
 
-void by_ref_and_ptr(intset &ref, intset *ptr)
+void by_ref_and_ptr(std::multiset<int> &ref, std::multiset<int> *ptr)
 {
     // Stop here to check by ref and ptr
     return;
@@ -24,7 +21,7 @@ void by_ref_and_ptr(intset &ref, intset *ptr)
 
 int main()
 {
-    intset ii;
+    std::multiset<int> ii;
     thefoo_rw(1);  // Set break point at this line.
 	
 	ii.insert(0);
@@ -43,7 +40,7 @@ int main()
 	ii.clear();
 	thefoo_rw(1);  // Set break point at this line.
 
-	stringset ss;
+	std::multiset<std::string> ss;
 	thefoo_rw(1);  // Set break point at this line.
 
 	ss.insert("a");

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
index b163fa56fae5..f2f9f670c714 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
@@ -16,15 +16,14 @@ class TestDataFormatterLibcxxQueue(TestBase):
 
     def setUp(self):
         TestBase.setUp(self)
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     def check_variable(self, name):
         var = self.frame().FindVariable(name)
         self.assertTrue(var.IsValid())
 
         queue = self.namespace + '::queue'
-        self.assertTrue(queue in var.GetTypeName())
+        self.assertTrue(queue in var.GetDisplayTypeName())
         self.assertEqual(var.GetNumChildren(), 5)
         for i in range(5):
             ch = var.GetChildAtIndex(i)

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index e3827bbb632c..d77110311bb1 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -16,13 +16,12 @@ class LibcxxSetDataFormatterTestCase(TestBase):
 
     def setUp(self):
         TestBase.setUp(self)
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     def getVariableType(self, name):
         var = self.frame().FindVariable(name)
         self.assertTrue(var.IsValid())
-        return var.GetType().GetCanonicalType().GetName()
+        return var.GetType().GetDisplayTypeName()
 
     def check_ii(self, var_name):
         """ This checks the value of the bitset stored in ii at the call to by_ref_and_ptr.

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
index df39e9746c03..1d48f9b9ad1a 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
@@ -1,9 +1,6 @@
 #include <string>
 #include <set>
 
-typedef std::set<int> intset;
-typedef std::set<std::string> stringset;
-
 int g_the_foo = 0;
 
 int thefoo_rw(int arg = 1)
@@ -16,7 +13,7 @@ int thefoo_rw(int arg = 1)
 	return g_the_foo;
 }
 
-void by_ref_and_ptr(intset &ref, intset *ptr)
+void by_ref_and_ptr(std::set<int> &ref, std::set<int> *ptr)
 {
     // Stop here to check by ref and ptr
     return;
@@ -24,7 +21,7 @@ void by_ref_and_ptr(intset &ref, intset *ptr)
 
 int main()
 {
-    intset ii;
+    std::set<int> ii;
     thefoo_rw(1);  // Set break point at this line.
 	
 	ii.insert(0);
@@ -43,7 +40,7 @@ int main()
 	ii.clear();
 	thefoo_rw(1);  // Set break point at this line.
 
-	stringset ss;
+	std::set<std::string> ss;
 	thefoo_rw(1);  // Set break point at this line.
 
 	ss.insert("a");

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index f04ec6d402b3..3753067113b1 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -20,8 +20,7 @@ def setUp(self):
         TestBase.setUp(self)
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     @expectedFailureAll(bugnumber="llvm.org/pr36109", debug_info="gmodules", triple=".*-android")

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
index 57b777837165..171f9a8e5c07 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
@@ -17,8 +17,7 @@ class TestDataFormatterLibcxxTuple(TestBase):
     def setUp(self):
         TestBase.setUp(self)
         self.line = line_number('main.cpp', '// break here')
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index 9566af031309..3519daec6ec4 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -16,8 +16,7 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
 
     def setUp(self):
         TestBase.setUp(self)
-        ns = 'ndk' if lldbplatformutil.target_is_android() else ''
-        self.namespace = 'std::__' + ns + '1'
+        self.namespace = 'std'
 
     @add_test_categories(["libc++"])
     def test_with_run_command(self):

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py
index a2a6b74faa41..cea4fd6bf1c3 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.py
@@ -51,7 +51,7 @@ def test_with_run_command(self):
                                '}'])
 
         self.expect("frame variable v_v1",
-                substrs=['v_v1 =  Active Type = std::__1::variant<int, double, char>  {',
+                substrs=['v_v1 =  Active Type = std::variant<int, double, char>  {',
                                  'Value =  Active Type = int  {',
                                    'Value = 12',
                                  '}',

diff  --git a/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp
index 9d4ac139f592..c4d50433a3b5 100644
--- a/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp
+++ b/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp
@@ -102,9 +102,9 @@ Anonymous<A::B::C<void>>::D AnonABCVoidD;
 // CHECK: (A::C<-1>::D) ACNeg1D = (ACDMember = 0, CPtr = 0x{{0+}})
 // CHECK: (A::D) AD = {}
 // CHECK: (A::D::E) ADE = (ADDMember = 0)
-// CHECK: ((anonymous namespace)::Anonymous<int>) AnonInt = (AnonymousMember = 0)
-// CHECK: ((anonymous namespace)::Anonymous<A::B::C<void>>) AnonABCVoid = (AnonymousMember = 0)
-// CHECK: ((anonymous namespace)::Anonymous<A::B::C<void>>::D) AnonABCVoidD = (AnonymousDMember = 0)
+// CHECK: (Anonymous<int>) AnonInt = (AnonymousMember = 0)
+// CHECK: (Anonymous<A::B::C<void>>) AnonABCVoid = (AnonymousMember = 0)
+// CHECK: (Anonymous<A::B::C<void>>::D) AnonABCVoidD = (AnonymousDMember = 0)
 // CHECK: Dumping clang ast for 1 modules.
 // CHECK: TranslationUnitDecl {{.*}}
 // CHECK: |-CXXRecordDecl {{.*}} class TrivialC definition


        


More information about the lldb-commits mailing list