[Lldb-commits] [lldb] [lldb][AIX] Implement read/write handling for GPR and SPR registers (PR #193205)

Hemang Gadhavi via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 24 00:51:57 PDT 2026


================
@@ -87,11 +90,34 @@ static const RegisterSet g_reg_sets_ppc64[k_num_register_sets] = {
     {"VSX Registers", "vsx", k_num_vsx_registers_ppc64, g_vsx_regnums_ppc64},
 };
 
+std::unique_ptr<NativeRegisterContextAIX>
+NativeRegisterContextAIX::CreateHostNativeRegisterContextAIX(
+    const ArchSpec &target_arch, NativeThreadAIX &native_thread) {
+  switch (target_arch.GetMachine()) {
+  case llvm::Triple::ppc:
+  case llvm::Triple::ppc64:
+    return std::make_unique<NativeRegisterContextAIX_ppc64>(target_arch,
+                                                            native_thread);
+  default:
+    llvm_unreachable("have no register context for architecture");
+  }
+}
+
 NativeRegisterContextAIX_ppc64::NativeRegisterContextAIX_ppc64(
     const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
-    : NativeRegisterContextAIX(native_thread) {
-  if (target_arch.GetMachine() != llvm::Triple::ppc64)
+    : NativeRegisterContextRegisterInfo(
+          native_thread, new RegisterInfoPOSIX_ppc64(target_arch)),
+      NativeRegisterContextAIX(native_thread) {
+  switch (target_arch.GetMachine()) {
+  case llvm::Triple::ppc:
+    m_gpr = &m_gpr_storage.gpr32;
+    break;
+  case llvm::Triple::ppc64:
+    m_gpr = &m_gpr_storage.gpr64;
----------------
HemangGadhavi wrote:

Good Point. corrected. 

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


More information about the lldb-commits mailing list