[Lldb-commits] [lldb] [LLDB] Add formatters for MSVC STL std::shared_ptr (PR #147575)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 9 06:51:42 PDT 2025


================
@@ -0,0 +1,170 @@
+//===-- MsvcStlSmartPointer.cpp -------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Generic.h"
+#include "MsvcStl.h"
+
+#include "lldb/DataFormatters/FormattersHelpers.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
+
+using namespace lldb;
+
+bool lldb_private::formatters::IsMsvcStlSmartPointer(ValueObject &valobj) {
+  std::vector<uint32_t> indexes;
+  return valobj.GetCompilerType().GetIndexOfChildMemberWithName("_Ptr", true,
+                                                                indexes) > 0;
----------------
Michael137 wrote:

```suggestion
  return valobj.GetChildMemberWithName("_Ptr") != nullptr;
```
?

https://github.com/llvm/llvm-project/pull/147575


More information about the lldb-commits mailing list