[llvm] [z/OS] Add backtrace support for z/OS. (PR #121826)

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 07:08:56 PST 2025


================
@@ -708,13 +712,89 @@ static int unwindBacktrace(void **StackTrace, int MaxEntries) {
 }
 #endif
 
+#if ENABLE_BACKTRACES && defined(__MVS__)
+void zosbacktrace(raw_ostream &OS) {
+  // A function name in the PPA1 can have length 16k.
+  constexpr size_t MAX_ENTRY_NAME = UINT16_MAX;
+  // Limit all other strings to 8 byte.
+  constexpr size_t MAX_OTHER = 8;
+  void *dsaptr;            // Input
+  int32_t dsa_format = -1; // Input/Output
+  void *caaptr = _gtca();  // Input
+  int32_t member_id;
+  char compile_unit_name[MAX_OTHER];
+  int32_t compile_unit_name_length = sizeof(compile_unit_name); // Input/Output
+  void *compile_unit_address;                                   // Output
+  void *call_instruction_address = 0;                           // Input/Output
----------------
redstar wrote:

Changed, thanks.

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


More information about the llvm-commits mailing list