[compiler-rt] [sanitizer_common] Implement address sanitizer on AIX: stack unwinding (6/n) (PR #138188)

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 13:29:20 PDT 2025


================
@@ -0,0 +1,66 @@
+//===-- sanitizer_unwind_aix.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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the unwind.h-based (aka "slow") stack unwinding routines
+// available to the tools on AIX.
+//===----------------------------------------------------------------------===//
+
+#include "sanitizer_platform.h"
+
+#if SANITIZER_AIX
+#  include <unwind.h>
+
+#  include "sanitizer_common.h"
+#  include "sanitizer_stacktrace.h"
+
+namespace __sanitizer {
+
+struct UnwindTraceArg {
+  BufferedStackTrace *stack;
+  u32 max_depth;
+};
+
+_Unwind_Reason_Code Unwind_Trace(struct _Unwind_Context *ctx, void *param) {
----------------
hubert-reinterpretcast wrote:

I think this function can be static?

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


More information about the llvm-commits mailing list