Improve materializer error messages to include type names.
authorAdrian Prantl <aprantl@apple.com>
Sat, 12 Jun 2021 00:58:05 +0000 (17:58 -0700)
committerAdrian Prantl <aprantl@apple.com>
Sat, 12 Jun 2021 00:59:00 +0000 (17:59 -0700)
rdar://79201552

lldb/source/Expression/Materializer.cpp

index a93c127dd0d08ebb5c9bfc8d6b017e7edd842a84..3945f3a70f7569ff61f6dd5c320c1217a49c1ebf 100644 (file)
@@ -794,13 +794,15 @@ public:
 
       llvm::Optional<uint64_t> byte_size = m_type.GetByteSize(exe_scope);
       if (!byte_size) {
-        err.SetErrorString("can't get size of type");
+        err.SetErrorStringWithFormat("can't get size of type \"%s\"",
+                                     m_type.GetTypeName().AsCString());
         return;
       }
 
       llvm::Optional<size_t> opt_bit_align = m_type.GetTypeBitAlign(exe_scope);
       if (!opt_bit_align) {
-        err.SetErrorString("can't get the type alignment");
+        err.SetErrorStringWithFormat("can't get the alignment of type  \"%s\"",
+                                     m_type.GetTypeName().AsCString());
         return;
       }