[Lldb-commits] [lldb] [lldb] Support PtrAuth in the expression evaluator (PR #186001)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 12 03:30:36 PDT 2026


================
@@ -0,0 +1,182 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 "InjectPointerSigningFixups.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/TargetParser/Triple.h"
+
+using namespace llvm;
+
+namespace {
+
+struct PtrAuthFixup {
+  GlobalVariable *GV;
+  ConstantPtrAuth *CPA;
+  SmallVector<unsigned, 4> Indices;
+};
+
+/// Recursively walk a constant looking for ConstantPtrAuth expressions.
+/// When found, record the global variable containing it and the index path
+/// to reach it within the initializer.
+void findPtrAuth(Constant *C, GlobalVariable &GV,
+                 SmallVector<unsigned, 4> &Indices,
----------------
DavidSpickett wrote:

ISTR there is a way for this to take SmallVector<unsigned> and not have to write the size hint. If not, doesn't actually matter here.

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


More information about the lldb-commits mailing list