[Lldb-commits] [lldb] [llvm] [lldb] Add initial MicrosoftABIRuntime (PR #235090)

via lldb-commits lldb-commits at lists.llvm.org
Sat Oct 31 14:33:51 PDT 2026


================
@@ -0,0 +1,426 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 "MicrosoftABIRuntime.h"
+
+#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "clang/AST/RecordLayout.h"
+
+#include <deque>
+#include <mutex>
+
+using namespace lldb;
+using namespace lldb_private;
+
+static const llvm::StringRef s_vtable_demangled_indicator = "::`vftable'";
+static const llvm::StringRef s_rtti_complete_object_locator_indicator =
+    "::`RTTI Complete Object Locator'";
+
+static llvm::StringRef StripDemangledVTableSuffix(llvm::StringRef demangled) {
+  llvm::StringRef name = demangled.split(s_vtable_demangled_indicator).first;
+  name.consume_front("const ");
+  return name;
+}
+
+static bool
+SplitVTableComponents(llvm::StringRef demangled,
+                      llvm::SmallVectorImpl<llvm::StringRef> &components) {
+  llvm::StringRef suffix = demangled.split(s_vtable_demangled_indicator).second;
+  if (suffix.empty())
+    return true; // e.g. MyClass::`vftable'
+
+  // Otherwise, suffix looks like "{for `MyBase2's `MyBase1'}" or
+  // "{for `MyBase'}".
+  if (!suffix.consume_front("{for `") || !suffix.consume_back("'}"))
+    return false;
+
+  suffix.split(components, "'s `");
+  return true;
+}
+
+MicrosoftABIRuntime::MicrosoftABIRuntime(Process *process)
+    : CommonABIRuntime(process) {}
+
+bool MicrosoftABIRuntime::GetDynamicTypeAndAddress(
+    ValueObject &in_value, lldb::DynamicValueType use_dynamic,
+    const LanguageRuntime::VTableInfo &vtable_info,
+    TypeAndOrName &class_type_or_name, Address &dynamic_address) {
+  std::optional<size_t> offset_to_top =
----------------
Nerixyz wrote:

Oops, yea, fixed that.

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


More information about the lldb-commits mailing list