Author: Minsoo Choo
Date: 2026-02-06T08:39:27-05:00
New Revision: 2791f42a0410d6997335700b3207071a951b5b86

URL: 
https://github.com/llvm/llvm-project/commit/2791f42a0410d6997335700b3207071a951b5b86
DIFF: 
https://github.com/llvm/llvm-project/commit/2791f42a0410d6997335700b3207071a951b5b86.diff

LOG: [lldb][Process] Remove mips64 POSIX support (#179987)

Since ce03a862372a6f36d2fcf80dc80052aa155fcae8 and
427bb1cc1b09ea68b8a13a667810681ba4074f6b, mips64 support for POSIX is
orphaned. Remove any POSIX_mips64 code and other code we missed in those
commits.

---------

Signed-off-by: Minsoo Choo <[email protected]>

Added: 
    

Modified: 
    lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/source/Plugins/Process/Utility/CMakeLists.txt
    lldb/source/Plugins/Process/elf-core/CMakeLists.txt
    lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
    lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp

Removed: 
    lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
    lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h
    lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h
    lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
    lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h


################################################################################
diff  --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp 
b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index d7584be2b95ee..b537813709bc1 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -123,8 +123,7 @@ PlatformFreeBSD::PlatformFreeBSD(bool is_host)
   } else {
     m_supported_architectures = CreateArchList(
         {llvm::Triple::x86_64, llvm::Triple::x86, llvm::Triple::aarch64,
-         llvm::Triple::arm, llvm::Triple::mips64, llvm::Triple::ppc64,
-         llvm::Triple::ppc},
+         llvm::Triple::arm, llvm::Triple::ppc64, llvm::Triple::ppc},
         llvm::Triple::FreeBSD);
   }
 }

diff  --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp 
b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index a7352e625a07c..4144beae21937 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -770,26 +770,6 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t 
&info,
   }
 
   case SI_KERNEL:
-#if defined __mips__
-    // For mips there is no special signal for watchpoint So we check for
-    // watchpoint in kernel trap
-    {
-      // If a watchpoint was hit, report it
-      uint32_t wp_index;
-      Status error = thread.GetRegisterContext().GetWatchpointHitIndex(
-          wp_index, LLDB_INVALID_ADDRESS);
-      if (error.Fail())
-        LLDB_LOG(log,
-                 "received error while checking for watchpoint hits, pid = "
-                 "{0}, error = {1}",
-                 thread.GetID(), error);
-      if (wp_index != LLDB_INVALID_INDEX32) {
-        MonitorWatchpoint(thread, wp_index);
-        break;
-      }
-    }
-// NO BREAK
-#endif
   case TRAP_BRKPT:
     MonitorBreakpoint(thread);
     break;
@@ -1000,7 +980,7 @@ bool NativeProcessLinux::MonitorClone(NativeThreadLinux 
&parent,
 }
 
 bool NativeProcessLinux::SupportHardwareSingleStepping() const {
-  if (m_arch.IsMIPS() || m_arch.GetMachine() == llvm::Triple::arm ||
+  if (m_arch.GetMachine() == llvm::Triple::arm ||
       m_arch.GetTriple().isRISCV() || m_arch.GetTriple().isLoongArch())
     return false;
   return true;

diff  --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt 
b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index e69193a47bbd4..9148465607b7d 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -43,7 +43,6 @@ add_lldb_library(lldbPluginProcessUtility
   RegisterContextPOSIX_arm.cpp
   RegisterContextPOSIX_arm64.cpp
   RegisterContextPOSIX_loongarch64.cpp
-  RegisterContextPOSIX_mips64.cpp
   RegisterContextPOSIX_riscv32.cpp
   RegisterContextPOSIX_powerpc.cpp
   RegisterContextPOSIX_ppc64le.cpp

diff  --git 
a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp 
b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
deleted file mode 100644
index 0b8bc93bbb788..0000000000000
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//===-- RegisterContextPOSIX_mips64.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 <cerrno>
-#include <cstdint>
-#include <cstring>
-
-#include "lldb/Target/Process.h"
-#include "lldb/Target/Target.h"
-#include "lldb/Target/Thread.h"
-#include "lldb/Utility/DataBufferHeap.h"
-#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Utility/Endian.h"
-#include "lldb/Utility/RegisterValue.h"
-#include "lldb/Utility/Scalar.h"
-#include "llvm/Support/Compiler.h"
-
-#include "RegisterContextPOSIX_mips64.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-bool RegisterContextPOSIX_mips64::IsGPR(unsigned reg) {
-  return reg < m_registers_count[gpr_registers_count]; // GPR's come first.
-}
-
-bool RegisterContextPOSIX_mips64::IsFPR(unsigned reg) {
-  int set = GetRegisterSetCount();
-  if (set > 1)
-    return reg < (m_registers_count[fpr_registers_count]
-                  + m_registers_count[gpr_registers_count]);
-  return false;
-}
-
-RegisterContextPOSIX_mips64::RegisterContextPOSIX_mips64(
-    Thread &thread, uint32_t concrete_frame_idx,
-    RegisterInfoInterface *register_info)
-    : RegisterContext(thread, concrete_frame_idx) {
-  m_register_info_up.reset(register_info);
-  m_num_registers = GetRegisterCount();
-  int set = GetRegisterSetCount();
-
-  const RegisterSet *reg_set_ptr;
-  for(int i = 0; i < set; ++i) {
-      reg_set_ptr = GetRegisterSet(i);
-      m_registers_count[i] = reg_set_ptr->num_registers;
-  }
-
-  assert(m_num_registers ==
-         static_cast<uint32_t>(m_registers_count[gpr_registers_count] +
-                               m_registers_count[fpr_registers_count] +
-                               m_registers_count[msa_registers_count]));
-}
-
-RegisterContextPOSIX_mips64::~RegisterContextPOSIX_mips64() = default;
-
-void RegisterContextPOSIX_mips64::Invalidate() {}
-
-void RegisterContextPOSIX_mips64::InvalidateAllRegisters() {}
-
-unsigned RegisterContextPOSIX_mips64::GetRegisterOffset(unsigned reg) {
-  assert(reg < m_num_registers && "Invalid register number.");
-  return GetRegisterInfo()[reg].byte_offset;
-}
-
-unsigned RegisterContextPOSIX_mips64::GetRegisterSize(unsigned reg) {
-  assert(reg < m_num_registers && "Invalid register number.");
-  return GetRegisterInfo()[reg].byte_size;
-}
-
-size_t RegisterContextPOSIX_mips64::GetRegisterCount() {
-  return m_register_info_up->GetRegisterCount();
-}
-
-size_t RegisterContextPOSIX_mips64::GetGPRSize() {
-  return m_register_info_up->GetGPRSize();
-}
-
-const RegisterInfo *RegisterContextPOSIX_mips64::GetRegisterInfo() {
-  // Commonly, this method is overridden and g_register_infos is copied and
-  // specialized. So, use GetRegisterInfo() rather than g_register_infos in
-  // this scope.
-  return m_register_info_up->GetRegisterInfo();
-}
-
-const RegisterInfo *
-RegisterContextPOSIX_mips64::GetRegisterInfoAtIndex(size_t reg) {
-  if (reg < m_num_registers)
-    return &GetRegisterInfo()[reg];
-  else
-    return nullptr;
-}
-
-size_t RegisterContextPOSIX_mips64::GetRegisterSetCount() {
-  return register_set_count;
-}
-
-const RegisterSet *RegisterContextPOSIX_mips64::GetRegisterSet(size_t set) {
-  return nullptr;
-}
-
-const char *RegisterContextPOSIX_mips64::GetRegisterName(unsigned reg) {
-  assert(reg < m_num_registers && "Invalid register offset.");
-  return GetRegisterInfo()[reg].name;
-}
-
-bool RegisterContextPOSIX_mips64::IsRegisterSetAvailable(size_t set_index) {
-  size_t num_sets = GetRegisterSetCount();
-
-  return (set_index < num_sets);
-}
-
-// Used when parsing DWARF and EH frame information and any other object file
-// sections that contain register numbers in them.
-uint32_t RegisterContextPOSIX_mips64::ConvertRegisterKindToRegisterNumber(
-    lldb::RegisterKind kind, uint32_t num) {
-  const uint32_t num_regs = m_num_registers;
-
-  assert(kind < kNumRegisterKinds);
-  for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
-    const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg_idx);
-
-    if (reg_info->kinds[kind] == num)
-      return reg_idx;
-  }
-
-  return LLDB_INVALID_REGNUM;
-}

diff  --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h 
b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h
deleted file mode 100644
index bfb68927233d1..0000000000000
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//===-- RegisterContextPOSIX_mips64.h ---------------------------*- C++ 
-*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_MIPS64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_MIPS64_H
-
-#include "RegisterContext_mips.h"
-#include "RegisterInfoInterface.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/Utility/Log.h"
-
-class RegisterContextPOSIX_mips64 : public lldb_private::RegisterContext {
-public:
-
-  enum Register_count{
-      gpr_registers_count = 0,
-      fpr_registers_count,
-      msa_registers_count,
-      register_set_count
-  };
-
-  RegisterContextPOSIX_mips64(
-      lldb_private::Thread &thread, uint32_t concrete_frame_idx,
-      lldb_private::RegisterInfoInterface *register_info);
-
-  ~RegisterContextPOSIX_mips64() override;
-
-  void Invalidate();
-
-  void InvalidateAllRegisters() override;
-
-  size_t GetRegisterCount() override;
-
-  virtual size_t GetGPRSize();
-
-  virtual unsigned GetRegisterSize(unsigned reg);
-
-  virtual unsigned GetRegisterOffset(unsigned reg);
-
-  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) 
override;
-
-  size_t GetRegisterSetCount() override;
-
-  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
-
-  const char *GetRegisterName(unsigned reg);
-
-  uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind,
-                                               uint32_t num) override;
-
-protected:
-  uint32_t m_num_registers;
-  uint8_t m_registers_count[register_set_count];
-  std::unique_ptr<lldb_private::RegisterInfoInterface>
-      m_register_info_up; // Register Info Interface (Linux)
-
-  // Determines if an extended register set is supported on the processor
-  // running the inferior process.
-  virtual bool IsRegisterSetAvailable(size_t set_index);
-
-  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
-
-  bool IsGPR(unsigned reg);
-
-  bool IsFPR(unsigned reg);
-
-  virtual bool ReadGPR() = 0;
-  virtual bool ReadFPR() = 0;
-  virtual bool WriteGPR() = 0;
-  virtual bool WriteFPR() = 0;
-};
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_MIPS64_H

diff  --git 
a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h 
b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h
deleted file mode 100644
index 000f6e3847e77..0000000000000
--- a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//===-- lldb-mips-freebsd-register-enums.h ----------------------*- C++ 
-*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_MIPS_FREEBSD_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_MIPS_FREEBSD_REGISTER_ENUMS_H
-
-namespace lldb_private {
-// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
-
-// Internal codes for all mips registers.
-enum {
-  k_first_gpr_mips64,
-  gpr_zero_mips64 = k_first_gpr_mips64,
-  gpr_r1_mips64,
-  gpr_r2_mips64,
-  gpr_r3_mips64,
-  gpr_r4_mips64,
-  gpr_r5_mips64,
-  gpr_r6_mips64,
-  gpr_r7_mips64,
-  gpr_r8_mips64,
-  gpr_r9_mips64,
-  gpr_r10_mips64,
-  gpr_r11_mips64,
-  gpr_r12_mips64,
-  gpr_r13_mips64,
-  gpr_r14_mips64,
-  gpr_r15_mips64,
-  gpr_r16_mips64,
-  gpr_r17_mips64,
-  gpr_r18_mips64,
-  gpr_r19_mips64,
-  gpr_r20_mips64,
-  gpr_r21_mips64,
-  gpr_r22_mips64,
-  gpr_r23_mips64,
-  gpr_r24_mips64,
-  gpr_r25_mips64,
-  gpr_r26_mips64,
-  gpr_r27_mips64,
-  gpr_gp_mips64,
-  gpr_sp_mips64,
-  gpr_r30_mips64,
-  gpr_ra_mips64,
-  gpr_sr_mips64,
-  gpr_mullo_mips64,
-  gpr_mulhi_mips64,
-  gpr_badvaddr_mips64,
-  gpr_cause_mips64,
-  gpr_pc_mips64,
-  gpr_ic_mips64,
-  gpr_dummy_mips64,
-  k_last_gpr_mips64 = gpr_dummy_mips64,
-
-  k_first_fpr_mips64,
-  fpr_f0_mips64 = k_first_fpr_mips64,
-  fpr_f1_mips64,
-  fpr_f2_mips64,
-  fpr_f3_mips64,
-  fpr_f4_mips64,
-  fpr_f5_mips64,
-  fpr_f6_mips64,
-  fpr_f7_mips64,
-  fpr_f8_mips64,
-  fpr_f9_mips64,
-  fpr_f10_mips64,
-  fpr_f11_mips64,
-  fpr_f12_mips64,
-  fpr_f13_mips64,
-  fpr_f14_mips64,
-  fpr_f15_mips64,
-  fpr_f16_mips64,
-  fpr_f17_mips64,
-  fpr_f18_mips64,
-  fpr_f19_mips64,
-  fpr_f20_mips64,
-  fpr_f21_mips64,
-  fpr_f22_mips64,
-  fpr_f23_mips64,
-  fpr_f24_mips64,
-  fpr_f25_mips64,
-  fpr_f26_mips64,
-  fpr_f27_mips64,
-  fpr_f28_mips64,
-  fpr_f29_mips64,
-  fpr_f30_mips64,
-  fpr_f31_mips64,
-  fpr_fcsr_mips64,
-  fpr_fir_mips64,
-  k_last_fpr_mips64 = fpr_fir_mips64,
-
-  k_num_registers_mips64,
-
-  k_num_gpr_registers_mips64 = k_last_gpr_mips64 - k_first_gpr_mips64 + 1,
-  k_num_fpr_registers_mips64 = k_last_fpr_mips64 - k_first_fpr_mips64 + 1,
-};
-} // namespace lldb_private
-#endif // 
LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_MIPS_FREEBSD_REGISTER_ENUMS_H

diff  --git a/lldb/source/Plugins/Process/elf-core/CMakeLists.txt 
b/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
index 0bc26bb0efbe3..73d2b9ac9957b 100644
--- a/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
@@ -4,7 +4,6 @@ add_lldb_library(lldbPluginProcessElfCore PLUGIN
   RegisterContextLinuxCore_x86_64.cpp
   RegisterContextPOSIXCore_arm.cpp
   RegisterContextPOSIXCore_arm64.cpp
-  RegisterContextPOSIXCore_mips64.cpp
   RegisterContextPOSIXCore_powerpc.cpp
   RegisterContextPOSIXCore_ppc64le.cpp
   RegisterContextPOSIXCore_s390x.cpp

diff  --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp 
b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 97e84a675baf6..4491d5a036e4e 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -674,7 +674,6 @@ ProcessElfCore::parseSegment(const DataExtractor &segment) {
 llvm::Error ProcessElfCore::parseFreeBSDNotes(llvm::ArrayRef<CoreNote> notes) {
   ArchSpec arch = GetArchitecture();
   bool lp64 = (arch.GetMachine() == llvm::Triple::aarch64 ||
-               arch.GetMachine() == llvm::Triple::mips64 ||
                arch.GetMachine() == llvm::Triple::ppc64 ||
                arch.GetMachine() == llvm::Triple::x86_64);
   bool have_prstatus = false;

diff  --git 
a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp 
b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
deleted file mode 100644
index 56e68742ead77..0000000000000
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- RegisterContextPOSIXCore_mips64.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 "RegisterContextPOSIXCore_mips64.h"
-
-#include "lldb/Target/Thread.h"
-#include "lldb/Utility/RegisterValue.h"
-
-#include <memory>
-
-using namespace lldb_private;
-
-RegisterContextCorePOSIX_mips64::RegisterContextCorePOSIX_mips64(
-    Thread &thread, RegisterInfoInterface *register_info,
-    const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
-    : RegisterContextPOSIX_mips64(thread, 0, register_info) {
-  m_gpr_buffer = std::make_shared<DataBufferHeap>(gpregset.GetDataStart(),
-                                                  gpregset.GetByteSize());
-  m_gpr.SetData(m_gpr_buffer);
-  m_gpr.SetByteOrder(gpregset.GetByteOrder());
-
-  DataExtractor fpregset = getRegset(
-      notes, register_info->GetTargetArchitecture().GetTriple(), FPR_Desc);
-  m_fpr_buffer = std::make_shared<DataBufferHeap>(fpregset.GetDataStart(),
-                                                  fpregset.GetByteSize());
-  m_fpr.SetData(m_fpr_buffer);
-  m_fpr.SetByteOrder(fpregset.GetByteOrder());
-}
-
-RegisterContextCorePOSIX_mips64::~RegisterContextCorePOSIX_mips64() = default;
-
-bool RegisterContextCorePOSIX_mips64::ReadGPR() { return true; }
-
-bool RegisterContextCorePOSIX_mips64::ReadFPR() { return false; }
-
-bool RegisterContextCorePOSIX_mips64::WriteGPR() {
-  assert(0);
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::WriteFPR() {
-  assert(0);
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::ReadRegister(const RegisterInfo 
*reg_info,
-                                                   RegisterValue &value) {
-  
-  lldb::offset_t offset = reg_info->byte_offset;
-  lldb_private::ArchSpec arch = m_register_info_up->GetTargetArchitecture();
-  uint64_t v;
-  if (IsGPR(reg_info->kinds[lldb::eRegisterKindLLDB])) {
-    if (reg_info->byte_size == 4 && !(arch.GetMachine() == 
llvm::Triple::mips64el))
-      // In case of 32bit core file, the register data are placed at 4 byte
-      // offset.
-      offset = offset / 2;
-    v = m_gpr.GetMaxU64(&offset, reg_info->byte_size);
-    value = v;
-    return true;
-  } else if (IsFPR(reg_info->kinds[lldb::eRegisterKindLLDB])) {
-    offset = offset - sizeof(GPR_linux_mips);
-    v =m_fpr.GetMaxU64(&offset, reg_info->byte_size);
-    value = v;
-    return true;
-    }
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::ReadAllRegisterValues(
-    lldb::WritableDataBufferSP &data_sp) {
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::WriteRegister(
-    const RegisterInfo *reg_info, const RegisterValue &value) {
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::WriteAllRegisterValues(
-    const lldb::DataBufferSP &data_sp) {
-  return false;
-}
-
-bool RegisterContextCorePOSIX_mips64::HardwareSingleStep(bool enable) {
-  return false;
-}

diff  --git 
a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h 
b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
deleted file mode 100644
index 529b00215e352..0000000000000
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//===-- RegisterContextPOSIXCore_mips64.h -----------------------*- C++ 
-*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_MIPS64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_MIPS64_H
-
-#include "Plugins/Process/Utility/RegisterContextPOSIX_mips64.h"
-#include "Plugins/Process/elf-core/RegisterUtilities.h"
-#include "lldb/Utility/DataBufferHeap.h"
-#include "lldb/Utility/DataExtractor.h"
-
-class RegisterContextCorePOSIX_mips64 : public RegisterContextPOSIX_mips64 {
-public:
-  RegisterContextCorePOSIX_mips64(
-      lldb_private::Thread &thread,
-      lldb_private::RegisterInfoInterface *register_info,
-      const lldb_private::DataExtractor &gpregset,
-      llvm::ArrayRef<lldb_private::CoreNote> notes);
-
-  ~RegisterContextCorePOSIX_mips64() override;
-
-  bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
-                    lldb_private::RegisterValue &value) override;
-
-  bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
-                     const lldb_private::RegisterValue &value) override;
-
-  bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
-
-  bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
-
-  bool HardwareSingleStep(bool enable) override;
-
-protected:
-  bool ReadGPR() override;
-
-  bool ReadFPR() override;
-
-  bool WriteGPR() override;
-
-  bool WriteFPR() override;
-
-private:
-  lldb::DataBufferSP m_gpr_buffer;
-  lldb::DataBufferSP m_fpr_buffer;
-  lldb_private::DataExtractor m_gpr;
-  lldb_private::DataExtractor m_fpr;
-};
-
-#endif // 
LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_MIPS64_H

diff  --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp 
b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index 4e4eb9274d1f3..b51d34a2614f1 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -34,7 +34,6 @@
 #include "RegisterContextPOSIXCore_arm.h"
 #include "RegisterContextPOSIXCore_arm64.h"
 #include "RegisterContextPOSIXCore_loongarch64.h"
-#include "RegisterContextPOSIXCore_mips64.h"
 #include "RegisterContextPOSIXCore_powerpc.h"
 #include "RegisterContextPOSIXCore_ppc64le.h"
 #include "RegisterContextPOSIXCore_riscv32.h"
@@ -201,16 +200,6 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame 
*frame) {
       m_thread_reg_ctx_sp = RegisterContextCorePOSIX_riscv64::Create(
           *this, arch, m_gpregset_data, m_notes);
       break;
-    case llvm::Triple::mipsel:
-    case llvm::Triple::mips:
-      m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_mips64>(
-          *this, reg_interface, m_gpregset_data, m_notes);
-      break;
-    case llvm::Triple::mips64:
-    case llvm::Triple::mips64el:
-      m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_mips64>(
-          *this, reg_interface, m_gpregset_data, m_notes);
-      break;
     case llvm::Triple::ppc:
     case llvm::Triple::ppc64:
       m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_powerpc>(
@@ -282,19 +271,7 @@ ELFLinuxPrStatus::ELFLinuxPrStatus() {
 }
 
 size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec &arch) {
-  constexpr size_t mips_linux_pr_status_size_o32 = 96;
-  constexpr size_t mips_linux_pr_status_size_n32 = 72;
   constexpr size_t num_ptr_size_members = 10;
-  if (arch.IsMIPS()) {
-    std::string abi = arch.GetTargetABI();
-    assert(!abi.empty() && "ABI is not set");
-    if (abi == "n64")
-      return sizeof(ELFLinuxPrStatus);
-    else if (abi == "o32")
-      return mips_linux_pr_status_size_o32;
-    // N32 ABI
-    return mips_linux_pr_status_size_n32;
-  }
   switch (arch.GetCore()) {
   case lldb_private::ArchSpec::eCore_x86_32_i386:
   case lldb_private::ArchSpec::eCore_x86_32_i486:
@@ -382,14 +359,6 @@ ELFLinuxPrPsInfo::ELFLinuxPrPsInfo() {
 }
 
 size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec &arch) {
-  constexpr size_t mips_linux_pr_psinfo_size_o32_n32 = 128;
-  if (arch.IsMIPS()) {
-    uint8_t address_byte_size = arch.GetAddressByteSize();
-    if (address_byte_size == 8)
-      return sizeof(ELFLinuxPrPsInfo);
-    return mips_linux_pr_psinfo_size_o32_n32;
-  }
-
   switch (arch.GetCore()) {
   case lldb_private::ArchSpec::eCore_s390x_generic:
   case lldb_private::ArchSpec::eCore_x86_64_x86_64:
@@ -426,15 +395,9 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
 
   pr_flag = data.GetAddress(&offset);
 
-  if (arch.IsMIPS()) {
-    // The pr_uid and pr_gid is always 32 bit irrespective of platforms
-    pr_uid = data.GetU32(&offset);
-    pr_gid = data.GetU32(&offset);
-  } else {
-    // 16 bit on 32 bit platforms, 32 bit on 64 bit platforms
-    pr_uid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
-    pr_gid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
-  }
+  // 16 bit on 32 bit platforms, 32 bit on 64 bit platforms
+  pr_uid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
+  pr_gid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
 
   pr_pid = data.GetU32(&offset);
   pr_ppid = data.GetU32(&offset);


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to