https://github.com/charles-zablit updated 
https://github.com/llvm/llvm-project/pull/135963

>From 6dd67fe4ad03f0ec0623717715b8cfcc9537ab3f Mon Sep 17 00:00:00 2001
From: Charles Zablit <zablitchar...@gmail.com>
Date: Wed, 16 Apr 2025 11:28:54 +0100
Subject: [PATCH 1/3] [lldb] Remove unused API
 CompilerType::GetIndexOfFieldWithName

---
 lldb/include/lldb/Symbol/CompilerType.h       |  6 ------
 lldb/source/Symbol/CompilerType.cpp           | 19 -----------------
 .../Platform/PlatformSiginfoTest.cpp          | 21 -------------------
 3 files changed, 46 deletions(-)

diff --git a/lldb/include/lldb/Symbol/CompilerType.h 
b/lldb/include/lldb/Symbol/CompilerType.h
index 41a1676dabd76..3561bc70887e6 100644
--- a/lldb/include/lldb/Symbol/CompilerType.h
+++ b/lldb/include/lldb/Symbol/CompilerType.h
@@ -433,12 +433,6 @@ class CompilerType {
 
   CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const;
 
-  uint32_t GetIndexOfFieldWithName(const char *name,
-                                   CompilerType *field_compiler_type = nullptr,
-                                   uint64_t *bit_offset_ptr = nullptr,
-                                   uint32_t *bitfield_bit_size_ptr = nullptr,
-                                   bool *is_bitfield_ptr = nullptr) const;
-
   llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
       ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
       bool omit_empty_base_classes, bool ignore_array_bounds,
diff --git a/lldb/source/Symbol/CompilerType.cpp 
b/lldb/source/Symbol/CompilerType.cpp
index 22fdd24fc7cd5..8e89d006d08d3 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -893,25 +893,6 @@ CompilerDecl 
CompilerType::GetStaticFieldWithName(llvm::StringRef name) const {
   return CompilerDecl();
 }
 
-uint32_t CompilerType::GetIndexOfFieldWithName(
-    const char *name, CompilerType *field_compiler_type_ptr,
-    uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr,
-    bool *is_bitfield_ptr) const {
-  unsigned count = GetNumFields();
-  std::string field_name;
-  for (unsigned index = 0; index < count; index++) {
-    CompilerType field_compiler_type(
-        GetFieldAtIndex(index, field_name, bit_offset_ptr,
-                        bitfield_bit_size_ptr, is_bitfield_ptr));
-    if (strcmp(field_name.c_str(), name) == 0) {
-      if (field_compiler_type_ptr)
-        *field_compiler_type_ptr = field_compiler_type;
-      return index;
-    }
-  }
-  return UINT32_MAX;
-}
-
 llvm::Expected<CompilerType> CompilerType::GetChildCompilerTypeAtIndex(
     ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
     bool omit_empty_base_classes, bool ignore_array_bounds,
diff --git a/lldb/unittests/Platform/PlatformSiginfoTest.cpp 
b/lldb/unittests/Platform/PlatformSiginfoTest.cpp
index 4b2c93a68a94a..a1f55bdd926db 100644
--- a/lldb/unittests/Platform/PlatformSiginfoTest.cpp
+++ b/lldb/unittests/Platform/PlatformSiginfoTest.cpp
@@ -50,27 +50,6 @@ class PlatformSiginfoTest : public ::testing::Test {
 
   typedef std::tuple<const char *, uint64_t, uint64_t> field_tuple;
 
-  void ExpectField(const CompilerType &siginfo_type, field_tuple field) {
-    const char *path;
-    uint64_t offset, size;
-    std::tie(path, offset, size) = field;
-
-    SCOPED_TRACE(path);
-    CompilerType field_type = siginfo_type;
-    uint64_t total_offset = 0;
-    for (auto field_name : llvm::split(path, '.')) {
-      uint64_t bit_offset;
-      ASSERT_NE(field_type.GetIndexOfFieldWithName(field_name.str().c_str(),
-                                                   &field_type, &bit_offset),
-                UINT32_MAX);
-      total_offset += bit_offset;
-    }
-
-    EXPECT_EQ(total_offset, offset * 8);
-    EXPECT_EQ(llvm::expectedToOptional(field_type.GetByteSize(nullptr)),
-              std::optional<uint64_t>(size));
-  }
-
   void ExpectFields(const CompilerType &container,
                     std::initializer_list<field_tuple> fields) {
     for (auto x : fields)

>From 77faa748f436cd28ea95854296c476a1be04e5d3 Mon Sep 17 00:00:00 2001
From: Charles Zablit <zablitchar...@gmail.com>
Date: Wed, 16 Apr 2025 19:04:56 +0100
Subject: [PATCH 2/3] fixup! [lldb] Remove unused API
 CompilerType::GetIndexOfFieldWithName

---
 lldb/unittests/Platform/CMakeLists.txt        |   1 -
 .../Platform/PlatformSiginfoTest.cpp          | 288 ------------------
 2 files changed, 289 deletions(-)
 delete mode 100644 lldb/unittests/Platform/PlatformSiginfoTest.cpp

diff --git a/lldb/unittests/Platform/CMakeLists.txt 
b/lldb/unittests/Platform/CMakeLists.txt
index 5c0ef5ca6ef22..7d57f633d89c3 100644
--- a/lldb/unittests/Platform/CMakeLists.txt
+++ b/lldb/unittests/Platform/CMakeLists.txt
@@ -2,7 +2,6 @@ add_lldb_unittest(LLDBPlatformTests
   PlatformAppleSimulatorTest.cpp
   PlatformDarwinTest.cpp
   PlatformMacOSXTest.cpp
-  PlatformSiginfoTest.cpp
   PlatformTest.cpp
 
   LINK_LIBS
diff --git a/lldb/unittests/Platform/PlatformSiginfoTest.cpp 
b/lldb/unittests/Platform/PlatformSiginfoTest.cpp
deleted file mode 100644
index a1f55bdd926db..0000000000000
--- a/lldb/unittests/Platform/PlatformSiginfoTest.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-//===-- PlatformSiginfoTest.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 "gtest/gtest.h"
-
-#include <initializer_list>
-#include <optional>
-#include <tuple>
-
-#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
-#include "Plugins/Platform/Linux/PlatformLinux.h"
-#include "Plugins/Platform/NetBSD/PlatformNetBSD.h"
-#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
-
-#include "TestingSupport/SubsystemRAII.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Host/FileSystem.h"
-#include "lldb/Host/HostInfo.h"
-#include "lldb/Utility/ArchSpec.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-namespace {
-class PlatformSiginfoTest : public ::testing::Test {
-  SubsystemRAII<FileSystem, HostInfo, TypeSystemClang> subsystems;
-  PlatformSP platform_sp;
-  DebuggerSP debugger_sp;
-  TargetSP target_sp;
-
-public:
-  CompilerType siginfo_type;
-
-  void SetUp() override {
-    platform_freebsd::PlatformFreeBSD::Initialize();
-    platform_linux::PlatformLinux::Initialize();
-    platform_netbsd::PlatformNetBSD::Initialize();
-  }
-
-  void TearDown() override {
-    platform_netbsd::PlatformNetBSD::Terminate();
-    platform_linux::PlatformLinux::Terminate();
-    platform_freebsd::PlatformFreeBSD::Terminate();
-  }
-
-  typedef std::tuple<const char *, uint64_t, uint64_t> field_tuple;
-
-  void ExpectFields(const CompilerType &container,
-                    std::initializer_list<field_tuple> fields) {
-    for (auto x : fields)
-      ExpectField(container, x);
-  }
-
-  void InitializeSiginfo(const std::string &triple) {
-    ArchSpec arch(triple);
-
-    switch (arch.GetTriple().getOS()) {
-    case llvm::Triple::FreeBSD:
-      platform_sp =
-          platform_freebsd::PlatformFreeBSD::CreateInstance(true, &arch);
-      break;
-    case llvm::Triple::Linux:
-      platform_sp = platform_linux::PlatformLinux::CreateInstance(true, &arch);
-      break;
-    case llvm::Triple::NetBSD:
-      platform_sp =
-          platform_netbsd::PlatformNetBSD::CreateInstance(true, &arch);
-      break;
-    default:
-      llvm_unreachable("unknown ostype in triple");
-    }
-    Platform::SetHostPlatform(platform_sp);
-
-    debugger_sp = Debugger::CreateInstance();
-    ASSERT_TRUE(debugger_sp);
-
-    debugger_sp->GetTargetList().CreateTarget(
-        *debugger_sp, "", arch, eLoadDependentsNo, platform_sp, target_sp);
-    ASSERT_TRUE(target_sp);
-
-    siginfo_type = platform_sp->GetSiginfoType(arch.GetTriple());
-  }
-};
-
-} // namespace
-
-TEST_F(PlatformSiginfoTest, TestLinux_64bit) {
-  for (std::string arch : {"x86_64", "aarch64", "powerpc64le"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo(arch + "-pc-linux-gnu");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(siginfo_type,
-                 {
-                     {"si_signo", 0, 4},
-                     {"si_errno", 4, 4},
-                     {"si_code", 8, 4},
-                     {"_sifields._kill.si_pid", 16, 4},
-                     {"_sifields._kill.si_uid", 20, 4},
-                     {"_sifields._timer.si_tid", 16, 4},
-                     {"_sifields._timer.si_overrun", 20, 4},
-                     {"_sifields._timer.si_sigval", 24, 8},
-                     {"_sifields._rt.si_pid", 16, 4},
-                     {"_sifields._rt.si_uid", 20, 4},
-                     {"_sifields._rt.si_sigval", 24, 8},
-                     {"_sifields._sigchld.si_pid", 16, 4},
-                     {"_sifields._sigchld.si_uid", 20, 4},
-                     {"_sifields._sigchld.si_status", 24, 4},
-                     {"_sifields._sigchld.si_utime", 32, 8},
-                     {"_sifields._sigchld.si_stime", 40, 8},
-                     {"_sifields._sigfault.si_addr", 16, 8},
-                     {"_sifields._sigfault.si_addr_lsb", 24, 2},
-                     {"_sifields._sigfault._bounds._addr_bnd._lower", 32, 8},
-                     {"_sifields._sigfault._bounds._addr_bnd._upper", 40, 8},
-                     {"_sifields._sigfault._bounds._pkey", 32, 4},
-                     {"_sifields._sigpoll.si_band", 16, 8},
-                     {"_sifields._sigpoll.si_fd", 24, 4},
-                     {"_sifields._sigsys._call_addr", 16, 8},
-                     {"_sifields._sigsys._syscall", 24, 4},
-                     {"_sifields._sigsys._arch", 28, 4},
-                 });
-  }
-}
-
-TEST_F(PlatformSiginfoTest, TestLinux_32bit) {
-  for (std::string arch : {"i386", "armv7"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo(arch + "-pc-linux");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(siginfo_type,
-                 {
-                     {"si_signo", 0, 4},
-                     {"si_errno", 4, 4},
-                     {"si_code", 8, 4},
-                     {"_sifields._kill.si_pid", 12, 4},
-                     {"_sifields._kill.si_uid", 16, 4},
-                     {"_sifields._timer.si_tid", 12, 4},
-                     {"_sifields._timer.si_overrun", 16, 4},
-                     {"_sifields._timer.si_sigval", 20, 4},
-                     {"_sifields._rt.si_pid", 12, 4},
-                     {"_sifields._rt.si_uid", 16, 4},
-                     {"_sifields._rt.si_sigval", 20, 4},
-                     {"_sifields._sigchld.si_pid", 12, 4},
-                     {"_sifields._sigchld.si_uid", 16, 4},
-                     {"_sifields._sigchld.si_status", 20, 4},
-                     {"_sifields._sigchld.si_utime", 24, 4},
-                     {"_sifields._sigchld.si_stime", 28, 4},
-                     {"_sifields._sigfault.si_addr", 12, 4},
-                     {"_sifields._sigfault.si_addr_lsb", 16, 2},
-                     {"_sifields._sigfault._bounds._addr_bnd._lower", 20, 4},
-                     {"_sifields._sigfault._bounds._addr_bnd._upper", 24, 4},
-                     {"_sifields._sigfault._bounds._pkey", 20, 4},
-                     {"_sifields._sigpoll.si_band", 12, 4},
-                     {"_sifields._sigpoll.si_fd", 16, 4},
-                     {"_sifields._sigsys._call_addr", 12, 4},
-                     {"_sifields._sigsys._syscall", 16, 4},
-                     {"_sifields._sigsys._arch", 20, 4},
-                 });
-  }
-}
-
-TEST_F(PlatformSiginfoTest, TestFreeBSD_64bit) {
-  for (std::string arch : {"x86_64", "aarch64"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo("x86_64-unknown-freebsd13.0");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(siginfo_type, {
-                                   {"si_signo", 0, 4},
-                                   {"si_errno", 4, 4},
-                                   {"si_code", 8, 4},
-                                   {"si_pid", 12, 4},
-                                   {"si_uid", 16, 4},
-                                   {"si_status", 20, 4},
-                                   {"si_addr", 24, 8},
-                                   {"si_value", 32, 8},
-                                   {"_reason._fault._trapno", 40, 4},
-                                   {"_reason._timer._timerid", 40, 4},
-                                   {"_reason._timer._overrun", 44, 4},
-                                   {"_reason._mesgq._mqd", 40, 4},
-                                   {"_reason._poll._band", 40, 8},
-                               });
-  }
-}
-
-TEST_F(PlatformSiginfoTest, TestFreeBSD_32bit) {
-  for (std::string arch : {"i386"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo(arch + "-unknown-freebsd13.0");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(siginfo_type, {
-                                   {"si_signo", 0, 4},
-                                   {"si_errno", 4, 4},
-                                   {"si_code", 8, 4},
-                                   {"si_pid", 12, 4},
-                                   {"si_uid", 16, 4},
-                                   {"si_status", 20, 4},
-                                   {"si_addr", 24, 4},
-                                   {"si_value", 28, 4},
-                                   {"_reason._fault._trapno", 32, 4},
-                                   {"_reason._timer._timerid", 32, 4},
-                                   {"_reason._timer._overrun", 36, 4},
-                                   {"_reason._mesgq._mqd", 32, 4},
-                                   {"_reason._poll._band", 32, 4},
-                               });
-  }
-}
-
-TEST_F(PlatformSiginfoTest, TestNetBSD_64bit) {
-  for (std::string arch : {"x86_64"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo(arch + "-unknown-netbsd9.0");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(
-        siginfo_type,
-        {
-            {"_info._signo", 0, 4},
-            {"_info._code", 4, 4},
-            {"_info._errno", 8, 4},
-            {"_info._reason._rt._pid", 16, 4},
-            {"_info._reason._rt._uid", 20, 4},
-            {"_info._reason._rt._value", 24, 8},
-            {"_info._reason._child._pid", 16, 4},
-            {"_info._reason._child._uid", 20, 4},
-            {"_info._reason._child._status", 24, 4},
-            {"_info._reason._child._utime", 28, 4},
-            {"_info._reason._child._stime", 32, 4},
-            {"_info._reason._fault._addr", 16, 8},
-            {"_info._reason._fault._trap", 24, 4},
-            {"_info._reason._fault._trap2", 28, 4},
-            {"_info._reason._fault._trap3", 32, 4},
-            {"_info._reason._poll._band", 16, 8},
-            {"_info._reason._poll._fd", 24, 4},
-            {"_info._reason._syscall._sysnum", 16, 4},
-            {"_info._reason._syscall._retval", 20, 8},
-            {"_info._reason._syscall._error", 28, 4},
-            {"_info._reason._syscall._args", 32, 64},
-            {"_info._reason._ptrace_state._pe_report_event", 16, 4},
-            {"_info._reason._ptrace_state._option._pe_other_pid", 20, 4},
-            {"_info._reason._ptrace_state._option._pe_lwp", 20, 4},
-        });
-  }
-}
-
-TEST_F(PlatformSiginfoTest, TestNetBSD_32bit) {
-  for (std::string arch : {"i386"}) {
-    SCOPED_TRACE(arch);
-    InitializeSiginfo(arch + "-unknown-netbsd9.0");
-    ASSERT_TRUE(siginfo_type);
-
-    ExpectFields(
-        siginfo_type,
-        {
-            {"_info._signo", 0, 4},
-            {"_info._code", 4, 4},
-            {"_info._errno", 8, 4},
-            {"_info._reason._rt._pid", 12, 4},
-            {"_info._reason._rt._uid", 16, 4},
-            {"_info._reason._rt._value", 20, 4},
-            {"_info._reason._child._pid", 12, 4},
-            {"_info._reason._child._uid", 16, 4},
-            {"_info._reason._child._status", 20, 4},
-            {"_info._reason._child._utime", 24, 4},
-            {"_info._reason._child._stime", 28, 4},
-            {"_info._reason._fault._addr", 12, 4},
-            {"_info._reason._fault._trap", 16, 4},
-            {"_info._reason._fault._trap2", 20, 4},
-            {"_info._reason._fault._trap3", 24, 4},
-            {"_info._reason._poll._band", 12, 4},
-            {"_info._reason._poll._fd", 16, 4},
-            {"_info._reason._syscall._sysnum", 12, 4},
-            {"_info._reason._syscall._retval", 16, 8},
-            {"_info._reason._syscall._error", 24, 4},
-            {"_info._reason._syscall._args", 28, 64},
-            {"_info._reason._ptrace_state._pe_report_event", 12, 4},
-            {"_info._reason._ptrace_state._option._pe_other_pid", 16, 4},
-            {"_info._reason._ptrace_state._option._pe_lwp", 16, 4},
-        });
-  }
-}

>From 57344b23cc421e001fbb0875f4ce3d1ab1eabb32 Mon Sep 17 00:00:00 2001
From: Charles Zablit <zablitchar...@gmail.com>
Date: Thu, 17 Apr 2025 11:01:55 +0100
Subject: [PATCH 3/3] fixup! [lldb] Remove unused API
 CompilerType::GetIndexOfFieldWithName

---
 .../Platform/PlatformSiginfoTest.cpp          | 312 ++++++++++++++++++
 1 file changed, 312 insertions(+)
 create mode 100644 lldb/unittests/Platform/PlatformSiginfoTest.cpp

diff --git a/lldb/unittests/Platform/PlatformSiginfoTest.cpp 
b/lldb/unittests/Platform/PlatformSiginfoTest.cpp
new file mode 100644
index 0000000000000..ac3ba6ae1aff8
--- /dev/null
+++ b/lldb/unittests/Platform/PlatformSiginfoTest.cpp
@@ -0,0 +1,312 @@
+//===-- PlatformSiginfoTest.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 "gtest/gtest.h"
+
+#include <initializer_list>
+#include <optional>
+#include <tuple>
+
+#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
+#include "Plugins/Platform/Linux/PlatformLinux.h"
+#include "Plugins/Platform/NetBSD/PlatformNetBSD.h"
+#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
+
+#include "TestingSupport/SubsystemRAII.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/ArchSpec.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+class PlatformSiginfoTest : public ::testing::Test {
+  SubsystemRAII<FileSystem, HostInfo, TypeSystemClang> subsystems;
+  PlatformSP platform_sp;
+  DebuggerSP debugger_sp;
+  TargetSP target_sp;
+
+public:
+  CompilerType siginfo_type;
+
+  void SetUp() override {
+    platform_freebsd::PlatformFreeBSD::Initialize();
+    platform_linux::PlatformLinux::Initialize();
+    platform_netbsd::PlatformNetBSD::Initialize();
+  }
+
+  void TearDown() override {
+    platform_netbsd::PlatformNetBSD::Terminate();
+    platform_linux::PlatformLinux::Terminate();
+    platform_freebsd::PlatformFreeBSD::Terminate();
+  }
+
+  typedef std::tuple<const char *, uint64_t, uint64_t> field_tuple;
+
+
+  void ExpectField(const CompilerType &siginfo_type, field_tuple field) {
+    const char *path;
+    uint64_t offset, size;
+    std::tie(path, offset, size) = field;
+
+    SCOPED_TRACE(path);
+    CompilerType field_type = siginfo_type;
+    uint64_t total_offset = 0;
+    for (auto field_name : llvm::split(path, '.')) {
+      uint64_t bit_offset;
+      std::string name;
+      field_type = field_type.GetFieldAtIndex(
+              field_type.GetIndexOfChildWithName(field_name, 
/*omit_empty_base_classes=*/false),
+              name, &bit_offset, nullptr, nullptr);
+      ASSERT_TRUE(field_type);
+      total_offset += bit_offset;
+    }
+
+    EXPECT_EQ(total_offset, offset * 8);
+    EXPECT_EQ(llvm::expectedToOptional(field_type.GetByteSize(nullptr)),
+              std::optional<uint64_t>(size));
+  }
+
+  void ExpectFields(const CompilerType &container,
+                    std::initializer_list<field_tuple> fields) {
+    for (auto x : fields)
+      ExpectField(container, x);
+  }
+
+  void InitializeSiginfo(const std::string &triple) {
+    ArchSpec arch(triple);
+
+    switch (arch.GetTriple().getOS()) {
+    case llvm::Triple::FreeBSD:
+      platform_sp =
+          platform_freebsd::PlatformFreeBSD::CreateInstance(true, &arch);
+      break;
+    case llvm::Triple::Linux:
+      platform_sp = platform_linux::PlatformLinux::CreateInstance(true, &arch);
+      break;
+    case llvm::Triple::NetBSD:
+      platform_sp =
+          platform_netbsd::PlatformNetBSD::CreateInstance(true, &arch);
+      break;
+    default:
+      llvm_unreachable("unknown ostype in triple");
+    }
+    Platform::SetHostPlatform(platform_sp);
+
+    debugger_sp = Debugger::CreateInstance();
+    ASSERT_TRUE(debugger_sp);
+
+    debugger_sp->GetTargetList().CreateTarget(
+        *debugger_sp, "", arch, eLoadDependentsNo, platform_sp, target_sp);
+    ASSERT_TRUE(target_sp);
+
+    siginfo_type = platform_sp->GetSiginfoType(arch.GetTriple());
+  }
+};
+
+} // namespace
+
+TEST_F(PlatformSiginfoTest, TestLinux_64bit) {
+  for (std::string arch : {"x86_64", "aarch64", "powerpc64le"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo(arch + "-pc-linux-gnu");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(siginfo_type,
+                 {
+                     {"si_signo", 0, 4},
+                     {"si_errno", 4, 4},
+                     {"si_code", 8, 4},
+                     {"_sifields._kill.si_pid", 16, 4},
+                     {"_sifields._kill.si_uid", 20, 4},
+                     {"_sifields._timer.si_tid", 16, 4},
+                     {"_sifields._timer.si_overrun", 20, 4},
+                     {"_sifields._timer.si_sigval", 24, 8},
+                     {"_sifields._rt.si_pid", 16, 4},
+                     {"_sifields._rt.si_uid", 20, 4},
+                     {"_sifields._rt.si_sigval", 24, 8},
+                     {"_sifields._sigchld.si_pid", 16, 4},
+                     {"_sifields._sigchld.si_uid", 20, 4},
+                     {"_sifields._sigchld.si_status", 24, 4},
+                     {"_sifields._sigchld.si_utime", 32, 8},
+                     {"_sifields._sigchld.si_stime", 40, 8},
+                     {"_sifields._sigfault.si_addr", 16, 8},
+                     {"_sifields._sigfault.si_addr_lsb", 24, 2},
+                     {"_sifields._sigfault._bounds._addr_bnd._lower", 32, 8},
+                     {"_sifields._sigfault._bounds._addr_bnd._upper", 40, 8},
+                     {"_sifields._sigfault._bounds._pkey", 32, 4},
+                     {"_sifields._sigpoll.si_band", 16, 8},
+                     {"_sifields._sigpoll.si_fd", 24, 4},
+                     {"_sifields._sigsys._call_addr", 16, 8},
+                     {"_sifields._sigsys._syscall", 24, 4},
+                     {"_sifields._sigsys._arch", 28, 4},
+                 });
+  }
+}
+
+TEST_F(PlatformSiginfoTest, TestLinux_32bit) {
+  for (std::string arch : {"i386", "armv7"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo(arch + "-pc-linux");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(siginfo_type,
+                 {
+                     {"si_signo", 0, 4},
+                     {"si_errno", 4, 4},
+                     {"si_code", 8, 4},
+                     {"_sifields._kill.si_pid", 12, 4},
+                     {"_sifields._kill.si_uid", 16, 4},
+                     {"_sifields._timer.si_tid", 12, 4},
+                     {"_sifields._timer.si_overrun", 16, 4},
+                     {"_sifields._timer.si_sigval", 20, 4},
+                     {"_sifields._rt.si_pid", 12, 4},
+                     {"_sifields._rt.si_uid", 16, 4},
+                     {"_sifields._rt.si_sigval", 20, 4},
+                     {"_sifields._sigchld.si_pid", 12, 4},
+                     {"_sifields._sigchld.si_uid", 16, 4},
+                     {"_sifields._sigchld.si_status", 20, 4},
+                     {"_sifields._sigchld.si_utime", 24, 4},
+                     {"_sifields._sigchld.si_stime", 28, 4},
+                     {"_sifields._sigfault.si_addr", 12, 4},
+                     {"_sifields._sigfault.si_addr_lsb", 16, 2},
+                     {"_sifields._sigfault._bounds._addr_bnd._lower", 20, 4},
+                     {"_sifields._sigfault._bounds._addr_bnd._upper", 24, 4},
+                     {"_sifields._sigfault._bounds._pkey", 20, 4},
+                     {"_sifields._sigpoll.si_band", 12, 4},
+                     {"_sifields._sigpoll.si_fd", 16, 4},
+                     {"_sifields._sigsys._call_addr", 12, 4},
+                     {"_sifields._sigsys._syscall", 16, 4},
+                     {"_sifields._sigsys._arch", 20, 4},
+                 });
+  }
+}
+
+TEST_F(PlatformSiginfoTest, TestFreeBSD_64bit) {
+  for (std::string arch : {"x86_64", "aarch64"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo("x86_64-unknown-freebsd13.0");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(siginfo_type, {
+                                   {"si_signo", 0, 4},
+                                   {"si_errno", 4, 4},
+                                   {"si_code", 8, 4},
+                                   {"si_pid", 12, 4},
+                                   {"si_uid", 16, 4},
+                                   {"si_status", 20, 4},
+                                   {"si_addr", 24, 8},
+                                   {"si_value", 32, 8},
+                                   {"_reason._fault._trapno", 40, 4},
+                                   {"_reason._timer._timerid", 40, 4},
+                                   {"_reason._timer._overrun", 44, 4},
+                                   {"_reason._mesgq._mqd", 40, 4},
+                                   {"_reason._poll._band", 40, 8},
+                               });
+  }
+}
+
+TEST_F(PlatformSiginfoTest, TestFreeBSD_32bit) {
+  for (std::string arch : {"i386"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo(arch + "-unknown-freebsd13.0");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(siginfo_type, {
+                                   {"si_signo", 0, 4},
+                                   {"si_errno", 4, 4},
+                                   {"si_code", 8, 4},
+                                   {"si_pid", 12, 4},
+                                   {"si_uid", 16, 4},
+                                   {"si_status", 20, 4},
+                                   {"si_addr", 24, 4},
+                                   {"si_value", 28, 4},
+                                   {"_reason._fault._trapno", 32, 4},
+                                   {"_reason._timer._timerid", 32, 4},
+                                   {"_reason._timer._overrun", 36, 4},
+                                   {"_reason._mesgq._mqd", 32, 4},
+                                   {"_reason._poll._band", 32, 4},
+                               });
+  }
+}
+
+TEST_F(PlatformSiginfoTest, TestNetBSD_64bit) {
+  for (std::string arch : {"x86_64"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo(arch + "-unknown-netbsd9.0");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(
+        siginfo_type,
+        {
+            {"_info._signo", 0, 4},
+            {"_info._code", 4, 4},
+            {"_info._errno", 8, 4},
+            {"_info._reason._rt._pid", 16, 4},
+            {"_info._reason._rt._uid", 20, 4},
+            {"_info._reason._rt._value", 24, 8},
+            {"_info._reason._child._pid", 16, 4},
+            {"_info._reason._child._uid", 20, 4},
+            {"_info._reason._child._status", 24, 4},
+            {"_info._reason._child._utime", 28, 4},
+            {"_info._reason._child._stime", 32, 4},
+            {"_info._reason._fault._addr", 16, 8},
+            {"_info._reason._fault._trap", 24, 4},
+            {"_info._reason._fault._trap2", 28, 4},
+            {"_info._reason._fault._trap3", 32, 4},
+            {"_info._reason._poll._band", 16, 8},
+            {"_info._reason._poll._fd", 24, 4},
+            {"_info._reason._syscall._sysnum", 16, 4},
+            {"_info._reason._syscall._retval", 20, 8},
+            {"_info._reason._syscall._error", 28, 4},
+            {"_info._reason._syscall._args", 32, 64},
+            {"_info._reason._ptrace_state._pe_report_event", 16, 4},
+            {"_info._reason._ptrace_state._option._pe_other_pid", 20, 4},
+            {"_info._reason._ptrace_state._option._pe_lwp", 20, 4},
+        });
+  }
+}
+
+TEST_F(PlatformSiginfoTest, TestNetBSD_32bit) {
+  for (std::string arch : {"i386"}) {
+    SCOPED_TRACE(arch);
+    InitializeSiginfo(arch + "-unknown-netbsd9.0");
+    ASSERT_TRUE(siginfo_type);
+
+    ExpectFields(
+        siginfo_type,
+        {
+            {"_info._signo", 0, 4},
+            {"_info._code", 4, 4},
+            {"_info._errno", 8, 4},
+            {"_info._reason._rt._pid", 12, 4},
+            {"_info._reason._rt._uid", 16, 4},
+            {"_info._reason._rt._value", 20, 4},
+            {"_info._reason._child._pid", 12, 4},
+            {"_info._reason._child._uid", 16, 4},
+            {"_info._reason._child._status", 20, 4},
+            {"_info._reason._child._utime", 24, 4},
+            {"_info._reason._child._stime", 28, 4},
+            {"_info._reason._fault._addr", 12, 4},
+            {"_info._reason._fault._trap", 16, 4},
+            {"_info._reason._fault._trap2", 20, 4},
+            {"_info._reason._fault._trap3", 24, 4},
+            {"_info._reason._poll._band", 12, 4},
+            {"_info._reason._poll._fd", 16, 4},
+            {"_info._reason._syscall._sysnum", 12, 4},
+            {"_info._reason._syscall._retval", 16, 8},
+            {"_info._reason._syscall._error", 24, 4},
+            {"_info._reason._syscall._args", 28, 64},
+            {"_info._reason._ptrace_state._pe_report_event", 12, 4},
+            {"_info._reason._ptrace_state._option._pe_other_pid", 16, 4},
+            {"_info._reason._ptrace_state._option._pe_lwp", 16, 4},
+        });
+  }
+}

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to