summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Plugins/Process/POSIX')
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp120
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp64
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h19
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp88
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h29
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp90
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h29
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp126
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h29
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp96
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h29
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp139
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h29
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h98
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.cpp318
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.h95
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp3
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h4
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp12
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h4
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp238
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h138
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp666
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h462
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h104
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86.h479
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h207
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h74
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h409
29 files changed, 544 insertions, 3654 deletions
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp
index cc759ea..d48f8f9 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp
@@ -20,6 +20,7 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/State.h"
#include "lldb/Host/Host.h"
+#include "lldb/Host/HostInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
@@ -29,8 +30,10 @@
#include "ProcessPOSIX.h"
#include "ProcessPOSIXLog.h"
#include "ProcessMonitor.h"
+#include "RegisterContextPOSIXProcessMonitor_arm64.h"
#include "RegisterContextPOSIXProcessMonitor_mips64.h"
#include "RegisterContextPOSIXProcessMonitor_x86.h"
+#include "RegisterContextLinux_arm64.h"
#include "RegisterContextLinux_i386.h"
#include "RegisterContextLinux_x86_64.h"
#include "RegisterContextFreeBSD_i386.h"
@@ -110,7 +113,7 @@ POSIXThread::RefreshStateAfterStop()
GetRegisterContext()->InvalidateIfNeeded (force);
}
// FIXME: This should probably happen somewhere else.
- SetResumeState(eStateRunning);
+ SetResumeState(eStateRunning, true);
Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
if (log)
log->Printf ("POSIXThread::%s (tid = %" PRIi64 ") setting thread resume state to running", __FUNCTION__, GetID());
@@ -156,58 +159,82 @@ POSIXThread::GetRegisterContext()
RegisterInfoInterface *reg_interface = NULL;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
- switch (target_arch.GetCore())
+ switch (target_arch.GetTriple().getOS())
{
- case ArchSpec::eCore_mips64:
- {
- switch (target_arch.GetTriple().getOS())
+ case llvm::Triple::FreeBSD:
+ switch (target_arch.GetMachine())
{
- case llvm::Triple::FreeBSD:
+ case llvm::Triple::mips64:
reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
break;
+ case llvm::Triple::x86:
+ reg_interface = new RegisterContextFreeBSD_i386(target_arch);
+ break;
+ case llvm::Triple::x86_64:
+ reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
+ break;
default:
- assert(false && "OS not supported");
break;
}
-
- if (reg_interface)
- {
- RegisterContextPOSIXProcessMonitor_mips64 *reg_ctx = new RegisterContextPOSIXProcessMonitor_mips64(*this, 0, reg_interface);
- m_posix_thread = reg_ctx;
- m_reg_context_sp.reset(reg_ctx);
- }
break;
- }
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- case ArchSpec::eCore_x86_64_x86_64:
- {
- switch (target_arch.GetTriple().getOS())
+ case llvm::Triple::Linux:
+ switch (target_arch.GetMachine())
{
- case llvm::Triple::FreeBSD:
- reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
+ case llvm::Triple::aarch64:
+ assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) && "Register setting path assumes this is a 64-bit host");
+ reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_arm64(target_arch));
break;
- case llvm::Triple::Linux:
- reg_interface = new RegisterContextLinux_x86_64(target_arch);
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
+ if (HostInfo::GetArchitecture().GetAddressByteSize() == 4)
+ {
+ // 32-bit hosts run with a RegisterContextLinux_i386 context.
+ reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_i386(target_arch));
+ }
+ else
+ {
+ assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
+ "Register setting path assumes this is a 64-bit host");
+ // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the x86_64 register context.
+ reg_interface = static_cast<RegisterInfoInterface*>(new RegisterContextLinux_x86_64(target_arch));
+ }
break;
default:
- assert(false && "OS not supported");
break;
}
- if (reg_interface)
+ default:
+ break;
+ }
+
+ assert(reg_interface && "OS or CPU not supported!");
+
+ switch (target_arch.GetMachine())
+ {
+ case llvm::Triple::aarch64:
+ {
+ RegisterContextPOSIXProcessMonitor_arm64 *reg_ctx = new RegisterContextPOSIXProcessMonitor_arm64(*this, 0, reg_interface);
+ m_posix_thread = reg_ctx;
+ m_reg_context_sp.reset(reg_ctx);
+ break;
+ }
+ case llvm::Triple::mips64:
+ {
+ RegisterContextPOSIXProcessMonitor_mips64 *reg_ctx = new RegisterContextPOSIXProcessMonitor_mips64(*this, 0, reg_interface);
+ m_posix_thread = reg_ctx;
+ m_reg_context_sp.reset(reg_ctx);
+ break;
+ }
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
{
RegisterContextPOSIXProcessMonitor_x86_64 *reg_ctx = new RegisterContextPOSIXProcessMonitor_x86_64(*this, 0, reg_interface);
m_posix_thread = reg_ctx;
m_reg_context_sp.reset(reg_ctx);
+ break;
}
- break;
- }
-
default:
- assert(false && "CPU type not supported!");
break;
}
}
@@ -546,18 +573,14 @@ void
POSIXThread::SignalNotify(const ProcessMessage &message)
{
int signo = message.GetSignal();
-
SetStopInfo (StopInfo::CreateStopReasonWithSignal(*this, signo));
- SetResumeSignal(signo);
}
void
POSIXThread::SignalDeliveredNotify(const ProcessMessage &message)
{
int signo = message.GetSignal();
-
SetStopInfo (StopInfo::CreateStopReasonWithSignal(*this, signo));
- SetResumeSignal(signo);
}
void
@@ -576,7 +599,6 @@ POSIXThread::CrashNotify(const ProcessMessage &message)
SetStopInfo (lldb::StopInfoSP(new POSIXCrashStopInfo(*this, signo,
message.GetCrashReason(),
message.GetFaultAddress())));
- SetResumeSignal(signo);
}
void
@@ -589,19 +611,18 @@ unsigned
POSIXThread::GetRegisterIndexFromOffset(unsigned offset)
{
unsigned reg = LLDB_INVALID_REGNUM;
- ArchSpec arch = Host::GetArchitecture();
+ ArchSpec arch = HostInfo::GetArchitecture();
- switch (arch.GetCore())
+ switch (arch.GetMachine())
{
default:
llvm_unreachable("CPU type not supported!");
break;
- case ArchSpec::eCore_mips64:
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- case ArchSpec::eCore_x86_64_x86_64:
+ case llvm::Triple::aarch64:
+ case llvm::Triple::mips64:
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
{
POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol();
reg = reg_ctx->GetRegisterIndexFromOffset(offset);
@@ -621,19 +642,18 @@ const char *
POSIXThread::GetRegisterName(unsigned reg)
{
const char * name = nullptr;
- ArchSpec arch = Host::GetArchitecture();
+ ArchSpec arch = HostInfo::GetArchitecture();
- switch (arch.GetCore())
+ switch (arch.GetMachine())
{
default:
assert(false && "CPU type not supported!");
break;
- case ArchSpec::eCore_mips64:
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- case ArchSpec::eCore_x86_64_x86_64:
+ case llvm::Triple::aarch64:
+ case llvm::Triple::mips64:
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
name = GetRegisterContext()->GetRegisterName(reg);
break;
}
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 1a8bf89..f340631 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -70,8 +70,8 @@ ProcessPOSIX::Initialize()
//------------------------------------------------------------------------------
// Constructors and destructors.
-ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener)
- : Process(target, listener),
+ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener, UnixSignalsSP &unix_signals_sp)
+ : Process(target, listener, unix_signals_sp),
m_byte_order(lldb::endian::InlHostByteOrder()),
m_monitor(NULL),
m_module(NULL),
@@ -176,23 +176,23 @@ ProcessPOSIX::WillLaunch(Module* module)
}
const char *
-ProcessPOSIX::GetFilePath(
- const lldb_private::ProcessLaunchInfo::FileAction *file_action,
- const char *default_path)
+ProcessPOSIX::GetFilePath(const lldb_private::FileAction *file_action, const char *default_path)
{
const char *pts_name = "/dev/pts/";
const char *path = NULL;
if (file_action)
{
- if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen)
+ if (file_action->GetAction() == FileAction::eFileActionOpen)
+ {
path = file_action->GetPath();
// By default the stdio paths passed in will be pseudo-terminal
// (/dev/pts). If so, convert to using a different default path
// instead to redirect I/O to the debugger console. This should
// also handle user overrides to /dev/null or a different file.
- if (::strncmp(path, pts_name, ::strlen(pts_name)) == 0)
+ if (!path || ::strncmp(path, pts_name, ::strlen(pts_name)) == 0)
path = default_path;
+ }
}
return path;
@@ -217,7 +217,7 @@ ProcessPOSIX::DoLaunch (Module *module,
SetPrivateState(eStateLaunching);
- const lldb_private::ProcessLaunchInfo::FileAction *file_action;
+ const lldb_private::FileAction *file_action;
// Default of NULL will mean to use existing open file descriptors
const char *stdin_path = NULL;
@@ -241,6 +241,7 @@ ProcessPOSIX::DoLaunch (Module *module,
stdout_path,
stderr_path,
working_dir,
+ launch_info,
error);
m_module = module;
@@ -335,9 +336,9 @@ ProcessPOSIX::DoDestroy()
if (!HasExited())
{
- assert (m_monitor);
+ assert(m_monitor);
m_exit_now = true;
- if (m_monitor->BringProcessIntoLimbo())
+ if (!m_monitor->Kill())
{
error.SetErrorToErrno();
return error;
@@ -377,6 +378,8 @@ ProcessPOSIX::DoDidExec()
void
ProcessPOSIX::SendMessage(const ProcessMessage &message)
{
+ Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
+
Mutex::Locker lock(m_message_mutex);
Mutex::Locker thread_lock(m_thread_list.GetMutex());
@@ -418,8 +421,14 @@ ProcessPOSIX::SendMessage(const ProcessMessage &message)
break;
case ProcessMessage::eExitMessage:
- assert(thread);
- thread->SetState(eStateExited);
+ if (thread != nullptr)
+ thread->SetState(eStateExited);
+ else
+ {
+ if (log)
+ log->Warning ("ProcessPOSIX::%s eExitMessage for TID %" PRIu64 " failed to find a thread to mark as eStateExited, ignoring", __FUNCTION__, message.GetTID ());
+ }
+
// FIXME: I'm not sure we need to do this.
if (message.GetTID() == GetID())
{
@@ -633,20 +642,26 @@ ProcessPOSIX::DoDeallocateMemory(lldb::addr_t addr)
size_t
ProcessPOSIX::GetSoftwareBreakpointTrapOpcode(BreakpointSite* bp_site)
{
+ static const uint8_t g_aarch64_opcode[] = { 0x00, 0x00, 0x20, 0xD4 };
static const uint8_t g_i386_opcode[] = { 0xCC };
ArchSpec arch = GetTarget().GetArchitecture();
const uint8_t *opcode = NULL;
size_t opcode_size = 0;
- switch (arch.GetCore())
+ switch (arch.GetMachine())
{
default:
assert(false && "CPU type not supported!");
break;
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_64_x86_64:
+ case llvm::Triple::aarch64:
+ opcode = g_aarch64_opcode;
+ opcode_size = sizeof(g_aarch64_opcode);
+ break;
+
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
opcode = g_i386_opcode;
opcode_size = sizeof(g_i386_opcode);
break;
@@ -863,12 +878,6 @@ ProcessPOSIX::PutSTDIN(const char *buf, size_t len, Error &error)
return status;
}
-UnixSignals &
-ProcessPOSIX::GetUnixSignals()
-{
- return m_signals;
-}
-
//------------------------------------------------------------------------------
// Utility functions.
@@ -924,3 +933,16 @@ ProcessPOSIX::IsAThreadRunning()
}
return is_running;
}
+
+const DataBufferSP
+ProcessPOSIX::GetAuxvData ()
+{
+ // If we're the local platform, we can ask the host for auxv data.
+ PlatformSP platform_sp = m_target.GetPlatform ();
+ if (platform_sp && platform_sp->IsHost ())
+ return lldb_private::Host::GetAuxvData(this);
+
+ // Somewhat unexpected - the process is not running locally or we don't have a platform.
+ assert (false && "no platform or not the host - how did we get here with ProcessPOSIX?");
+ return DataBufferSP ();
+}
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
index 7f705d3..033accf 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
@@ -18,7 +18,6 @@
// Other libraries and framework includes
#include "lldb/Target/Process.h"
-#include "lldb/Target/UnixSignals.h"
#include "ProcessMessage.h"
class ProcessMonitor;
@@ -33,7 +32,8 @@ public:
// Constructors and destructors
//------------------------------------------------------------------
ProcessPOSIX(lldb_private::Target& target,
- lldb_private::Listener &listener);
+ lldb_private::Listener &listener,
+ lldb_private::UnixSignalsSP &unix_signals_sp);
virtual
~ProcessPOSIX();
@@ -141,6 +141,9 @@ public:
virtual size_t
PutSTDIN(const char *buf, size_t len, lldb_private::Error &error);
+ const lldb::DataBufferSP
+ GetAuxvData () override;
+
//--------------------------------------------------------------------------
// ProcessPOSIX internal API.
@@ -151,12 +154,7 @@ public:
ProcessMonitor &
GetMonitor() { assert(m_monitor); return *m_monitor; }
- lldb_private::UnixSignals &
- GetUnixSignals();
-
- const char *
- GetFilePath(const lldb_private::ProcessLaunchInfo::FileAction *file_action,
- const char *default_path);
+ const char *GetFilePath(const lldb_private::FileAction *file_action, const char *default_path);
/// Stops all threads in the process.
/// The \p stop_tid parameter indicates the thread which initiated the stop.
@@ -164,7 +162,7 @@ public:
StopAllThreads(lldb::tid_t stop_tid);
/// Adds the thread to the list of threads for which we have received the initial stopping signal.
- /// The \p stop_tid paramter indicates the thread which the stop happened for.
+ /// The \p stop_tid parameter indicates the thread which the stop happened for.
bool
AddThreadForInitialStopIfNeeded(lldb::tid_t stop_tid);
@@ -191,9 +189,6 @@ protected:
/// Drive any exit events to completion.
bool m_exit_now;
- /// OS-specific signal set.
- lldb_private::UnixSignals m_signals;
-
/// Returns true if the process has exited.
bool HasExited();
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp
deleted file mode 100644
index 01c9bb4..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===-- RegisterContextFreeBSD_i386.cpp ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include "RegisterContextPOSIX_x86.h"
-#include "RegisterContextFreeBSD_i386.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-// http://svnweb.freebsd.org/base/head/sys/x86/include/reg.h
-struct GPR
-{
- uint32_t fs;
- uint32_t es;
- uint32_t ds;
- uint32_t edi;
- uint32_t esi;
- uint32_t ebp;
- uint32_t isp;
- uint32_t ebx;
- uint32_t edx;
- uint32_t ecx;
- uint32_t eax;
- uint32_t trapno;
- uint32_t err;
- uint32_t eip;
- uint32_t cs;
- uint32_t eflags;
- uint32_t esp;
- uint32_t ss;
- uint32_t gs;
-};
-
-struct dbreg {
- uint32_t dr[8]; /* debug registers */
- /* Index 0-3: debug address registers */
- /* Index 4-5: reserved */
- /* Index 6: debug status */
- /* Index 7: debug control */
-};
-
-
-#define DR_SIZE sizeof(uint32_t)
-#define DR_OFFSET(reg_index) \
- (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
-
-//---------------------------------------------------------------------------
-// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
-//---------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_I386_STRUCT
-#include "RegisterInfos_i386.h"
-#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-
-RegisterContextFreeBSD_i386::RegisterContextFreeBSD_i386(const ArchSpec &target_arch) :
- RegisterInfoInterface(target_arch)
-{
-}
-
-RegisterContextFreeBSD_i386::~RegisterContextFreeBSD_i386()
-{
-}
-
-size_t
-RegisterContextFreeBSD_i386::GetGPRSize()
-{
- return sizeof(GPR);
-}
-
-const RegisterInfo *
-RegisterContextFreeBSD_i386::GetRegisterInfo()
-{
- switch (m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- return g_register_infos_i386;
- default:
- assert(false && "Unhandled target architecture.");
- return NULL;
- }
-}
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h
deleted file mode 100644
index 4ec2ad3..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- RegisterContextFreeBSD_i386.h ---------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextFreeBSD_i386_H_
-#define liblldb_RegisterContextFreeBSD_i386_H_
-
-#include "RegisterContextPOSIX.h"
-
-class RegisterContextFreeBSD_i386
- : public RegisterInfoInterface
-{
-public:
- RegisterContextFreeBSD_i386(const lldb_private::ArchSpec &target_arch);
- virtual ~RegisterContextFreeBSD_i386();
-
- size_t
- GetGPRSize();
-
- const lldb_private::RegisterInfo *
- GetRegisterInfo();
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp
deleted file mode 100644
index 4714251..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//===-- RegisterContextFreeBSD_mips64.cpp ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include <vector>
-#include "RegisterContextPOSIX_mips64.h"
-#include "RegisterContextFreeBSD_mips64.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-// http://svnweb.freebsd.org/base/head/sys/mips/include/regnum.h
-typedef struct _GPR
-{
- uint64_t zero;
- uint64_t r1;
- uint64_t r2;
- uint64_t r3;
- uint64_t r4;
- uint64_t r5;
- uint64_t r6;
- uint64_t r7;
- uint64_t r8;
- uint64_t r9;
- uint64_t r10;
- uint64_t r11;
- uint64_t r12;
- uint64_t r13;
- uint64_t r14;
- uint64_t r15;
- uint64_t r16;
- uint64_t r17;
- uint64_t r18;
- uint64_t r19;
- uint64_t r20;
- uint64_t r21;
- uint64_t r22;
- uint64_t r23;
- uint64_t r24;
- uint64_t r25;
- uint64_t r26;
- uint64_t r27;
- uint64_t gp;
- uint64_t sp;
- uint64_t r30;
- uint64_t ra;
- uint64_t sr;
- uint64_t mullo;
- uint64_t mulhi;
- uint64_t badvaddr;
- uint64_t cause;
- uint64_t pc;
- uint64_t ic;
- uint64_t dummy;
-} GPR;
-
-//---------------------------------------------------------------------------
-// Include RegisterInfos_mips64 to declare our g_register_infos_mips64 structure.
-//---------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_MIPS64_STRUCT
-#include "RegisterInfos_mips64.h"
-#undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT
-
-RegisterContextFreeBSD_mips64::RegisterContextFreeBSD_mips64(const ArchSpec &target_arch) :
- RegisterInfoInterface(target_arch)
-{
-}
-
-RegisterContextFreeBSD_mips64::~RegisterContextFreeBSD_mips64()
-{
-}
-
-size_t
-RegisterContextFreeBSD_mips64::GetGPRSize()
-{
- return sizeof(GPR);
-}
-
-const RegisterInfo *
-RegisterContextFreeBSD_mips64::GetRegisterInfo()
-{
- assert (m_target_arch.GetCore() == ArchSpec::eCore_mips64);
- return g_register_infos_mips64;
-}
-
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h
deleted file mode 100644
index 9ee7679..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- RegisterContextFreeBSD_mips64.h -------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextFreeBSD_mips64_H_
-#define liblldb_RegisterContextFreeBSD_mips64_H_
-
-#include "RegisterContextPOSIX.h"
-
-class RegisterContextFreeBSD_mips64:
- public RegisterInfoInterface
-{
-public:
- RegisterContextFreeBSD_mips64(const lldb_private::ArchSpec &target_arch);
- virtual ~RegisterContextFreeBSD_mips64();
-
- size_t
- GetGPRSize();
-
- const lldb_private::RegisterInfo *
- GetRegisterInfo();
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp
deleted file mode 100644
index 2162aaf..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//===-- RegisterContextFreeBSD_x86_64.cpp ----------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include <vector>
-#include "RegisterContextPOSIX_x86.h"
-#include "RegisterContextFreeBSD_i386.h"
-#include "RegisterContextFreeBSD_x86_64.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-// http://svnweb.freebsd.org/base/head/sys/x86/include/reg.h
-typedef struct _GPR
-{
- uint64_t r15;
- uint64_t r14;
- uint64_t r13;
- uint64_t r12;
- uint64_t r11;
- uint64_t r10;
- uint64_t r9;
- uint64_t r8;
- uint64_t rdi;
- uint64_t rsi;
- uint64_t rbp;
- uint64_t rbx;
- uint64_t rdx;
- uint64_t rcx;
- uint64_t rax;
- uint32_t trapno;
- uint16_t fs;
- uint16_t gs;
- uint32_t err;
- uint16_t es;
- uint16_t ds;
- uint64_t rip;
- uint64_t cs;
- uint64_t rflags;
- uint64_t rsp;
- uint64_t ss;
-} GPR;
-
-struct dbreg {
- uint64_t dr[16]; /* debug registers */
- /* Index 0-3: debug address registers */
- /* Index 4-5: reserved */
- /* Index 6: debug status */
- /* Index 7: debug control */
- /* Index 8-15: reserved */
-};
-
-#define DR_SIZE sizeof(uint64_t)
-#define DR_OFFSET(reg_index) \
- (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
-
-
-//---------------------------------------------------------------------------
-// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 structure.
-//---------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
-#include "RegisterInfos_x86_64.h"
-#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
-
-static const RegisterInfo *
-GetRegisterInfo_i386(const lldb_private::ArchSpec& arch)
-{
- static std::vector<lldb_private::RegisterInfo> g_register_infos;
-
- // Allocate RegisterInfo only once
- if (g_register_infos.empty())
- {
- // Copy the register information from base class
- std::unique_ptr<RegisterContextFreeBSD_i386> reg_interface(new RegisterContextFreeBSD_i386 (arch));
- const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
- g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]);
-
- //---------------------------------------------------------------------------
- // Include RegisterInfos_x86_64 to update the g_register_infos structure
- // with x86_64 offsets.
- //---------------------------------------------------------------------------
- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
- #include "RegisterInfos_x86_64.h"
- #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
- }
-
- return &g_register_infos[0];
-}
-
-RegisterContextFreeBSD_x86_64::RegisterContextFreeBSD_x86_64(const ArchSpec &target_arch) :
- RegisterInfoInterface(target_arch)
-{
-}
-
-RegisterContextFreeBSD_x86_64::~RegisterContextFreeBSD_x86_64()
-{
-}
-
-size_t
-RegisterContextFreeBSD_x86_64::GetGPRSize()
-{
- return sizeof(GPR);
-}
-
-const RegisterInfo *
-RegisterContextFreeBSD_x86_64::GetRegisterInfo()
-{
- switch (m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- return GetRegisterInfo_i386 (m_target_arch);
- case ArchSpec::eCore_x86_64_x86_64:
- return g_register_infos_x86_64;
- default:
- assert(false && "Unhandled target architecture.");
- return NULL;
- }
-}
-
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h
deleted file mode 100644
index 731bb0e..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- RegisterContextFreeBSD_x86_64.h -------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextFreeBSD_x86_64_H_
-#define liblldb_RegisterContextFreeBSD_x86_64_H_
-
-#include "RegisterContextPOSIX.h"
-
-class RegisterContextFreeBSD_x86_64:
- public RegisterInfoInterface
-{
-public:
- RegisterContextFreeBSD_x86_64(const lldb_private::ArchSpec &target_arch);
- virtual ~RegisterContextFreeBSD_x86_64();
-
- size_t
- GetGPRSize();
-
- const lldb_private::RegisterInfo *
- GetRegisterInfo();
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp
deleted file mode 100644
index 0828efb..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//===-- RegisterContextLinux_i386.cpp --------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include "RegisterContextPOSIX_x86.h"
-#include "RegisterContextLinux_i386.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-struct GPR
-{
- uint32_t ebx;
- uint32_t ecx;
- uint32_t edx;
- uint32_t esi;
- uint32_t edi;
- uint32_t ebp;
- uint32_t eax;
- uint32_t ds;
- uint32_t es;
- uint32_t fs;
- uint32_t gs;
- uint32_t orig_ax;
- uint32_t eip;
- uint32_t cs;
- uint32_t eflags;
- uint32_t esp;
- uint32_t ss;
-};
-
-struct UserArea
-{
- GPR regs; // General purpose registers.
- int32_t fpvalid; // True if FPU is being used.
- FXSAVE i387; // FPU registers.
- uint32_t tsize; // Text segment size.
- uint32_t dsize; // Data segment size.
- uint32_t ssize; // Stack segment size.
- uint32_t start_code; // VM address of text.
- uint32_t start_stack; // VM address of stack bottom (top in rsp).
- int32_t signal; // Signal causing core dump.
- int32_t reserved; // Unused.
- uint32_t ar0; // Location of GPR's.
- uint32_t fpstate; // Location of FPR's. Should be a FXSTATE *, but this
- // has to be 32-bits even on 64-bit systems.
- uint32_t magic; // Identifier for core dumps.
- char u_comm[32]; // Command causing core dump.
- uint32_t u_debugreg[8]; // Debug registers (DR0 - DR7).
-};
-
-#define DR_SIZE sizeof(UserArea::u_debugreg[0])
-#define DR_OFFSET(reg_index) \
- (LLVM_EXTENSION offsetof(UserArea, u_debugreg[reg_index]))
-
-//---------------------------------------------------------------------------
-// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
-//---------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_I386_STRUCT
-#include "RegisterInfos_i386.h"
-#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-
-RegisterContextLinux_i386::RegisterContextLinux_i386(const ArchSpec &target_arch) :
- RegisterInfoInterface(target_arch)
-{
-}
-
-RegisterContextLinux_i386::~RegisterContextLinux_i386()
-{
-}
-
-size_t
-RegisterContextLinux_i386::GetGPRSize()
-{
- return sizeof(GPR);
-}
-
-const RegisterInfo *
-RegisterContextLinux_i386::GetRegisterInfo()
-{
- switch (m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- return g_register_infos_i386;
- default:
- assert(false && "Unhandled target architecture.");
- return NULL;
- }
-}
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h
deleted file mode 100644
index 81afdbf..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- RegisterContextLinux_i386.h -----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextLinux_i386_H_
-#define liblldb_RegisterContextLinux_i386_H_
-
-#include "RegisterContextPOSIX.h"
-
-class RegisterContextLinux_i386
- : public RegisterInfoInterface
-{
-public:
- RegisterContextLinux_i386(const lldb_private::ArchSpec &target_arch);
- virtual ~RegisterContextLinux_i386();
-
- size_t
- GetGPRSize();
-
- const lldb_private::RegisterInfo *
- GetRegisterInfo();
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp
deleted file mode 100644
index 5434ddf..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===-- RegisterContextLinux_x86_64.cpp ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-#include <vector>
-#include "RegisterContextPOSIX_x86.h"
-#include "RegisterContextLinux_i386.h"
-#include "RegisterContextLinux_x86_64.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-typedef struct _GPR
-{
- uint64_t r15;
- uint64_t r14;
- uint64_t r13;
- uint64_t r12;
- uint64_t rbp;
- uint64_t rbx;
- uint64_t r11;
- uint64_t r10;
- uint64_t r9;
- uint64_t r8;
- uint64_t rax;
- uint64_t rcx;
- uint64_t rdx;
- uint64_t rsi;
- uint64_t rdi;
- uint64_t orig_ax;
- uint64_t rip;
- uint64_t cs;
- uint64_t rflags;
- uint64_t rsp;
- uint64_t ss;
- uint64_t fs_base;
- uint64_t gs_base;
- uint64_t ds;
- uint64_t es;
- uint64_t fs;
- uint64_t gs;
-} GPR;
-
-struct UserArea
-{
- GPR gpr; // General purpose registers.
- int32_t fpvalid; // True if FPU is being used.
- int32_t pad0;
- FXSAVE i387; // General purpose floating point registers (see FPR for extended register sets).
- uint64_t tsize; // Text segment size.
- uint64_t dsize; // Data segment size.
- uint64_t ssize; // Stack segment size.
- uint64_t start_code; // VM address of text.
- uint64_t start_stack; // VM address of stack bottom (top in rsp).
- int64_t signal; // Signal causing core dump.
- int32_t reserved; // Unused.
- int32_t pad1;
- uint64_t ar0; // Location of GPR's.
- FXSAVE* fpstate; // Location of FPR's.
- uint64_t magic; // Identifier for core dumps.
- char u_comm[32]; // Command causing core dump.
- uint64_t u_debugreg[8]; // Debug registers (DR0 - DR7).
- uint64_t error_code; // CPU error code.
- uint64_t fault_address; // Control register CR3.
-};
-
-#define DR_SIZE sizeof(UserArea::u_debugreg[0])
-#define DR_OFFSET(reg_index) \
- (LLVM_EXTENSION offsetof(UserArea, u_debugreg[reg_index]))
-
-//---------------------------------------------------------------------------
-// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 structure.
-//---------------------------------------------------------------------------
-#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
-#include "RegisterInfos_x86_64.h"
-#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
-
-static const RegisterInfo *
-GetRegisterInfo_i386(const lldb_private::ArchSpec &arch)
-{
- static std::vector<lldb_private::RegisterInfo> g_register_infos;
-
- // Allocate RegisterInfo only once
- if (g_register_infos.empty())
- {
- // Copy the register information from base class
- std::unique_ptr<RegisterContextLinux_i386> reg_interface(new RegisterContextLinux_i386 (arch));
- const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
- g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]);
-
- //---------------------------------------------------------------------------
- // Include RegisterInfos_x86_64 to update the g_register_infos structure
- // with x86_64 offsets.
- //---------------------------------------------------------------------------
- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
- #include "RegisterInfos_x86_64.h"
- #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
- }
-
- return &g_register_infos[0];
-}
-
-RegisterContextLinux_x86_64::RegisterContextLinux_x86_64(const ArchSpec &target_arch) :
- RegisterInfoInterface(target_arch)
-{
-}
-
-RegisterContextLinux_x86_64::~RegisterContextLinux_x86_64()
-{
-}
-
-size_t
-RegisterContextLinux_x86_64::GetGPRSize()
-{
- return sizeof(GPR);
-}
-
-const RegisterInfo *
-RegisterContextLinux_x86_64::GetRegisterInfo()
-{
- switch (m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- return GetRegisterInfo_i386 (m_target_arch);
- case ArchSpec::eCore_x86_64_x86_64:
- return g_register_infos_x86_64;
- default:
- assert(false && "Unhandled target architecture.");
- return NULL;
- }
-}
-
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h
deleted file mode 100644
index 21c809b..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- RegisterContextLinux_x86_64.h ---------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextLinux_x86_64_H_
-#define liblldb_RegisterContextLinux_x86_64_H_
-
-#include "RegisterContextPOSIX.h"
-
-class RegisterContextLinux_x86_64
- : public RegisterInfoInterface
-{
-public:
- RegisterContextLinux_x86_64(const lldb_private::ArchSpec &target_arch);
- virtual ~RegisterContextLinux_x86_64();
-
- size_t
- GetGPRSize();
-
- const lldb_private::RegisterInfo *
- GetRegisterInfo();
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h
deleted file mode 100644
index 600dae7..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//===-- RegisterContextPOSIX.h --------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextPOSIX_H_
-#define liblldb_RegisterContextPOSIX_H_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-#include "lldb/Core/ArchSpec.h"
-#include "lldb/Target/RegisterContext.h"
-
-//------------------------------------------------------------------------------
-/// @class POSIXBreakpointProtocol
-///
-/// @brief Extends RegisterClass with a few virtual operations useful on POSIX.
-class POSIXBreakpointProtocol
-{
-public:
- POSIXBreakpointProtocol()
- { m_watchpoints_initialized = false; }
- virtual ~POSIXBreakpointProtocol() {}
-
- /// Updates the register state of the associated thread after hitting a
- /// breakpoint (if that make sense for the architecture). Default
- /// implementation simply returns true for architectures which do not
- /// require any update.
- ///
- /// @return
- /// True if the operation succeeded and false otherwise.
- virtual bool UpdateAfterBreakpoint() = 0;
-
- /// Determines the index in lldb's register file given a kernel byte offset.
- virtual unsigned
- GetRegisterIndexFromOffset(unsigned offset) = 0;
-
- // Checks to see if a watchpoint specified by hw_index caused the inferior
- // to stop.
- virtual bool
- IsWatchpointHit (uint32_t hw_index) = 0;
-
- // Resets any watchpoints that have been hit.
- virtual bool
- ClearWatchpointHits () = 0;
-
- // Returns the watchpoint address associated with a watchpoint hardware
- // index.
- virtual lldb::addr_t
- GetWatchpointAddress (uint32_t hw_index) = 0;
-
- virtual bool
- IsWatchpointVacant (uint32_t hw_index) = 0;
-
- virtual bool
- SetHardwareWatchpointWithIndex (lldb::addr_t addr, size_t size,
- bool read, bool write,
- uint32_t hw_index) = 0;
-
- // From lldb_private::RegisterContext
- virtual uint32_t
- NumSupportedHardwareWatchpoints () = 0;
-
- // Force m_watchpoints_initialized to TRUE
- void
- ForceWatchpointsInitialized () {m_watchpoints_initialized = true;}
-
-protected:
- bool m_watchpoints_initialized;
-};
-
-//------------------------------------------------------------------------------
-/// @class RegisterInfoInterface
-///
-/// @brief RegisterInfo interface to patch RegisterInfo structure for archs.
-class RegisterInfoInterface
-{
-public:
- RegisterInfoInterface(const lldb_private::ArchSpec& target_arch) : m_target_arch(target_arch) {}
- virtual ~RegisterInfoInterface () {}
-
- virtual size_t
- GetGPRSize () = 0;
-
- virtual const lldb_private::RegisterInfo *
- GetRegisterInfo () = 0;
-
-public:
- lldb_private::ArchSpec m_target_arch;
-};
-
-#endif // #ifndef liblldb_RegisterContextPOSIX_H_
-
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.cpp
new file mode 100644
index 0000000..9109cdb
--- /dev/null
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.cpp
@@ -0,0 +1,318 @@
+//===-- RegisterContextPOSIXProcessMonitor_arm64.cpp -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+
+#include "lldb/Target/Thread.h"
+#include "lldb/Core/RegisterValue.h"
+
+#include "RegisterContextPOSIX_arm64.h"
+#include "ProcessPOSIX.h"
+#include "RegisterContextPOSIXProcessMonitor_arm64.h"
+#include "ProcessMonitor.h"
+
+#define REG_CONTEXT_SIZE (GetGPRSize())
+
+RegisterContextPOSIXProcessMonitor_arm64::RegisterContextPOSIXProcessMonitor_arm64(lldb_private::Thread &thread,
+ uint32_t concrete_frame_idx,
+ lldb_private::RegisterInfoInterface *register_info)
+ : RegisterContextPOSIX_arm64(thread, concrete_frame_idx, register_info)
+{
+}
+
+ProcessMonitor &
+RegisterContextPOSIXProcessMonitor_arm64::GetMonitor()
+{
+ lldb::ProcessSP base = CalculateProcess();
+ ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get());
+ return process->GetMonitor();
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ReadGPR()
+{
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.ReadGPR(m_thread.GetID(), &m_gpr_arm64, GetGPRSize());
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ReadFPR()
+{
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.ReadFPR(m_thread.GetID(), &m_fpr, sizeof m_fpr);
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::WriteGPR()
+{
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.WriteGPR(m_thread.GetID(), &m_gpr_arm64, GetGPRSize());
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::WriteFPR()
+{
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.WriteFPR(m_thread.GetID(), &m_fpr, sizeof m_fpr);
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ReadRegister(const unsigned reg,
+ lldb_private::RegisterValue &value)
+{
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.ReadRegisterValue(m_thread.GetID(),
+ GetRegisterOffset(reg),
+ GetRegisterName(reg),
+ GetRegisterSize(reg),
+ value);
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::WriteRegister(const unsigned reg,
+ const lldb_private::RegisterValue &value)
+{
+ unsigned reg_to_write = reg;
+ lldb_private::RegisterValue value_to_write = value;
+
+ // Check if this is a subregister of a full register.
+ const lldb_private::RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
+ if (reg_info->invalidate_regs && (reg_info->invalidate_regs[0] != LLDB_INVALID_REGNUM))
+ {
+ lldb_private::RegisterValue full_value;
+ uint32_t full_reg = reg_info->invalidate_regs[0];
+ const lldb_private::RegisterInfo *full_reg_info = GetRegisterInfoAtIndex(full_reg);
+
+ // Read the full register.
+ if (ReadRegister(full_reg_info, full_value))
+ {
+ lldb_private::Error error;
+ lldb::ByteOrder byte_order = GetByteOrder();
+ uint8_t dst[lldb_private::RegisterValue::kMaxRegisterByteSize];
+
+ // Get the bytes for the full register.
+ const uint32_t dest_size = full_value.GetAsMemoryData (full_reg_info,
+ dst,
+ sizeof(dst),
+ byte_order,
+ error);
+ if (error.Success() && dest_size)
+ {
+ uint8_t src[lldb_private::RegisterValue::kMaxRegisterByteSize];
+
+ // Get the bytes for the source data.
+ const uint32_t src_size = value.GetAsMemoryData (reg_info, src, sizeof(src), byte_order, error);
+ if (error.Success() && src_size && (src_size < dest_size))
+ {
+ // Copy the src bytes to the destination.
+ ::memcpy (dst + (reg_info->byte_offset & 0x1), src, src_size);
+ // Set this full register as the value to write.
+ value_to_write.SetBytes(dst, full_value.GetByteSize(), byte_order);
+ value_to_write.SetType(full_reg_info);
+ reg_to_write = full_reg;
+ }
+ }
+ }
+ }
+
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.WriteRegisterValue(m_thread.GetID(),
+ GetRegisterOffset(reg_to_write),
+ GetRegisterName(reg_to_write),
+ value_to_write);
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value)
+{
+ if (!reg_info)
+ return false;
+
+ const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
+
+ if (IsFPR(reg))
+ {
+ if (!ReadFPR())
+ return false;
+ }
+ else
+ {
+ uint32_t full_reg = reg;
+ bool is_subreg = reg_info->invalidate_regs && (reg_info->invalidate_regs[0] != LLDB_INVALID_REGNUM);
+
+ if (is_subreg)
+ {
+ // Read the full aligned 64-bit register.
+ full_reg = reg_info->invalidate_regs[0];
+ }
+ return ReadRegister(full_reg, value);
+ }
+
+ // Get pointer to m_fpr variable and set the data from it.
+ assert (reg_info->byte_offset < sizeof m_fpr);
+ uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset;
+ switch (reg_info->byte_size)
+ {
+ case 2:
+ value.SetUInt16(*(uint16_t *)src);
+ return true;
+ case 4:
+ value.SetUInt32(*(uint32_t *)src);
+ return true;
+ case 8:
+ value.SetUInt64(*(uint64_t *)src);
+ return true;
+ default:
+ assert(false && "Unhandled data size.");
+ return false;
+ }
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value)
+{
+ const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
+
+ if (IsGPR(reg))
+ return WriteRegister(reg, value);
+
+ return false;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ReadAllRegisterValues(lldb::DataBufferSP &data_sp)
+{
+ bool success = false;
+ data_sp.reset (new lldb_private::DataBufferHeap (REG_CONTEXT_SIZE, 0));
+ if (data_sp && ReadGPR () && ReadFPR ())
+ {
+ uint8_t *dst = data_sp->GetBytes();
+ success = dst != 0;
+
+ if (success)
+ {
+ ::memcpy (dst, &m_gpr_arm64, GetGPRSize());
+ dst += GetGPRSize();
+ ::memcpy (dst, &m_fpr, sizeof m_fpr);
+ }
+ }
+ return success;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::WriteAllRegisterValues(const lldb::DataBufferSP &data_sp)
+{
+ bool success = false;
+ if (data_sp && data_sp->GetByteSize() == REG_CONTEXT_SIZE)
+ {
+ uint8_t *src = data_sp->GetBytes();
+ if (src)
+ {
+ ::memcpy (&m_gpr_arm64, src, GetGPRSize());
+ if (WriteGPR()) {
+ src += GetGPRSize();
+ ::memcpy (&m_fpr, src, sizeof m_fpr);
+ success = WriteFPR();
+ }
+ }
+ }
+ return success;
+}
+
+uint32_t
+RegisterContextPOSIXProcessMonitor_arm64::SetHardwareWatchpoint(lldb::addr_t addr, size_t size,
+ bool read, bool write)
+{
+ const uint32_t num_hw_watchpoints = NumSupportedHardwareWatchpoints();
+ uint32_t hw_index;
+
+ for (hw_index = 0; hw_index < num_hw_watchpoints; ++hw_index)
+ {
+ if (IsWatchpointVacant(hw_index))
+ return SetHardwareWatchpointWithIndex(addr, size,
+ read, write,
+ hw_index);
+ }
+
+ return LLDB_INVALID_INDEX32;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ClearHardwareWatchpoint(uint32_t hw_index)
+{
+ return false;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::HardwareSingleStep(bool enable)
+{
+ return false;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::UpdateAfterBreakpoint()
+{
+ // PC points one byte past the int3 responsible for the breakpoint.
+ lldb::addr_t pc;
+
+ if ((pc = GetPC()) == LLDB_INVALID_ADDRESS)
+ return false;
+
+ SetPC(pc - 1);
+ return true;
+}
+
+unsigned
+RegisterContextPOSIXProcessMonitor_arm64::GetRegisterIndexFromOffset(unsigned offset)
+{
+ unsigned reg;
+ for (reg = 0; reg < k_num_registers_arm64; reg++)
+ {
+ if (GetRegisterInfo()[reg].byte_offset == offset)
+ break;
+ }
+ assert(reg < k_num_registers_arm64 && "Invalid register offset.");
+ return reg;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::IsWatchpointHit(uint32_t hw_index)
+{
+ return false;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::ClearWatchpointHits()
+{
+ return false;
+}
+
+lldb::addr_t
+RegisterContextPOSIXProcessMonitor_arm64::GetWatchpointAddress(uint32_t hw_index)
+{
+ return LLDB_INVALID_ADDRESS;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::IsWatchpointVacant(uint32_t hw_index)
+{
+ return false;
+}
+
+bool
+RegisterContextPOSIXProcessMonitor_arm64::SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
+ bool read, bool write,
+ uint32_t hw_index)
+{
+ return false;
+}
+
+uint32_t
+RegisterContextPOSIXProcessMonitor_arm64::NumSupportedHardwareWatchpoints()
+{
+ return 0;
+}
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.h
new file mode 100644
index 0000000..eb24d48
--- /dev/null
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_arm64.h
@@ -0,0 +1,95 @@
+//===-- RegisterContextPOSIXProcessMonitor_arm64.h --------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_RegisterContextPOSIXProcessMonitor_arm64_H_
+#define liblldb_RegisterContextPOSIXProcessMonitor_arm64_H_
+
+#include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
+
+class RegisterContextPOSIXProcessMonitor_arm64:
+ public RegisterContextPOSIX_arm64,
+ public POSIXBreakpointProtocol
+{
+public:
+ RegisterContextPOSIXProcessMonitor_arm64(lldb_private::Thread &thread,
+ uint32_t concrete_frame_idx,
+ lldb_private::RegisterInfoInterface *register_info);
+
+protected:
+ bool
+ ReadGPR();
+
+ bool
+ ReadFPR();
+
+ bool
+ WriteGPR();
+
+ bool
+ WriteFPR();
+
+ // lldb_private::RegisterContext
+ bool
+ ReadRegister(const unsigned reg, lldb_private::RegisterValue &value);
+
+ bool
+ WriteRegister(const unsigned reg, const lldb_private::RegisterValue &value);
+
+ bool
+ ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
+
+ bool
+ WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value);
+
+ bool
+ ReadAllRegisterValues(lldb::DataBufferSP &data_sp);
+
+ bool
+ WriteAllRegisterValues(const lldb::DataBufferSP &data_sp);
+
+ uint32_t
+ SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, bool write);
+
+ bool
+ ClearHardwareWatchpoint(uint32_t hw_index);
+
+ bool
+ HardwareSingleStep(bool enable);
+
+ // POSIXBreakpointProtocol
+ bool
+ UpdateAfterBreakpoint();
+
+ unsigned
+ GetRegisterIndexFromOffset(unsigned offset);
+
+ bool
+ IsWatchpointHit(uint32_t hw_index);
+
+ bool
+ ClearWatchpointHits();
+
+ lldb::addr_t
+ GetWatchpointAddress(uint32_t hw_index);
+
+ bool
+ IsWatchpointVacant(uint32_t hw_index);
+
+ bool
+ SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read, bool write, uint32_t hw_index);
+
+ uint32_t
+ NumSupportedHardwareWatchpoints();
+
+private:
+ ProcessMonitor &
+ GetMonitor();
+};
+
+#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp
index f70d00e..9bfe236 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp
@@ -22,7 +22,7 @@ using namespace lldb;
RegisterContextPOSIXProcessMonitor_mips64::RegisterContextPOSIXProcessMonitor_mips64(Thread &thread,
uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info)
+ lldb_private::RegisterInfoInterface *register_info)
: RegisterContextPOSIX_mips64(thread, concrete_frame_idx, register_info)
{
}
@@ -196,7 +196,6 @@ RegisterContextPOSIXProcessMonitor_mips64::ReadAllRegisterValues(DataBufferSP &d
if (success)
{
::memcpy (dst, &m_gpr_mips64, GetGPRSize());
- dst += GetGPRSize();
}
}
return success;
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h
index 8f545ee..79e4468 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h
@@ -10,7 +10,7 @@
#ifndef liblldb_RegisterContextPOSIXProcessMonitor_mips64_H_
#define liblldb_RegisterContextPOSIXProcessMonitor_mips64_H_
-#include "Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_mips64.h"
class RegisterContextPOSIXProcessMonitor_mips64:
public RegisterContextPOSIX_mips64,
@@ -19,7 +19,7 @@ class RegisterContextPOSIXProcessMonitor_mips64:
public:
RegisterContextPOSIXProcessMonitor_mips64(lldb_private::Thread &thread,
uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info);
+ lldb_private::RegisterInfoInterface *register_info);
protected:
bool
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp
index c446bbf..e534f3b 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp
@@ -53,7 +53,7 @@ size_and_rw_bits(size_t size, bool read, bool write)
RegisterContextPOSIXProcessMonitor_x86_64::RegisterContextPOSIXProcessMonitor_x86_64(Thread &thread,
uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info)
+ lldb_private::RegisterInfoInterface *register_info)
: RegisterContextPOSIX_x86(thread, concrete_frame_idx, register_info)
{
}
@@ -347,12 +347,12 @@ RegisterContextPOSIXProcessMonitor_x86_64::ReadAllRegisterValues(DataBufferSP &d
if (success)
{
- ::memcpy (dst, &m_gpr_x86_64, GetGPRSize());
- dst += GetGPRSize();
+ ::memcpy (dst, &m_gpr_x86_64, GetGPRSize());
+ dst += GetGPRSize();
+ if (GetFPRType() == eFXSAVE)
+ ::memcpy (dst, &m_fpr.xstate.fxsave, sizeof(m_fpr.xstate.fxsave));
}
- if (GetFPRType() == eFXSAVE)
- ::memcpy (dst, &m_fpr.xstate.fxsave, sizeof(m_fpr.xstate.fxsave));
-
+
if (GetFPRType() == eXSAVE)
{
ByteOrder byte_order = GetByteOrder();
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h
index 2b64fa8..2afb195 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h
@@ -10,7 +10,7 @@
#ifndef liblldb_RegisterContextPOSIXProcessMonitor_x86_H_
#define liblldb_RegisterContextPOSIXProcessMonitor_x86_H_
-#include "Plugins/Process/POSIX/RegisterContextPOSIX_x86.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h"
class RegisterContextPOSIXProcessMonitor_x86_64:
public RegisterContextPOSIX_x86,
@@ -19,7 +19,7 @@ class RegisterContextPOSIXProcessMonitor_x86_64:
public:
RegisterContextPOSIXProcessMonitor_x86_64(lldb_private::Thread &thread,
uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info);
+ lldb_private::RegisterInfoInterface *register_info);
protected:
bool
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp
deleted file mode 100644
index 45c99ae..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//===-- RegisterContextPOSIX_mips64.cpp -------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstring>
-#include <errno.h>
-#include <stdint.h>
-
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
-#include "lldb/Core/RegisterValue.h"
-#include "lldb/Core/Scalar.h"
-#include "lldb/Target/Target.h"
-#include "lldb/Target/Thread.h"
-#include "lldb/Host/Endian.h"
-#include "llvm/Support/Compiler.h"
-
-#include "ProcessPOSIX.h"
-#include "RegisterContextPOSIX_mips64.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-static const
-uint32_t g_gpr_regnums[] =
-{
- gpr_zero_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
-};
-
-// Number of register sets provided by this context.
-enum
-{
- k_num_register_sets = 1
-};
-
-static const RegisterSet
-g_reg_sets_mips64[k_num_register_sets] =
-{
- { "General Purpose Registers", "gpr", k_num_gpr_registers_mips64, g_gpr_regnums },
-};
-
-bool RegisterContextPOSIX_mips64::IsGPR(unsigned reg)
-{
- return reg <= k_num_gpr_registers_mips64; // GPR's come first.
-}
-
-bool
-RegisterContextPOSIX_mips64::IsFPR(unsigned reg)
-{
- // XXX
- return false;
-}
-
-RegisterContextPOSIX_mips64::RegisterContextPOSIX_mips64(Thread &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info)
- : RegisterContext(thread, concrete_frame_idx)
-{
- m_register_info_ap.reset(register_info);
-
- // elf-core yet to support ReadFPR()
- ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
-}
-
-RegisterContextPOSIX_mips64::~RegisterContextPOSIX_mips64()
-{
-}
-
-void
-RegisterContextPOSIX_mips64::Invalidate()
-{
-}
-
-void
-RegisterContextPOSIX_mips64::InvalidateAllRegisters()
-{
-}
-
-unsigned
-RegisterContextPOSIX_mips64::GetRegisterOffset(unsigned reg)
-{
- assert(reg < k_num_registers_mips64 && "Invalid register number.");
- return GetRegisterInfo()[reg].byte_offset;
-}
-
-unsigned
-RegisterContextPOSIX_mips64::GetRegisterSize(unsigned reg)
-{
- assert(reg < k_num_registers_mips64 && "Invalid register number.");
- return GetRegisterInfo()[reg].byte_size;
-}
-
-size_t
-RegisterContextPOSIX_mips64::GetRegisterCount()
-{
- size_t num_registers = k_num_registers_mips64;
- return num_registers;
-}
-
-size_t
-RegisterContextPOSIX_mips64::GetGPRSize()
-{
- return m_register_info_ap->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_ap->GetRegisterInfo ();
-}
-
-const RegisterInfo *
-RegisterContextPOSIX_mips64::GetRegisterInfoAtIndex(size_t reg)
-{
- if (reg < k_num_registers_mips64)
- return &GetRegisterInfo()[reg];
- else
- return NULL;
-}
-
-size_t
-RegisterContextPOSIX_mips64::GetRegisterSetCount()
-{
- size_t sets = 0;
- for (size_t set = 0; set < k_num_register_sets; ++set)
- {
- if (IsRegisterSetAvailable(set))
- ++sets;
- }
-
- return sets;
-}
-
-const RegisterSet *
-RegisterContextPOSIX_mips64::GetRegisterSet(size_t set)
-{
- if (IsRegisterSetAvailable(set))
- return &g_reg_sets_mips64[set];
- else
- return NULL;
-}
-
-const char *
-RegisterContextPOSIX_mips64::GetRegisterName(unsigned reg)
-{
- assert(reg < k_num_registers_mips64 && "Invalid register offset.");
- return GetRegisterInfo()[reg].name;
-}
-
-lldb::ByteOrder
-RegisterContextPOSIX_mips64::GetByteOrder()
-{
- // Get the target process whose privileged thread was used for the register read.
- lldb::ByteOrder byte_order = eByteOrderInvalid;
- Process *process = CalculateProcess().get();
-
- if (process)
- byte_order = process->GetByteOrder();
- return byte_order;
-}
-
-bool
-RegisterContextPOSIX_mips64::IsRegisterSetAvailable(size_t set_index)
-{
- size_t num_sets = k_num_register_sets;
-
- 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(uint32_t kind,
- uint32_t num)
-{
- const uint32_t num_regs = GetRegisterCount();
-
- 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/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h
deleted file mode 100644
index a2a7d1f..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- RegisterContextPOSIX_mips64.h ---------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextPOSIX_mips64_H_
-#define liblldb_RegisterContextPOSIX_mips64_H_
-
-#include "lldb/Core/Log.h"
-#include "RegisterContextPOSIX.h"
-#include "RegisterContext_mips64.h"
-
-class ProcessMonitor;
-
-// ---------------------------------------------------------------------------
-// Internal codes for all mips64 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_num_registers_mips64,
- k_num_gpr_registers_mips64 = k_num_registers_mips64
-};
-
-class RegisterContextPOSIX_mips64
- : public lldb_private::RegisterContext
-{
-public:
- RegisterContextPOSIX_mips64 (lldb_private::Thread &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info);
-
- ~RegisterContextPOSIX_mips64();
-
- void
- Invalidate();
-
- void
- InvalidateAllRegisters();
-
- size_t
- GetRegisterCount();
-
- virtual size_t
- GetGPRSize();
-
- virtual unsigned
- GetRegisterSize(unsigned reg);
-
- virtual unsigned
- GetRegisterOffset(unsigned reg);
-
- const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex(size_t reg);
-
- size_t
- GetRegisterSetCount();
-
- const lldb_private::RegisterSet *
- GetRegisterSet(size_t set);
-
- const char *
- GetRegisterName(unsigned reg);
-
- uint32_t
- ConvertRegisterKindToRegisterNumber(uint32_t kind, uint32_t num);
-
-protected:
- uint64_t m_gpr_mips64[k_num_gpr_registers_mips64]; // general purpose registers.
- std::unique_ptr<RegisterInfoInterface> m_register_info_ap; // Register Info Interface (FreeBSD or 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);
-
- lldb::ByteOrder GetByteOrder();
-
- virtual bool ReadGPR() = 0;
- virtual bool ReadFPR() = 0;
- virtual bool WriteGPR() = 0;
- virtual bool WriteFPR() = 0;
-};
-
-#endif // #ifndef liblldb_RegisterContextPOSIX_mips64_H_
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp
deleted file mode 100644
index 9ae541a..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp
+++ /dev/null
@@ -1,666 +0,0 @@
-//===-- RegisterContextPOSIX_x86.cpp ----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstring>
-#include <errno.h>
-#include <stdint.h>
-
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
-#include "lldb/Core/RegisterValue.h"
-#include "lldb/Core/Scalar.h"
-#include "lldb/Target/Target.h"
-#include "lldb/Target/Thread.h"
-#include "lldb/Host/Endian.h"
-#include "llvm/Support/Compiler.h"
-
-#include "ProcessPOSIX.h"
-#include "RegisterContext_x86.h"
-#include "RegisterContextPOSIX_x86.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-const uint32_t
-g_gpr_regnums_i386[] =
-{
- gpr_eax_i386,
- gpr_ebx_i386,
- gpr_ecx_i386,
- gpr_edx_i386,
- gpr_edi_i386,
- gpr_esi_i386,
- gpr_ebp_i386,
- gpr_esp_i386,
- gpr_eip_i386,
- gpr_eflags_i386,
- gpr_cs_i386,
- gpr_fs_i386,
- gpr_gs_i386,
- gpr_ss_i386,
- gpr_ds_i386,
- gpr_es_i386,
- gpr_ax_i386,
- gpr_bx_i386,
- gpr_cx_i386,
- gpr_dx_i386,
- gpr_di_i386,
- gpr_si_i386,
- gpr_bp_i386,
- gpr_sp_i386,
- gpr_ah_i386,
- gpr_bh_i386,
- gpr_ch_i386,
- gpr_dh_i386,
- gpr_al_i386,
- gpr_bl_i386,
- gpr_cl_i386,
- gpr_dl_i386
-};
-static_assert((sizeof(g_gpr_regnums_i386) / sizeof(g_gpr_regnums_i386[0])) == k_num_gpr_registers_i386,
- "g_gpr_regnums_i386 has wrong number of register infos");
-
-const uint32_t
-g_fpu_regnums_i386[] =
-{
- fpu_fctrl_i386,
- fpu_fstat_i386,
- fpu_ftag_i386,
- fpu_fop_i386,
- fpu_fiseg_i386,
- fpu_fioff_i386,
- fpu_foseg_i386,
- fpu_fooff_i386,
- fpu_mxcsr_i386,
- fpu_mxcsrmask_i386,
- fpu_st0_i386,
- fpu_st1_i386,
- fpu_st2_i386,
- fpu_st3_i386,
- fpu_st4_i386,
- fpu_st5_i386,
- fpu_st6_i386,
- fpu_st7_i386,
- fpu_mm0_i386,
- fpu_mm1_i386,
- fpu_mm2_i386,
- fpu_mm3_i386,
- fpu_mm4_i386,
- fpu_mm5_i386,
- fpu_mm6_i386,
- fpu_mm7_i386,
- fpu_xmm0_i386,
- fpu_xmm1_i386,
- fpu_xmm2_i386,
- fpu_xmm3_i386,
- fpu_xmm4_i386,
- fpu_xmm5_i386,
- fpu_xmm6_i386,
- fpu_xmm7_i386
-};
-static_assert((sizeof(g_fpu_regnums_i386) / sizeof(g_fpu_regnums_i386[0])) == k_num_fpr_registers_i386,
- "g_fpu_regnums_i386 has wrong number of register infos");
-
-const uint32_t
-g_avx_regnums_i386[] =
-{
- fpu_ymm0_i386,
- fpu_ymm1_i386,
- fpu_ymm2_i386,
- fpu_ymm3_i386,
- fpu_ymm4_i386,
- fpu_ymm5_i386,
- fpu_ymm6_i386,
- fpu_ymm7_i386
-};
-static_assert((sizeof(g_avx_regnums_i386) / sizeof(g_avx_regnums_i386[0])) == k_num_avx_registers_i386,
- " g_avx_regnums_i386 has wrong number of register infos");
-
-static const
-uint32_t g_gpr_regnums_x86_64[] =
-{
- gpr_rax_x86_64,
- gpr_rbx_x86_64,
- gpr_rcx_x86_64,
- gpr_rdx_x86_64,
- gpr_rdi_x86_64,
- gpr_rsi_x86_64,
- gpr_rbp_x86_64,
- gpr_rsp_x86_64,
- gpr_r8_x86_64,
- gpr_r9_x86_64,
- gpr_r10_x86_64,
- gpr_r11_x86_64,
- gpr_r12_x86_64,
- gpr_r13_x86_64,
- gpr_r14_x86_64,
- gpr_r15_x86_64,
- gpr_rip_x86_64,
- gpr_rflags_x86_64,
- gpr_cs_x86_64,
- gpr_fs_x86_64,
- gpr_gs_x86_64,
- gpr_ss_x86_64,
- gpr_ds_x86_64,
- gpr_es_x86_64,
- gpr_eax_x86_64,
- gpr_ebx_x86_64,
- gpr_ecx_x86_64,
- gpr_edx_x86_64,
- gpr_edi_x86_64,
- gpr_esi_x86_64,
- gpr_ebp_x86_64,
- gpr_esp_x86_64,
- gpr_r8d_x86_64, // Low 32 bits or r8
- gpr_r9d_x86_64, // Low 32 bits or r9
- gpr_r10d_x86_64, // Low 32 bits or r10
- gpr_r11d_x86_64, // Low 32 bits or r11
- gpr_r12d_x86_64, // Low 32 bits or r12
- gpr_r13d_x86_64, // Low 32 bits or r13
- gpr_r14d_x86_64, // Low 32 bits or r14
- gpr_r15d_x86_64, // Low 32 bits or r15
- gpr_ax_x86_64,
- gpr_bx_x86_64,
- gpr_cx_x86_64,
- gpr_dx_x86_64,
- gpr_di_x86_64,
- gpr_si_x86_64,
- gpr_bp_x86_64,
- gpr_sp_x86_64,
- gpr_r8w_x86_64, // Low 16 bits or r8
- gpr_r9w_x86_64, // Low 16 bits or r9
- gpr_r10w_x86_64, // Low 16 bits or r10
- gpr_r11w_x86_64, // Low 16 bits or r11
- gpr_r12w_x86_64, // Low 16 bits or r12
- gpr_r13w_x86_64, // Low 16 bits or r13
- gpr_r14w_x86_64, // Low 16 bits or r14
- gpr_r15w_x86_64, // Low 16 bits or r15
- gpr_ah_x86_64,
- gpr_bh_x86_64,
- gpr_ch_x86_64,
- gpr_dh_x86_64,
- gpr_al_x86_64,
- gpr_bl_x86_64,
- gpr_cl_x86_64,
- gpr_dl_x86_64,
- gpr_dil_x86_64,
- gpr_sil_x86_64,
- gpr_bpl_x86_64,
- gpr_spl_x86_64,
- gpr_r8l_x86_64, // Low 8 bits or r8
- gpr_r9l_x86_64, // Low 8 bits or r9
- gpr_r10l_x86_64, // Low 8 bits or r10
- gpr_r11l_x86_64, // Low 8 bits or r11
- gpr_r12l_x86_64, // Low 8 bits or r12
- gpr_r13l_x86_64, // Low 8 bits or r13
- gpr_r14l_x86_64, // Low 8 bits or r14
- gpr_r15l_x86_64, // Low 8 bits or r15
-};
-static_assert((sizeof(g_gpr_regnums_x86_64) / sizeof(g_gpr_regnums_x86_64[0])) == k_num_gpr_registers_x86_64,
- "g_gpr_regnums_x86_64 has wrong number of register infos");
-
-static const uint32_t
-g_fpu_regnums_x86_64[] =
-{
- fpu_fctrl_x86_64,
- fpu_fstat_x86_64,
- fpu_ftag_x86_64,
- fpu_fop_x86_64,
- fpu_fiseg_x86_64,
- fpu_fioff_x86_64,
- fpu_foseg_x86_64,
- fpu_fooff_x86_64,
- fpu_mxcsr_x86_64,
- fpu_mxcsrmask_x86_64,
- fpu_st0_x86_64,
- fpu_st1_x86_64,
- fpu_st2_x86_64,
- fpu_st3_x86_64,
- fpu_st4_x86_64,
- fpu_st5_x86_64,
- fpu_st6_x86_64,
- fpu_st7_x86_64,
- fpu_mm0_x86_64,
- fpu_mm1_x86_64,
- fpu_mm2_x86_64,
- fpu_mm3_x86_64,
- fpu_mm4_x86_64,
- fpu_mm5_x86_64,
- fpu_mm6_x86_64,
- fpu_mm7_x86_64,
- fpu_xmm0_x86_64,
- fpu_xmm1_x86_64,
- fpu_xmm2_x86_64,
- fpu_xmm3_x86_64,
- fpu_xmm4_x86_64,
- fpu_xmm5_x86_64,
- fpu_xmm6_x86_64,
- fpu_xmm7_x86_64,
- fpu_xmm8_x86_64,
- fpu_xmm9_x86_64,
- fpu_xmm10_x86_64,
- fpu_xmm11_x86_64,
- fpu_xmm12_x86_64,
- fpu_xmm13_x86_64,
- fpu_xmm14_x86_64,
- fpu_xmm15_x86_64
-};
-static_assert((sizeof(g_fpu_regnums_x86_64) / sizeof(g_fpu_regnums_x86_64[0])) == k_num_fpr_registers_x86_64,
- "g_fpu_regnums_x86_64 has wrong number of register infos");
-
-static const uint32_t
-g_avx_regnums_x86_64[] =
-{
- fpu_ymm0_x86_64,
- fpu_ymm1_x86_64,
- fpu_ymm2_x86_64,
- fpu_ymm3_x86_64,
- fpu_ymm4_x86_64,
- fpu_ymm5_x86_64,
- fpu_ymm6_x86_64,
- fpu_ymm7_x86_64,
- fpu_ymm8_x86_64,
- fpu_ymm9_x86_64,
- fpu_ymm10_x86_64,
- fpu_ymm11_x86_64,
- fpu_ymm12_x86_64,
- fpu_ymm13_x86_64,
- fpu_ymm14_x86_64,
- fpu_ymm15_x86_64
-};
-static_assert((sizeof(g_avx_regnums_x86_64) / sizeof(g_avx_regnums_x86_64[0])) == k_num_avx_registers_x86_64,
- "g_avx_regnums_x86_64 has wrong number of register infos");
-
-uint32_t RegisterContextPOSIX_x86::g_contained_eax[] = { gpr_eax_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_ebx[] = { gpr_ebx_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_ecx[] = { gpr_ecx_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_edx[] = { gpr_edx_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_edi[] = { gpr_edi_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_esi[] = { gpr_esi_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_ebp[] = { gpr_ebp_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_esp[] = { gpr_esp_i386, LLDB_INVALID_REGNUM };
-
-uint32_t RegisterContextPOSIX_x86::g_invalidate_eax[] = { gpr_eax_i386, gpr_ax_i386, gpr_ah_i386, gpr_al_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_ebx[] = { gpr_ebx_i386, gpr_bx_i386, gpr_bh_i386, gpr_bl_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_ecx[] = { gpr_ecx_i386, gpr_cx_i386, gpr_ch_i386, gpr_cl_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_edx[] = { gpr_edx_i386, gpr_dx_i386, gpr_dh_i386, gpr_dl_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_edi[] = { gpr_edi_i386, gpr_di_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_esi[] = { gpr_esi_i386, gpr_si_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_ebp[] = { gpr_ebp_i386, gpr_bp_i386, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_esp[] = { gpr_esp_i386, gpr_sp_i386, LLDB_INVALID_REGNUM };
-
-uint32_t RegisterContextPOSIX_x86::g_contained_rax[] = { gpr_rax_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rbx[] = { gpr_rbx_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rcx[] = { gpr_rcx_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rdx[] = { gpr_rdx_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rdi[] = { gpr_rdi_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rsi[] = { gpr_rsi_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rbp[] = { gpr_rbp_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_rsp[] = { gpr_rsp_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r8[] = { gpr_r8_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r9[] = { gpr_r9_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r10[] = { gpr_r10_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r11[] = { gpr_r11_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r12[] = { gpr_r12_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r13[] = { gpr_r13_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r14[] = { gpr_r14_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_contained_r15[] = { gpr_r15_x86_64, LLDB_INVALID_REGNUM };
-
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rax[] = { gpr_rax_x86_64, gpr_eax_x86_64, gpr_ax_x86_64, gpr_ah_x86_64, gpr_al_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rbx[] = { gpr_rbx_x86_64, gpr_ebx_x86_64, gpr_bx_x86_64, gpr_bh_x86_64, gpr_bl_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rcx[] = { gpr_rcx_x86_64, gpr_ecx_x86_64, gpr_cx_x86_64, gpr_ch_x86_64, gpr_cl_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rdx[] = { gpr_rdx_x86_64, gpr_edx_x86_64, gpr_dx_x86_64, gpr_dh_x86_64, gpr_dl_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rdi[] = { gpr_rdi_x86_64, gpr_edi_x86_64, gpr_di_x86_64, gpr_dil_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rsi[] = { gpr_rsi_x86_64, gpr_esi_x86_64, gpr_si_x86_64, gpr_sil_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rbp[] = { gpr_rbp_x86_64, gpr_ebp_x86_64, gpr_bp_x86_64, gpr_bpl_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_rsp[] = { gpr_rsp_x86_64, gpr_esp_x86_64, gpr_sp_x86_64, gpr_spl_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r8[] = { gpr_r8_x86_64, gpr_r8d_x86_64, gpr_r8w_x86_64, gpr_r8l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r9[] = { gpr_r9_x86_64, gpr_r9d_x86_64, gpr_r9w_x86_64, gpr_r9l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r10[] = { gpr_r10_x86_64, gpr_r10d_x86_64, gpr_r10w_x86_64, gpr_r10l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r11[] = { gpr_r11_x86_64, gpr_r11d_x86_64, gpr_r11w_x86_64, gpr_r11l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r12[] = { gpr_r12_x86_64, gpr_r12d_x86_64, gpr_r12w_x86_64, gpr_r12l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r13[] = { gpr_r13_x86_64, gpr_r13d_x86_64, gpr_r13w_x86_64, gpr_r13l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r14[] = { gpr_r14_x86_64, gpr_r14d_x86_64, gpr_r14w_x86_64, gpr_r14l_x86_64, LLDB_INVALID_REGNUM };
-uint32_t RegisterContextPOSIX_x86::g_invalidate_r15[] = { gpr_r15_x86_64, gpr_r15d_x86_64, gpr_r15w_x86_64, gpr_r15l_x86_64, LLDB_INVALID_REGNUM };
-
-// Number of register sets provided by this context.
-enum
-{
- k_num_extended_register_sets = 1,
- k_num_register_sets = 3
-};
-
-static const RegisterSet
-g_reg_sets_i386[k_num_register_sets] =
-{
- { "General Purpose Registers", "gpr", k_num_gpr_registers_i386, g_gpr_regnums_i386 },
- { "Floating Point Registers", "fpu", k_num_fpr_registers_i386, g_fpu_regnums_i386 },
- { "Advanced Vector Extensions", "avx", k_num_avx_registers_i386, g_avx_regnums_i386 }
-};
-
-static const RegisterSet
-g_reg_sets_x86_64[k_num_register_sets] =
-{
- { "General Purpose Registers", "gpr", k_num_gpr_registers_x86_64, g_gpr_regnums_x86_64 },
- { "Floating Point Registers", "fpu", k_num_fpr_registers_x86_64, g_fpu_regnums_x86_64 },
- { "Advanced Vector Extensions", "avx", k_num_avx_registers_x86_64, g_avx_regnums_x86_64 }
-};
-
-bool RegisterContextPOSIX_x86::IsGPR(unsigned reg)
-{
- return reg <= m_reg_info.last_gpr; // GPR's come first.
-}
-
-bool RegisterContextPOSIX_x86::IsFPR(unsigned reg)
-{
- return (m_reg_info.first_fpr <= reg && reg <= m_reg_info.last_fpr);
-}
-
-bool RegisterContextPOSIX_x86::IsAVX(unsigned reg)
-{
- return (m_reg_info.first_ymm <= reg && reg <= m_reg_info.last_ymm);
-}
-
-bool RegisterContextPOSIX_x86::IsFPR(unsigned reg, FPRType fpr_type)
-{
- bool generic_fpr = IsFPR(reg);
-
- if (fpr_type == eXSAVE)
- return generic_fpr || IsAVX(reg);
- return generic_fpr;
-}
-
-RegisterContextPOSIX_x86::RegisterContextPOSIX_x86(Thread &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info)
- : RegisterContext(thread, concrete_frame_idx)
-{
- m_register_info_ap.reset(register_info);
-
- switch (register_info->m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- m_reg_info.num_registers = k_num_registers_i386;
- m_reg_info.num_gpr_registers = k_num_gpr_registers_i386;
- m_reg_info.num_fpr_registers = k_num_fpr_registers_i386;
- m_reg_info.num_avx_registers = k_num_avx_registers_i386;
- m_reg_info.last_gpr = k_last_gpr_i386;
- m_reg_info.first_fpr = k_first_fpr_i386;
- m_reg_info.last_fpr = k_last_fpr_i386;
- m_reg_info.first_st = fpu_st0_i386;
- m_reg_info.last_st = fpu_st7_i386;
- m_reg_info.first_mm = fpu_mm0_i386;
- m_reg_info.last_mm = fpu_mm7_i386;
- m_reg_info.first_xmm = fpu_xmm0_i386;
- m_reg_info.last_xmm = fpu_xmm7_i386;
- m_reg_info.first_ymm = fpu_ymm0_i386;
- m_reg_info.last_ymm = fpu_ymm7_i386;
- m_reg_info.first_dr = dr0_i386;
- m_reg_info.gpr_flags = gpr_eflags_i386;
- break;
- case ArchSpec::eCore_x86_64_x86_64:
- m_reg_info.num_registers = k_num_registers_x86_64;
- m_reg_info.num_gpr_registers = k_num_gpr_registers_x86_64;
- m_reg_info.num_fpr_registers = k_num_fpr_registers_x86_64;
- m_reg_info.num_avx_registers = k_num_avx_registers_x86_64;
- m_reg_info.last_gpr = k_last_gpr_x86_64;
- m_reg_info.first_fpr = k_first_fpr_x86_64;
- m_reg_info.last_fpr = k_last_fpr_x86_64;
- m_reg_info.first_st = fpu_st0_x86_64;
- m_reg_info.last_st = fpu_st7_x86_64;
- m_reg_info.first_mm = fpu_mm0_x86_64;
- m_reg_info.last_mm = fpu_mm7_x86_64;
- m_reg_info.first_xmm = fpu_xmm0_x86_64;
- m_reg_info.last_xmm = fpu_xmm15_x86_64;
- m_reg_info.first_ymm = fpu_ymm0_x86_64;
- m_reg_info.last_ymm = fpu_ymm15_x86_64;
- m_reg_info.first_dr = dr0_x86_64;
- m_reg_info.gpr_flags = gpr_rflags_x86_64;
- break;
- default:
- assert(false && "Unhandled target architecture.");
- break;
- }
-
- // Initialize m_iovec to point to the buffer and buffer size
- // using the conventions of Berkeley style UIO structures, as required
- // by PTRACE extensions.
- m_iovec.iov_base = &m_fpr.xstate.xsave;
- m_iovec.iov_len = sizeof(m_fpr.xstate.xsave);
-
- ::memset(&m_fpr, 0, sizeof(FPR));
-
- // elf-core yet to support ReadFPR()
- ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
-
- m_fpr_type = eNotValid;
-}
-
-RegisterContextPOSIX_x86::~RegisterContextPOSIX_x86()
-{
-}
-
-RegisterContextPOSIX_x86::FPRType RegisterContextPOSIX_x86::GetFPRType()
-{
- if (m_fpr_type == eNotValid)
- {
- // TODO: Use assembly to call cpuid on the inferior and query ebx or ecx
- m_fpr_type = eXSAVE; // extended floating-point registers, if available
- if (false == ReadFPR())
- m_fpr_type = eFXSAVE; // assume generic floating-point registers
- }
- return m_fpr_type;
-}
-
-void
-RegisterContextPOSIX_x86::Invalidate()
-{
-}
-
-void
-RegisterContextPOSIX_x86::InvalidateAllRegisters()
-{
-}
-
-unsigned
-RegisterContextPOSIX_x86::GetRegisterOffset(unsigned reg)
-{
- assert(reg < m_reg_info.num_registers && "Invalid register number.");
- return GetRegisterInfo()[reg].byte_offset;
-}
-
-unsigned
-RegisterContextPOSIX_x86::GetRegisterSize(unsigned reg)
-{
- assert(reg < m_reg_info.num_registers && "Invalid register number.");
- return GetRegisterInfo()[reg].byte_size;
-}
-
-size_t
-RegisterContextPOSIX_x86::GetRegisterCount()
-{
- size_t num_registers = m_reg_info.num_gpr_registers + m_reg_info.num_fpr_registers;
- if (GetFPRType() == eXSAVE)
- return num_registers + m_reg_info.num_avx_registers;
- return num_registers;
-}
-
-size_t
-RegisterContextPOSIX_x86::GetGPRSize()
-{
- return m_register_info_ap->GetGPRSize ();
-}
-
-const RegisterInfo *
-RegisterContextPOSIX_x86::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_ap->GetRegisterInfo ();
-}
-
-const RegisterInfo *
-RegisterContextPOSIX_x86::GetRegisterInfoAtIndex(size_t reg)
-{
- if (reg < m_reg_info.num_registers)
- return &GetRegisterInfo()[reg];
- else
- return NULL;
-}
-
-size_t
-RegisterContextPOSIX_x86::GetRegisterSetCount()
-{
- size_t sets = 0;
- for (size_t set = 0; set < k_num_register_sets; ++set)
- {
- if (IsRegisterSetAvailable(set))
- ++sets;
- }
-
- return sets;
-}
-
-const RegisterSet *
-RegisterContextPOSIX_x86::GetRegisterSet(size_t set)
-{
- if (IsRegisterSetAvailable(set))
- {
- switch (m_register_info_ap->m_target_arch.GetCore())
- {
- case ArchSpec::eCore_x86_32_i386:
- case ArchSpec::eCore_x86_32_i486:
- case ArchSpec::eCore_x86_32_i486sx:
- return &g_reg_sets_i386[set];
- case ArchSpec::eCore_x86_64_x86_64:
- return &g_reg_sets_x86_64[set];
- default:
- assert(false && "Unhandled target architecture.");
- return NULL;
- }
- }
- return NULL;
-}
-
-const char *
-RegisterContextPOSIX_x86::GetRegisterName(unsigned reg)
-{
- assert(reg < m_reg_info.num_registers && "Invalid register offset.");
- return GetRegisterInfo()[reg].name;
-}
-
-lldb::ByteOrder
-RegisterContextPOSIX_x86::GetByteOrder()
-{
- // Get the target process whose privileged thread was used for the register read.
- lldb::ByteOrder byte_order = eByteOrderInvalid;
- Process *process = CalculateProcess().get();
-
- if (process)
- byte_order = process->GetByteOrder();
- return byte_order;
-}
-
-// Parse ymm registers and into xmm.bytes and ymmh.bytes.
-bool RegisterContextPOSIX_x86::CopyYMMtoXSTATE(uint32_t reg, lldb::ByteOrder byte_order)
-{
- if (!IsAVX(reg))
- return false;
-
- if (byte_order == eByteOrderLittle)
- {
- ::memcpy(m_fpr.xstate.fxsave.xmm[reg - m_reg_info.first_ymm].bytes,
- m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
- sizeof(XMMReg));
- ::memcpy(m_fpr.xstate.xsave.ymmh[reg - m_reg_info.first_ymm].bytes,
- m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes + sizeof(XMMReg),
- sizeof(YMMHReg));
- return true;
- }
-
- if (byte_order == eByteOrderBig)
- {
- ::memcpy(m_fpr.xstate.fxsave.xmm[reg - m_reg_info.first_ymm].bytes,
- m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes + sizeof(XMMReg),
- sizeof(XMMReg));
- ::memcpy(m_fpr.xstate.xsave.ymmh[reg - m_reg_info.first_ymm].bytes,
- m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
- sizeof(YMMHReg));
- return true;
- }
- return false; // unsupported or invalid byte order
-}
-
-// Concatenate xmm.bytes with ymmh.bytes
-bool RegisterContextPOSIX_x86::CopyXSTATEtoYMM(uint32_t reg, lldb::ByteOrder byte_order)
-{
- if (!IsAVX(reg))
- return false;
-
- if (byte_order == eByteOrderLittle)
- {
- ::memcpy(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
- m_fpr.xstate.fxsave.xmm[reg - m_reg_info.first_ymm].bytes,
- sizeof(XMMReg));
- ::memcpy(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes + sizeof(XMMReg),
- m_fpr.xstate.xsave.ymmh[reg - m_reg_info.first_ymm].bytes,
- sizeof(YMMHReg));
- return true;
- }
-
- if (byte_order == eByteOrderBig)
- {
- ::memcpy(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes + sizeof(XMMReg),
- m_fpr.xstate.fxsave.xmm[reg - m_reg_info.first_ymm].bytes,
- sizeof(XMMReg));
- ::memcpy(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
- m_fpr.xstate.xsave.ymmh[reg - m_reg_info.first_ymm].bytes,
- sizeof(YMMHReg));
- return true;
- }
- return false; // unsupported or invalid byte order
-}
-
-bool
-RegisterContextPOSIX_x86::IsRegisterSetAvailable(size_t set_index)
-{
- // Note: Extended register sets are assumed to be at the end of g_reg_sets...
- size_t num_sets = k_num_register_sets - k_num_extended_register_sets;
-
- if (GetFPRType() == eXSAVE) // ...and to start with AVX registers.
- ++num_sets;
- 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_x86::ConvertRegisterKindToRegisterNumber(uint32_t kind,
- uint32_t num)
-{
- const uint32_t num_regs = GetRegisterCount();
-
- 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/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h
deleted file mode 100644
index 5e92202..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h
+++ /dev/null
@@ -1,462 +0,0 @@
-//===-- RegisterContextPOSIX_x86.h ------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContextPOSIX_x86_H_
-#define liblldb_RegisterContextPOSIX_x86_H_
-
-#include "lldb/Core/Log.h"
-#include "RegisterContextPOSIX.h"
-#include "RegisterContext_x86.h"
-
-class ProcessMonitor;
-
-//---------------------------------------------------------------------------
-// Internal codes for all i386 registers.
-//---------------------------------------------------------------------------
-enum
-{
- k_first_gpr_i386,
- gpr_eax_i386 = k_first_gpr_i386,
- gpr_ebx_i386,
- gpr_ecx_i386,
- gpr_edx_i386,
- gpr_edi_i386,
- gpr_esi_i386,
- gpr_ebp_i386,
- gpr_esp_i386,
- gpr_eip_i386,
- gpr_eflags_i386,
- gpr_cs_i386,
- gpr_fs_i386,
- gpr_gs_i386,
- gpr_ss_i386,
- gpr_ds_i386,
- gpr_es_i386,
-
- k_first_alias_i386,
- gpr_ax_i386 = k_first_alias_i386,
- gpr_bx_i386,
- gpr_cx_i386,
- gpr_dx_i386,
- gpr_di_i386,
- gpr_si_i386,
- gpr_bp_i386,
- gpr_sp_i386,
- gpr_ah_i386,
- gpr_bh_i386,
- gpr_ch_i386,
- gpr_dh_i386,
- gpr_al_i386,
- gpr_bl_i386,
- gpr_cl_i386,
- gpr_dl_i386,
- k_last_alias_i386 = gpr_dl_i386,
-
- k_last_gpr_i386 = k_last_alias_i386,
-
- k_first_fpr_i386,
- fpu_fctrl_i386 = k_first_fpr_i386,
- fpu_fstat_i386,
- fpu_ftag_i386,
- fpu_fop_i386,
- fpu_fiseg_i386,
- fpu_fioff_i386,
- fpu_foseg_i386,
- fpu_fooff_i386,
- fpu_mxcsr_i386,
- fpu_mxcsrmask_i386,
- fpu_st0_i386,
- fpu_st1_i386,
- fpu_st2_i386,
- fpu_st3_i386,
- fpu_st4_i386,
- fpu_st5_i386,
- fpu_st6_i386,
- fpu_st7_i386,
- fpu_mm0_i386,
- fpu_mm1_i386,
- fpu_mm2_i386,
- fpu_mm3_i386,
- fpu_mm4_i386,
- fpu_mm5_i386,
- fpu_mm6_i386,
- fpu_mm7_i386,
- fpu_xmm0_i386,
- fpu_xmm1_i386,
- fpu_xmm2_i386,
- fpu_xmm3_i386,
- fpu_xmm4_i386,
- fpu_xmm5_i386,
- fpu_xmm6_i386,
- fpu_xmm7_i386,
- k_last_fpr_i386 = fpu_xmm7_i386,
-
- k_first_avx_i386,
- fpu_ymm0_i386 = k_first_avx_i386,
- fpu_ymm1_i386,
- fpu_ymm2_i386,
- fpu_ymm3_i386,
- fpu_ymm4_i386,
- fpu_ymm5_i386,
- fpu_ymm6_i386,
- fpu_ymm7_i386,
- k_last_avx_i386 = fpu_ymm7_i386,
-
- dr0_i386,
- dr1_i386,
- dr2_i386,
- dr3_i386,
- dr4_i386,
- dr5_i386,
- dr6_i386,
- dr7_i386,
-
- k_num_registers_i386,
- k_num_gpr_registers_i386 = k_last_gpr_i386 - k_first_gpr_i386 + 1,
- k_num_fpr_registers_i386 = k_last_fpr_i386 - k_first_fpr_i386 + 1,
- k_num_avx_registers_i386 = k_last_avx_i386 - k_first_avx_i386 + 1
-};
-
-//---------------------------------------------------------------------------
-// Internal codes for all x86_64 registers.
-//---------------------------------------------------------------------------
-enum
-{
- k_first_gpr_x86_64,
- gpr_rax_x86_64 = k_first_gpr_x86_64,
- gpr_rbx_x86_64,
- gpr_rcx_x86_64,
- gpr_rdx_x86_64,
- gpr_rdi_x86_64,
- gpr_rsi_x86_64,
- gpr_rbp_x86_64,
- gpr_rsp_x86_64,
- gpr_r8_x86_64,
- gpr_r9_x86_64,
- gpr_r10_x86_64,
- gpr_r11_x86_64,
- gpr_r12_x86_64,
- gpr_r13_x86_64,
- gpr_r14_x86_64,
- gpr_r15_x86_64,
- gpr_rip_x86_64,
- gpr_rflags_x86_64,
- gpr_cs_x86_64,
- gpr_fs_x86_64,
- gpr_gs_x86_64,
- gpr_ss_x86_64,
- gpr_ds_x86_64,
- gpr_es_x86_64,
-
- k_first_alias_x86_64,
- gpr_eax_x86_64 = k_first_alias_x86_64,
- gpr_ebx_x86_64,
- gpr_ecx_x86_64,
- gpr_edx_x86_64,
- gpr_edi_x86_64,
- gpr_esi_x86_64,
- gpr_ebp_x86_64,
- gpr_esp_x86_64,
- gpr_r8d_x86_64, // Low 32 bits of r8
- gpr_r9d_x86_64, // Low 32 bits of r9
- gpr_r10d_x86_64, // Low 32 bits of r10
- gpr_r11d_x86_64, // Low 32 bits of r11
- gpr_r12d_x86_64, // Low 32 bits of r12
- gpr_r13d_x86_64, // Low 32 bits of r13
- gpr_r14d_x86_64, // Low 32 bits of r14
- gpr_r15d_x86_64, // Low 32 bits of r15
- gpr_ax_x86_64,
- gpr_bx_x86_64,
- gpr_cx_x86_64,
- gpr_dx_x86_64,
- gpr_di_x86_64,
- gpr_si_x86_64,
- gpr_bp_x86_64,
- gpr_sp_x86_64,
- gpr_r8w_x86_64, // Low 16 bits of r8
- gpr_r9w_x86_64, // Low 16 bits of r9
- gpr_r10w_x86_64, // Low 16 bits of r10
- gpr_r11w_x86_64, // Low 16 bits of r11
- gpr_r12w_x86_64, // Low 16 bits of r12
- gpr_r13w_x86_64, // Low 16 bits of r13
- gpr_r14w_x86_64, // Low 16 bits of r14
- gpr_r15w_x86_64, // Low 16 bits of r15
- gpr_ah_x86_64,
- gpr_bh_x86_64,
- gpr_ch_x86_64,
- gpr_dh_x86_64,
- gpr_al_x86_64,
- gpr_bl_x86_64,
- gpr_cl_x86_64,
- gpr_dl_x86_64,
- gpr_dil_x86_64,
- gpr_sil_x86_64,
- gpr_bpl_x86_64,
- gpr_spl_x86_64,
- gpr_r8l_x86_64, // Low 8 bits of r8
- gpr_r9l_x86_64, // Low 8 bits of r9
- gpr_r10l_x86_64, // Low 8 bits of r10
- gpr_r11l_x86_64, // Low 8 bits of r11
- gpr_r12l_x86_64, // Low 8 bits of r12
- gpr_r13l_x86_64, // Low 8 bits of r13
- gpr_r14l_x86_64, // Low 8 bits of r14
- gpr_r15l_x86_64, // Low 8 bits of r15
- k_last_alias_x86_64 = gpr_r15l_x86_64,
-
- k_last_gpr_x86_64 = k_last_alias_x86_64,
-
- k_first_fpr_x86_64,
- fpu_fctrl_x86_64 = k_first_fpr_x86_64,
- fpu_fstat_x86_64,
- fpu_ftag_x86_64,
- fpu_fop_x86_64,
- fpu_fiseg_x86_64,
- fpu_fioff_x86_64,
- fpu_foseg_x86_64,
- fpu_fooff_x86_64,
- fpu_mxcsr_x86_64,
- fpu_mxcsrmask_x86_64,
- fpu_st0_x86_64,
- fpu_st1_x86_64,
- fpu_st2_x86_64,
- fpu_st3_x86_64,
- fpu_st4_x86_64,
- fpu_st5_x86_64,
- fpu_st6_x86_64,
- fpu_st7_x86_64,
- fpu_mm0_x86_64,
- fpu_mm1_x86_64,
- fpu_mm2_x86_64,
- fpu_mm3_x86_64,
- fpu_mm4_x86_64,
- fpu_mm5_x86_64,
- fpu_mm6_x86_64,
- fpu_mm7_x86_64,
- fpu_xmm0_x86_64,
- fpu_xmm1_x86_64,
- fpu_xmm2_x86_64,
- fpu_xmm3_x86_64,
- fpu_xmm4_x86_64,
- fpu_xmm5_x86_64,
- fpu_xmm6_x86_64,
- fpu_xmm7_x86_64,
- fpu_xmm8_x86_64,
- fpu_xmm9_x86_64,
- fpu_xmm10_x86_64,
- fpu_xmm11_x86_64,
- fpu_xmm12_x86_64,
- fpu_xmm13_x86_64,
- fpu_xmm14_x86_64,
- fpu_xmm15_x86_64,
- k_last_fpr_x86_64 = fpu_xmm15_x86_64,
-
- k_first_avx_x86_64,
- fpu_ymm0_x86_64 = k_first_avx_x86_64,
- fpu_ymm1_x86_64,
- fpu_ymm2_x86_64,
- fpu_ymm3_x86_64,
- fpu_ymm4_x86_64,
- fpu_ymm5_x86_64,
- fpu_ymm6_x86_64,
- fpu_ymm7_x86_64,
- fpu_ymm8_x86_64,
- fpu_ymm9_x86_64,
- fpu_ymm10_x86_64,
- fpu_ymm11_x86_64,
- fpu_ymm12_x86_64,
- fpu_ymm13_x86_64,
- fpu_ymm14_x86_64,
- fpu_ymm15_x86_64,
- k_last_avx_x86_64 = fpu_ymm15_x86_64,
-
- dr0_x86_64,
- dr1_x86_64,
- dr2_x86_64,
- dr3_x86_64,
- dr4_x86_64,
- dr5_x86_64,
- dr6_x86_64,
- dr7_x86_64,
-
- k_num_registers_x86_64,
- k_num_gpr_registers_x86_64 = k_last_gpr_x86_64 - k_first_gpr_x86_64 + 1,
- k_num_fpr_registers_x86_64 = k_last_fpr_x86_64 - k_first_fpr_x86_64 + 1,
- k_num_avx_registers_x86_64 = k_last_avx_x86_64 - k_first_avx_x86_64 + 1
-};
-
-class RegisterContextPOSIX_x86
- : public lldb_private::RegisterContext
-{
-public:
- RegisterContextPOSIX_x86 (lldb_private::Thread &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info);
-
- ~RegisterContextPOSIX_x86();
-
- void
- Invalidate();
-
- void
- InvalidateAllRegisters();
-
- size_t
- GetRegisterCount();
-
- virtual size_t
- GetGPRSize();
-
- virtual unsigned
- GetRegisterSize(unsigned reg);
-
- virtual unsigned
- GetRegisterOffset(unsigned reg);
-
- const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex(size_t reg);
-
- size_t
- GetRegisterSetCount();
-
- const lldb_private::RegisterSet *
- GetRegisterSet(size_t set);
-
- const char *
- GetRegisterName(unsigned reg);
-
- uint32_t
- ConvertRegisterKindToRegisterNumber(uint32_t kind, uint32_t num);
-
- //---------------------------------------------------------------------------
- // Note: prefer kernel definitions over user-land
- //---------------------------------------------------------------------------
- enum FPRType
- {
- eNotValid = 0,
- eFSAVE, // TODO
- eFXSAVE,
- eSOFT, // TODO
- eXSAVE
- };
-
- static uint32_t g_contained_eax[];
- static uint32_t g_contained_ebx[];
- static uint32_t g_contained_ecx[];
- static uint32_t g_contained_edx[];
- static uint32_t g_contained_edi[];
- static uint32_t g_contained_esi[];
- static uint32_t g_contained_ebp[];
- static uint32_t g_contained_esp[];
-
- static uint32_t g_invalidate_eax[];
- static uint32_t g_invalidate_ebx[];
- static uint32_t g_invalidate_ecx[];
- static uint32_t g_invalidate_edx[];
- static uint32_t g_invalidate_edi[];
- static uint32_t g_invalidate_esi[];
- static uint32_t g_invalidate_ebp[];
- static uint32_t g_invalidate_esp[];
-
- static uint32_t g_contained_rax[];
- static uint32_t g_contained_rbx[];
- static uint32_t g_contained_rcx[];
- static uint32_t g_contained_rdx[];
- static uint32_t g_contained_rdi[];
- static uint32_t g_contained_rsi[];
- static uint32_t g_contained_rbp[];
- static uint32_t g_contained_rsp[];
- static uint32_t g_contained_r8[];
- static uint32_t g_contained_r9[];
- static uint32_t g_contained_r10[];
- static uint32_t g_contained_r11[];
- static uint32_t g_contained_r12[];
- static uint32_t g_contained_r13[];
- static uint32_t g_contained_r14[];
- static uint32_t g_contained_r15[];
-
- static uint32_t g_invalidate_rax[];
- static uint32_t g_invalidate_rbx[];
- static uint32_t g_invalidate_rcx[];
- static uint32_t g_invalidate_rdx[];
- static uint32_t g_invalidate_rdi[];
- static uint32_t g_invalidate_rsi[];
- static uint32_t g_invalidate_rbp[];
- static uint32_t g_invalidate_rsp[];
- static uint32_t g_invalidate_r8[];
- static uint32_t g_invalidate_r9[];
- static uint32_t g_invalidate_r10[];
- static uint32_t g_invalidate_r11[];
- static uint32_t g_invalidate_r12[];
- static uint32_t g_invalidate_r13[];
- static uint32_t g_invalidate_r14[];
- static uint32_t g_invalidate_r15[];
-
-protected:
- struct RegInfo
- {
- uint32_t num_registers;
- uint32_t num_gpr_registers;
- uint32_t num_fpr_registers;
- uint32_t num_avx_registers;
-
- uint32_t last_gpr;
- uint32_t first_fpr;
- uint32_t last_fpr;
-
- uint32_t first_st;
- uint32_t last_st;
- uint32_t first_mm;
- uint32_t last_mm;
- uint32_t first_xmm;
- uint32_t last_xmm;
- uint32_t first_ymm;
- uint32_t last_ymm;
-
- uint32_t first_dr;
- uint32_t gpr_flags;
- };
-
- uint64_t m_gpr_x86_64[k_num_gpr_registers_x86_64]; // 64-bit general purpose registers.
- RegInfo m_reg_info;
- FPRType m_fpr_type; // determines the type of data stored by union FPR, if any.
- FPR m_fpr; // floating-point registers including extended register sets.
- IOVEC m_iovec; // wrapper for xsave.
- YMM m_ymm_set; // copy of ymmh and xmm register halves.
- std::unique_ptr<RegisterInfoInterface> m_register_info_ap; // Register Info Interface (FreeBSD or 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);
-
- bool
- IsAVX(unsigned reg);
-
- lldb::ByteOrder GetByteOrder();
-
- bool CopyXSTATEtoYMM(uint32_t reg, lldb::ByteOrder byte_order);
- bool CopyYMMtoXSTATE(uint32_t reg, lldb::ByteOrder byte_order);
- bool IsFPR(unsigned reg, FPRType fpr_type);
- FPRType GetFPRType();
-
- virtual bool ReadGPR() = 0;
- virtual bool ReadFPR() = 0;
- virtual bool WriteGPR() = 0;
- virtual bool WriteFPR() = 0;
-};
-
-#endif // #ifndef liblldb_RegisterContextPOSIX_x86_H_
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h
deleted file mode 100644
index dfd473d..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//===-- RegisterContext_mips64.h --------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContext_mips64_H_
-#define liblldb_RegisterContext_mips64_H_
-
-// GCC and DWARF Register numbers (eRegisterKindGCC & eRegisterKindDWARF)
-enum
-{
- // GP Registers
- gcc_dwarf_zero_mips64 = 0,
- gcc_dwarf_r1_mips64,
- gcc_dwarf_r2_mips64,
- gcc_dwarf_r3_mips64,
- gcc_dwarf_r4_mips64,
- gcc_dwarf_r5_mips64,
- gcc_dwarf_r6_mips64,
- gcc_dwarf_r7_mips64,
- gcc_dwarf_r8_mips64,
- gcc_dwarf_r9_mips64,
- gcc_dwarf_r10_mips64,
- gcc_dwarf_r11_mips64,
- gcc_dwarf_r12_mips64,
- gcc_dwarf_r13_mips64,
- gcc_dwarf_r14_mips64,
- gcc_dwarf_r15_mips64,
- gcc_dwarf_r16_mips64,
- gcc_dwarf_r17_mips64,
- gcc_dwarf_r18_mips64,
- gcc_dwarf_r19_mips64,
- gcc_dwarf_r20_mips64,
- gcc_dwarf_r21_mips64,
- gcc_dwarf_r22_mips64,
- gcc_dwarf_r23_mips64,
- gcc_dwarf_r24_mips64,
- gcc_dwarf_r25_mips64,
- gcc_dwarf_r26_mips64,
- gcc_dwarf_r27_mips64,
- gcc_dwarf_gp_mips64,
- gcc_dwarf_sp_mips64,
- gcc_dwarf_r30_mips64,
- gcc_dwarf_ra_mips64,
- gcc_dwarf_sr_mips64,
- gcc_dwarf_lo_mips64,
- gcc_dwarf_hi_mips64,
- gcc_dwarf_bad_mips64,
- gcc_dwarf_cause_mips64,
- gcc_dwarf_pc_mips64,
- gcc_dwarf_ic_mips64,
- gcc_dwarf_dummy_mips64
-};
-
-// GDB Register numbers (eRegisterKindGDB)
-enum
-{
- gdb_zero_mips64 = 0,
- gdb_r1_mips64,
- gdb_r2_mips64,
- gdb_r3_mips64,
- gdb_r4_mips64,
- gdb_r5_mips64,
- gdb_r6_mips64,
- gdb_r7_mips64,
- gdb_r8_mips64,
- gdb_r9_mips64,
- gdb_r10_mips64,
- gdb_r11_mips64,
- gdb_r12_mips64,
- gdb_r13_mips64,
- gdb_r14_mips64,
- gdb_r15_mips64,
- gdb_r16_mips64,
- gdb_r17_mips64,
- gdb_r18_mips64,
- gdb_r19_mips64,
- gdb_r20_mips64,
- gdb_r21_mips64,
- gdb_r22_mips64,
- gdb_r23_mips64,
- gdb_r24_mips64,
- gdb_r25_mips64,
- gdb_r26_mips64,
- gdb_r27_mips64,
- gdb_gp_mips64,
- gdb_sp_mips64,
- gdb_r30_mips64,
- gdb_ra_mips64,
- gdb_sr_mips64,
- gdb_lo_mips64,
- gdb_hi_mips64,
- gdb_bad_mips64,
- gdb_cause_mips64,
- gdb_pc_mips64,
- gdb_ic_mips64,
- gdb_dummy_mips64
-};
-
-#endif // liblldb_RegisterContext_mips64_H_
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86.h
deleted file mode 100644
index df3e1e5..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86.h
+++ /dev/null
@@ -1,479 +0,0 @@
-//===-- RegisterContext_x86.h -----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_RegisterContext_x86_H_
-#define liblldb_RegisterContext_x86_H_
-
-//---------------------------------------------------------------------------
-// i386 gcc, dwarf, gdb enums
-//---------------------------------------------------------------------------
-
-// Register numbers seen in eh_frame (eRegisterKindGCC)
-//
-// From Jason Molenda: "gcc registers" is the register numbering used in the eh_frame
-// CFI. The only registers that are described in eh_frame CFI are those that are
-// preserved across function calls aka callee-saved aka non-volatile. And none
-// of the floating point registers on x86 are preserved across function calls.
-//
-// The only reason there is a "gcc register" and a "dwarf register" is because of a
-// mistake years and years ago with i386 where they got esp and ebp
-// backwards when they emitted the eh_frame instructions. Once there were
-// binaries In The Wild using the reversed numbering, we had to stick with it
-// forever.
-enum
-{
- // 2nd parameter in DwarfRegNum() is regnum for exception handling on x86-32.
- // See http://llvm.org/docs/WritingAnLLVMBackend.html#defining-a-register
- gcc_eax_i386 = 0,
- gcc_ecx_i386,
- gcc_edx_i386,
- gcc_ebx_i386,
- gcc_ebp_i386, // Warning: these are switched from dwarf values
- gcc_esp_i386, //
- gcc_esi_i386,
- gcc_edi_i386,
- gcc_eip_i386,
- gcc_eflags_i386,
- gcc_st0_i386 = 12,
- gcc_st1_i386,
- gcc_st2_i386,
- gcc_st3_i386,
- gcc_st4_i386,
- gcc_st5_i386,
- gcc_st6_i386,
- gcc_st7_i386,
- gcc_xmm0_i386 = 21,
- gcc_xmm1_i386,
- gcc_xmm2_i386,
- gcc_xmm3_i386,
- gcc_xmm4_i386,
- gcc_xmm5_i386,
- gcc_xmm6_i386,
- gcc_xmm7_i386,
- gcc_mm0_i386 = 29,
- gcc_mm1_i386,
- gcc_mm2_i386,
- gcc_mm3_i386,
- gcc_mm4_i386,
- gcc_mm5_i386,
- gcc_mm6_i386,
- gcc_mm7_i386,
-};
-
-// DWARF register numbers (eRegisterKindDWARF)
-// Intel's x86 or IA-32
-enum
-{
- // General Purpose Registers.
- dwarf_eax_i386 = 0,
- dwarf_ecx_i386,
- dwarf_edx_i386,
- dwarf_ebx_i386,
- dwarf_esp_i386,
- dwarf_ebp_i386,
- dwarf_esi_i386,
- dwarf_edi_i386,
- dwarf_eip_i386,
- dwarf_eflags_i386,
- // Floating Point Registers
- dwarf_st0_i386 = 11,
- dwarf_st1_i386,
- dwarf_st2_i386,
- dwarf_st3_i386,
- dwarf_st4_i386,
- dwarf_st5_i386,
- dwarf_st6_i386,
- dwarf_st7_i386,
- // SSE Registers
- dwarf_xmm0_i386 = 21,
- dwarf_xmm1_i386,
- dwarf_xmm2_i386,
- dwarf_xmm3_i386,
- dwarf_xmm4_i386,
- dwarf_xmm5_i386,
- dwarf_xmm6_i386,
- dwarf_xmm7_i386,
- // MMX Registers
- dwarf_mm0_i386 = 29,
- dwarf_mm1_i386,
- dwarf_mm2_i386,
- dwarf_mm3_i386,
- dwarf_mm4_i386,
- dwarf_mm5_i386,
- dwarf_mm6_i386,
- dwarf_mm7_i386,
- dwarf_fctrl_i386 = 37, // x87 control word
- dwarf_fstat_i386 = 38, // x87 status word
- dwarf_mxcsr_i386 = 39,
- dwarf_es_i386 = 40,
- dwarf_cs_i386 = 41,
- dwarf_ss_i386 = 42,
- dwarf_ds_i386 = 43,
- dwarf_fs_i386 = 44,
- dwarf_gs_i386 = 45
-
- // I believe the ymm registers use the dwarf_xmm%_i386 register numbers and
- // then differentiate based on size of the register.
-};
-
-// Register numbers GDB uses (eRegisterKindGDB)
-//
-// From Jason Molenda: The "gdb numbers" are what you would see in the stabs debug format.
-enum
-{
- gdb_eax_i386,
- gdb_ecx_i386,
- gdb_edx_i386,
- gdb_ebx_i386,
- gdb_esp_i386,
- gdb_ebp_i386,
- gdb_esi_i386,
- gdb_edi_i386,
- gdb_eip_i386,
- gdb_eflags_i386,
- gdb_cs_i386,
- gdb_ss_i386,
- gdb_ds_i386,
- gdb_es_i386,
- gdb_fs_i386,
- gdb_gs_i386,
- gdb_st0_i386 = 16,
- gdb_st1_i386,
- gdb_st2_i386,
- gdb_st3_i386,
- gdb_st4_i386,
- gdb_st5_i386,
- gdb_st6_i386,
- gdb_st7_i386,
- gdb_fctrl_i386, // FPU Control Word
- gdb_fstat_i386, // FPU Status Word
- gdb_ftag_i386, // FPU Tag Word
- gdb_fiseg_i386, // FPU IP Selector
- gdb_fioff_i386, // FPU IP Offset
- gdb_foseg_i386, // FPU Operand Pointer Selector
- gdb_fooff_i386, // FPU Operand Pointer Offset
- gdb_fop_i386, // Last Instruction Opcode
- gdb_xmm0_i386 = 32,
- gdb_xmm1_i386,
- gdb_xmm2_i386,
- gdb_xmm3_i386,
- gdb_xmm4_i386,
- gdb_xmm5_i386,
- gdb_xmm6_i386,
- gdb_xmm7_i386,
- gdb_mxcsr_i386 = 40,
- gdb_ymm0h_i386,
- gdb_ymm1h_i386,
- gdb_ymm2h_i386,
- gdb_ymm3h_i386,
- gdb_ymm4h_i386,
- gdb_ymm5h_i386,
- gdb_ymm6h_i386,
- gdb_ymm7h_i386,
- gdb_mm0_i386,
- gdb_mm1_i386,
- gdb_mm2_i386,
- gdb_mm3_i386,
- gdb_mm4_i386,
- gdb_mm5_i386,
- gdb_mm6_i386,
- gdb_mm7_i386,
-};
-
-//---------------------------------------------------------------------------
-// AMD x86_64, AMD64, Intel EM64T, or Intel 64 gcc, dwarf, gdb enums
-//---------------------------------------------------------------------------
-
-// GCC and DWARF Register numbers (eRegisterKindGCC & eRegisterKindDWARF)
-// This is the spec I used (as opposed to x86-64-abi-0.99.pdf):
-// http://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf
-enum
-{
- // GP Registers
- gcc_dwarf_rax_x86_64 = 0,
- gcc_dwarf_rdx_x86_64,
- gcc_dwarf_rcx_x86_64,
- gcc_dwarf_rbx_x86_64,
- gcc_dwarf_rsi_x86_64,
- gcc_dwarf_rdi_x86_64,
- gcc_dwarf_rbp_x86_64,
- gcc_dwarf_rsp_x86_64,
- // Extended GP Registers
- gcc_dwarf_r8_x86_64 = 8,
- gcc_dwarf_r9_x86_64,
- gcc_dwarf_r10_x86_64,
- gcc_dwarf_r11_x86_64,
- gcc_dwarf_r12_x86_64,
- gcc_dwarf_r13_x86_64,
- gcc_dwarf_r14_x86_64,
- gcc_dwarf_r15_x86_64,
- // Return Address (RA) mapped to RIP
- gcc_dwarf_rip_x86_64 = 16,
- // SSE Vector Registers
- gcc_dwarf_xmm0_x86_64 = 17,
- gcc_dwarf_xmm1_x86_64,
- gcc_dwarf_xmm2_x86_64,
- gcc_dwarf_xmm3_x86_64,
- gcc_dwarf_xmm4_x86_64,
- gcc_dwarf_xmm5_x86_64,
- gcc_dwarf_xmm6_x86_64,
- gcc_dwarf_xmm7_x86_64,
- gcc_dwarf_xmm8_x86_64,
- gcc_dwarf_xmm9_x86_64,
- gcc_dwarf_xmm10_x86_64,
- gcc_dwarf_xmm11_x86_64,
- gcc_dwarf_xmm12_x86_64,
- gcc_dwarf_xmm13_x86_64,
- gcc_dwarf_xmm14_x86_64,
- gcc_dwarf_xmm15_x86_64,
- // Floating Point Registers
- gcc_dwarf_st0_x86_64 = 33,
- gcc_dwarf_st1_x86_64,
- gcc_dwarf_st2_x86_64,
- gcc_dwarf_st3_x86_64,
- gcc_dwarf_st4_x86_64,
- gcc_dwarf_st5_x86_64,
- gcc_dwarf_st6_x86_64,
- gcc_dwarf_st7_x86_64,
- // MMX Registers
- gcc_dwarf_mm0_x86_64 = 41,
- gcc_dwarf_mm1_x86_64,
- gcc_dwarf_mm2_x86_64,
- gcc_dwarf_mm3_x86_64,
- gcc_dwarf_mm4_x86_64,
- gcc_dwarf_mm5_x86_64,
- gcc_dwarf_mm6_x86_64,
- gcc_dwarf_mm7_x86_64,
- // Control and Status Flags Register
- gcc_dwarf_rflags_x86_64 = 49,
- // selector registers
- gcc_dwarf_es_x86_64 = 50,
- gcc_dwarf_cs_x86_64,
- gcc_dwarf_ss_x86_64,
- gcc_dwarf_ds_x86_64,
- gcc_dwarf_fs_x86_64,
- gcc_dwarf_gs_x86_64,
- // Floating point control registers
- gcc_dwarf_mxcsr_x86_64 = 64, // Media Control and Status
- gcc_dwarf_fctrl_x86_64, // x87 control word
- gcc_dwarf_fstat_x86_64, // x87 status word
- // Upper Vector Registers
- gcc_dwarf_ymm0h_x86_64 = 67,
- gcc_dwarf_ymm1h_x86_64,
- gcc_dwarf_ymm2h_x86_64,
- gcc_dwarf_ymm3h_x86_64,
- gcc_dwarf_ymm4h_x86_64,
- gcc_dwarf_ymm5h_x86_64,
- gcc_dwarf_ymm6h_x86_64,
- gcc_dwarf_ymm7h_x86_64,
- gcc_dwarf_ymm8h_x86_64,
- gcc_dwarf_ymm9h_x86_64,
- gcc_dwarf_ymm10h_x86_64,
- gcc_dwarf_ymm11h_x86_64,
- gcc_dwarf_ymm12h_x86_64,
- gcc_dwarf_ymm13h_x86_64,
- gcc_dwarf_ymm14h_x86_64,
- gcc_dwarf_ymm15h_x86_64,
- // AVX2 Vector Mask Registers
- // gcc_dwarf_k0_x86_64 = 118,
- // gcc_dwarf_k1_x86_64,
- // gcc_dwarf_k2_x86_64,
- // gcc_dwarf_k3_x86_64,
- // gcc_dwarf_k4_x86_64,
- // gcc_dwarf_k5_x86_64,
- // gcc_dwarf_k6_x86_64,
- // gcc_dwarf_k7_x86_64,
-};
-
-// GDB Register numbers (eRegisterKindGDB)
-enum
-{
- // GP Registers
- gdb_rax_x86_64 = 0,
- gdb_rbx_x86_64,
- gdb_rcx_x86_64,
- gdb_rdx_x86_64,
- gdb_rsi_x86_64,
- gdb_rdi_x86_64,
- gdb_rbp_x86_64,
- gdb_rsp_x86_64,
- // Extended GP Registers
- gdb_r8_x86_64,
- gdb_r9_x86_64,
- gdb_r10_x86_64,
- gdb_r11_x86_64,
- gdb_r12_x86_64,
- gdb_r13_x86_64,
- gdb_r14_x86_64,
- gdb_r15_x86_64,
- // Return Address (RA) mapped to RIP
- gdb_rip_x86_64,
- // Control and Status Flags Register
- gdb_rflags_x86_64,
- gdb_cs_x86_64,
- gdb_ss_x86_64,
- gdb_ds_x86_64,
- gdb_es_x86_64,
- gdb_fs_x86_64,
- gdb_gs_x86_64,
- // Floating Point Registers
- gdb_st0_x86_64,
- gdb_st1_x86_64,
- gdb_st2_x86_64,
- gdb_st3_x86_64,
- gdb_st4_x86_64,
- gdb_st5_x86_64,
- gdb_st6_x86_64,
- gdb_st7_x86_64,
- gdb_fctrl_x86_64,
- gdb_fstat_x86_64,
- gdb_ftag_x86_64,
- gdb_fiseg_x86_64,
- gdb_fioff_x86_64,
- gdb_foseg_x86_64,
- gdb_fooff_x86_64,
- gdb_fop_x86_64,
- // SSE Vector Registers
- gdb_xmm0_x86_64 = 40,
- gdb_xmm1_x86_64,
- gdb_xmm2_x86_64,
- gdb_xmm3_x86_64,
- gdb_xmm4_x86_64,
- gdb_xmm5_x86_64,
- gdb_xmm6_x86_64,
- gdb_xmm7_x86_64,
- gdb_xmm8_x86_64,
- gdb_xmm9_x86_64,
- gdb_xmm10_x86_64,
- gdb_xmm11_x86_64,
- gdb_xmm12_x86_64,
- gdb_xmm13_x86_64,
- gdb_xmm14_x86_64,
- gdb_xmm15_x86_64,
- // Floating point control registers
- gdb_mxcsr_x86_64 = 56,
- gdb_ymm0h_x86_64,
- gdb_ymm1h_x86_64,
- gdb_ymm2h_x86_64,
- gdb_ymm3h_x86_64,
- gdb_ymm4h_x86_64,
- gdb_ymm5h_x86_64,
- gdb_ymm6h_x86_64,
- gdb_ymm7h_x86_64,
- gdb_ymm8h_x86_64,
- gdb_ymm9h_x86_64,
- gdb_ymm10h_x86_64,
- gdb_ymm11h_x86_64,
- gdb_ymm12h_x86_64,
- gdb_ymm13h_x86_64,
- gdb_ymm14h_x86_64,
- gdb_ymm15h_x86_64
-};
-
-//---------------------------------------------------------------------------
-// Generic floating-point registers
-//---------------------------------------------------------------------------
-
-struct MMSReg
-{
- uint8_t bytes[10];
- uint8_t pad[6];
-};
-
-struct XMMReg
-{
- uint8_t bytes[16]; // 128-bits for each XMM register
-};
-
-// i387_fxsave_struct
-struct FXSAVE
-{
- uint16_t fctrl; // FPU Control Word (fcw)
- uint16_t fstat; // FPU Status Word (fsw)
- uint16_t ftag; // FPU Tag Word (ftw)
- uint16_t fop; // Last Instruction Opcode (fop)
- union
- {
- struct
- {
- uint64_t fip; // Instruction Pointer
- uint64_t fdp; // Data Pointer
- } x86_64;
- struct
- {
- uint32_t fioff; // FPU IP Offset (fip)
- uint32_t fiseg; // FPU IP Selector (fcs)
- uint32_t fooff; // FPU Operand Pointer Offset (foo)
- uint32_t foseg; // FPU Operand Pointer Selector (fos)
- } i386;
- } ptr;
- uint32_t mxcsr; // MXCSR Register State
- uint32_t mxcsrmask; // MXCSR Mask
- MMSReg stmm[8]; // 8*16 bytes for each FP-reg = 128 bytes
- XMMReg xmm[16]; // 16*16 bytes for each XMM-reg = 256 bytes
- uint32_t padding[24];
-};
-
-//---------------------------------------------------------------------------
-// Extended floating-point registers
-//---------------------------------------------------------------------------
-
-struct YMMHReg
-{
- uint8_t bytes[16]; // 16 * 8 bits for the high bytes of each YMM register
-};
-
-struct YMMReg
-{
- uint8_t bytes[32]; // 16 * 16 bits for each YMM register
-};
-
-struct YMM
-{
- YMMReg ymm[16]; // assembled from ymmh and xmm registers
-};
-
-struct XSAVE_HDR
-{
- uint64_t xstate_bv; // OS enabled xstate mask to determine the extended states supported by the processor
- uint64_t reserved1[2];
- uint64_t reserved2[5];
-} __attribute__((packed));
-
-// x86 extensions to FXSAVE (i.e. for AVX processors)
-struct XSAVE
-{
- FXSAVE i387; // floating point registers typical in i387_fxsave_struct
- XSAVE_HDR header; // The xsave_hdr_struct can be used to determine if the following extensions are usable
- YMMHReg ymmh[16]; // High 16 bytes of each of 16 YMM registers (the low bytes are in FXSAVE.xmm for compatibility with SSE)
- // Slot any extensions to the register file here
-} __attribute__((packed, aligned (64)));
-
-// Floating-point registers
-struct FPR
-{
- // Thread state for the floating-point unit of the processor read by ptrace.
- union XSTATE
- {
- FXSAVE fxsave; // Generic floating-point registers.
- XSAVE xsave; // x86 extended processor state.
- } xstate;
-};
-
-//---------------------------------------------------------------------------
-// ptrace PTRACE_GETREGSET, PTRACE_SETREGSET structure
-//---------------------------------------------------------------------------
-
-struct IOVEC
-{
- void *iov_base; // pointer to XSAVE
- size_t iov_len; // sizeof(XSAVE)
-};
-
-#endif
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h
deleted file mode 100644
index 7c51656..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h
+++ /dev/null
@@ -1,207 +0,0 @@
-//===-- RegisterInfos_i386.h -----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-#include "llvm/Support/Compiler.h"
-
-#ifdef DECLARE_REGISTER_INFOS_I386_STRUCT
-
-// Computes the offset of the given GPR in the user data area.
-#define GPR_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(GPR, regname))
-
-// Computes the offset of the given FPR in the extended data area.
-#define FPR_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(FPR, xstate) + \
- LLVM_EXTENSION offsetof(FXSAVE, regname))
-
-// Computes the offset of the YMM register assembled from register halves.
-#define YMM_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(YMM, regname))
-
-// Number of bytes needed to represent a FPR.
-#define FPR_SIZE(reg) sizeof(((FXSAVE*)NULL)->reg)
-
-// Number of bytes needed to represent the i'th FP register.
-#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes)
-
-// Number of bytes needed to represent an XMM register.
-#define XMM_SIZE sizeof(XMMReg)
-
-// Number of bytes needed to represent a YMM register.
-#define YMM_SIZE sizeof(YMMReg)
-
-// Note that the size and offset will be updated by platform-specific classes.
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
- { #reg, alt, sizeof(GPR::reg), GPR_OFFSET(reg), eEncodingUint, \
- eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg##_i386 }, NULL, NULL }
-
-#define DEFINE_FPR(name, reg, kind1, kind2, kind3, kind4) \
- { #name, NULL, FPR_SIZE(reg), FPR_OFFSET(reg), eEncodingUint, \
- eFormatHex, { kind1, kind2, kind3, kind4, fpu_##name##_i386 }, NULL, NULL }
-
-// RegisterKind: GCC, DWARF, Generic, GDB, LLDB
-
-#define DEFINE_FP_ST(reg, i) \
- { #reg#i, NULL, FP_SIZE, LLVM_EXTENSION FPR_OFFSET(stmm[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { gcc_st##i##_i386, dwarf_st##i##_i386, LLDB_INVALID_REGNUM, gdb_st##i##_i386, fpu_st##i##_i386 }, \
- NULL, NULL }
-
-#define DEFINE_FP_MM(reg, i) \
- { #reg#i, NULL, sizeof(uint64_t), LLVM_EXTENSION FPR_OFFSET(stmm[i]), \
- eEncodingUint, eFormatHex, \
- { gcc_mm##i##_i386, dwarf_mm##i##_i386, LLDB_INVALID_REGNUM, gdb_mm##i##_i386, fpu_mm##i##_i386 }, \
- NULL, NULL }
-
-#define DEFINE_XMM(reg, i) \
- { #reg#i, NULL, XMM_SIZE, LLVM_EXTENSION FPR_OFFSET(reg[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { gcc_##reg##i##_i386, dwarf_##reg##i##_i386, LLDB_INVALID_REGNUM, gdb_##reg##i##_i386, fpu_##reg##i##_i386}, \
- NULL, NULL }
-
-// I believe the YMM registers use dwarf_xmm_%_i386 register numbers and then differentiate based on register size.
-#define DEFINE_YMM(reg, i) \
- { #reg#i, NULL, YMM_SIZE, LLVM_EXTENSION YMM_OFFSET(reg[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { LLDB_INVALID_REGNUM, dwarf_xmm##i##_i386, LLDB_INVALID_REGNUM, gdb_##reg##i##h_i386, fpu_##reg##i##_i386 }, \
- NULL, NULL }
-
-#define DEFINE_DR(reg, i) \
- { #reg#i, NULL, DR_SIZE, DR_OFFSET(i), eEncodingUint, eFormatHex, \
- { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
- LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL }
-
-#define DEFINE_GPR_PSEUDO_16(reg16, reg32) \
- { #reg16, NULL, 2, GPR_OFFSET(reg32), eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg16##_i386 }, RegisterContextPOSIX_x86::g_contained_##reg32, RegisterContextPOSIX_x86::g_invalidate_##reg32 }
-#define DEFINE_GPR_PSEUDO_8H(reg8, reg32) \
- { #reg8, NULL, 1, GPR_OFFSET(reg32)+1, eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg8##_i386 }, RegisterContextPOSIX_x86::g_contained_##reg32, RegisterContextPOSIX_x86::g_invalidate_##reg32 }
-#define DEFINE_GPR_PSEUDO_8L(reg8, reg32) \
- { #reg8, NULL, 1, GPR_OFFSET(reg32), eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg8##_i386 }, RegisterContextPOSIX_x86::g_contained_##reg32, RegisterContextPOSIX_x86::g_invalidate_##reg32 }
-
-static RegisterInfo
-g_register_infos_i386[] =
-{
- // General purpose registers.
- DEFINE_GPR(eax, NULL, gcc_eax_i386, dwarf_eax_i386, LLDB_INVALID_REGNUM, gdb_eax_i386),
- DEFINE_GPR(ebx, NULL, gcc_ebx_i386, dwarf_ebx_i386, LLDB_INVALID_REGNUM, gdb_ebx_i386),
- DEFINE_GPR(ecx, NULL, gcc_ecx_i386, dwarf_ecx_i386, LLDB_INVALID_REGNUM, gdb_ecx_i386),
- DEFINE_GPR(edx, NULL, gcc_edx_i386, dwarf_edx_i386, LLDB_INVALID_REGNUM, gdb_edx_i386),
- DEFINE_GPR(edi, NULL, gcc_edi_i386, dwarf_edi_i386, LLDB_INVALID_REGNUM, gdb_edi_i386),
- DEFINE_GPR(esi, NULL, gcc_esi_i386, dwarf_esi_i386, LLDB_INVALID_REGNUM, gdb_esi_i386),
- DEFINE_GPR(ebp, "fp", gcc_ebp_i386, dwarf_ebp_i386, LLDB_REGNUM_GENERIC_FP, gdb_ebp_i386),
- DEFINE_GPR(esp, "sp", gcc_esp_i386, dwarf_esp_i386, LLDB_REGNUM_GENERIC_SP, gdb_esp_i386),
- DEFINE_GPR(eip, "pc", gcc_eip_i386, dwarf_eip_i386, LLDB_REGNUM_GENERIC_PC, gdb_eip_i386),
- DEFINE_GPR(eflags, "flags", gcc_eflags_i386, dwarf_eflags_i386, LLDB_REGNUM_GENERIC_FLAGS, gdb_eflags_i386),
- DEFINE_GPR(cs, NULL, LLDB_INVALID_REGNUM, dwarf_cs_i386, LLDB_INVALID_REGNUM, gdb_cs_i386),
- DEFINE_GPR(fs, NULL, LLDB_INVALID_REGNUM, dwarf_fs_i386, LLDB_INVALID_REGNUM, gdb_fs_i386),
- DEFINE_GPR(gs, NULL, LLDB_INVALID_REGNUM, dwarf_gs_i386, LLDB_INVALID_REGNUM, gdb_gs_i386),
- DEFINE_GPR(ss, NULL, LLDB_INVALID_REGNUM, dwarf_ss_i386, LLDB_INVALID_REGNUM, gdb_ss_i386),
- DEFINE_GPR(ds, NULL, LLDB_INVALID_REGNUM, dwarf_ds_i386, LLDB_INVALID_REGNUM, gdb_ds_i386),
- DEFINE_GPR(es, NULL, LLDB_INVALID_REGNUM, dwarf_es_i386, LLDB_INVALID_REGNUM, gdb_es_i386),
-
- DEFINE_GPR_PSEUDO_16(ax, eax),
- DEFINE_GPR_PSEUDO_16(bx, ebx),
- DEFINE_GPR_PSEUDO_16(cx, ecx),
- DEFINE_GPR_PSEUDO_16(dx, edx),
- DEFINE_GPR_PSEUDO_16(di, edi),
- DEFINE_GPR_PSEUDO_16(si, esi),
- DEFINE_GPR_PSEUDO_16(bp, ebp),
- DEFINE_GPR_PSEUDO_16(sp, esp),
- DEFINE_GPR_PSEUDO_8H(ah, eax),
- DEFINE_GPR_PSEUDO_8H(bh, ebx),
- DEFINE_GPR_PSEUDO_8H(ch, ecx),
- DEFINE_GPR_PSEUDO_8H(dh, edx),
- DEFINE_GPR_PSEUDO_8L(al, eax),
- DEFINE_GPR_PSEUDO_8L(bl, ebx),
- DEFINE_GPR_PSEUDO_8L(cl, ecx),
- DEFINE_GPR_PSEUDO_8L(dl, edx),
-
- // i387 Floating point registers.
- DEFINE_FPR(fctrl, fctrl, LLDB_INVALID_REGNUM, dwarf_fctrl_i386, LLDB_INVALID_REGNUM, gdb_fctrl_i386),
- DEFINE_FPR(fstat, fstat, LLDB_INVALID_REGNUM, dwarf_fstat_i386, LLDB_INVALID_REGNUM, gdb_fstat_i386),
- DEFINE_FPR(ftag, ftag, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_ftag_i386),
- DEFINE_FPR(fop, fop, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fop_i386),
- DEFINE_FPR(fiseg, ptr.i386.fiseg, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fiseg_i386),
- DEFINE_FPR(fioff, ptr.i386.fioff, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fioff_i386),
- DEFINE_FPR(foseg, ptr.i386.foseg, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_foseg_i386),
- DEFINE_FPR(fooff, ptr.i386.fooff, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fooff_i386),
- DEFINE_FPR(mxcsr, mxcsr, LLDB_INVALID_REGNUM, dwarf_mxcsr_i386, LLDB_INVALID_REGNUM, gdb_mxcsr_i386),
- DEFINE_FPR(mxcsrmask, mxcsrmask, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
-
- // FP registers.
- DEFINE_FP_ST(st, 0),
- DEFINE_FP_ST(st, 1),
- DEFINE_FP_ST(st, 2),
- DEFINE_FP_ST(st, 3),
- DEFINE_FP_ST(st, 4),
- DEFINE_FP_ST(st, 5),
- DEFINE_FP_ST(st, 6),
- DEFINE_FP_ST(st, 7),
- DEFINE_FP_MM(mm, 0),
- DEFINE_FP_MM(mm, 1),
- DEFINE_FP_MM(mm, 2),
- DEFINE_FP_MM(mm, 3),
- DEFINE_FP_MM(mm, 4),
- DEFINE_FP_MM(mm, 5),
- DEFINE_FP_MM(mm, 6),
- DEFINE_FP_MM(mm, 7),
-
- // XMM registers
- DEFINE_XMM(xmm, 0),
- DEFINE_XMM(xmm, 1),
- DEFINE_XMM(xmm, 2),
- DEFINE_XMM(xmm, 3),
- DEFINE_XMM(xmm, 4),
- DEFINE_XMM(xmm, 5),
- DEFINE_XMM(xmm, 6),
- DEFINE_XMM(xmm, 7),
-
- // Copy of YMM registers assembled from xmm and ymmh
- DEFINE_YMM(ymm, 0),
- DEFINE_YMM(ymm, 1),
- DEFINE_YMM(ymm, 2),
- DEFINE_YMM(ymm, 3),
- DEFINE_YMM(ymm, 4),
- DEFINE_YMM(ymm, 5),
- DEFINE_YMM(ymm, 6),
- DEFINE_YMM(ymm, 7),
-
- // Debug registers for lldb internal use
- DEFINE_DR(dr, 0),
- DEFINE_DR(dr, 1),
- DEFINE_DR(dr, 2),
- DEFINE_DR(dr, 3),
- DEFINE_DR(dr, 4),
- DEFINE_DR(dr, 5),
- DEFINE_DR(dr, 6),
- DEFINE_DR(dr, 7)
-};
-static_assert((sizeof(g_register_infos_i386) / sizeof(g_register_infos_i386[0])) == k_num_registers_i386,
- "g_register_infos_x86_64 has wrong number of register infos");
-
-#undef GPR_OFFSET
-#undef FPR_OFFSET
-#undef YMM_OFFSET
-#undef FPR_SIZE
-#undef FP_SIZE
-#undef XMM_SIZE
-#undef YMM_SIZE
-#undef DEFINE_GPR
-#undef DEFINE_FPR
-#undef DEFINE_FP
-#undef DEFINE_XMM
-#undef DEFINE_YMM
-#undef DEFINE_DR
-#undef DEFINE_GPR_PSEUDO_16
-#undef DEFINE_GPR_PSEUDO_8H
-#undef DEFINE_GPR_PSEUDO_8L
-
-#endif // DECLARE_REGISTER_INFOS_I386_STRUCT
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h
deleted file mode 100644
index 13526e3..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//===-- RegisterInfos_mips64.h ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-
-// Computes the offset of the given GPR in the user data area.
-#define GPR_OFFSET(regname) \
- (offsetof(GPR, regname))
-
-#ifdef DECLARE_REGISTER_INFOS_MIPS64_STRUCT
-
-// Note that the size and offset will be updated by platform-specific classes.
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
- { #reg, alt, sizeof(GPR::reg), GPR_OFFSET(reg), eEncodingUint, \
- eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg##_mips64 }, NULL, NULL }
-
-static RegisterInfo
-g_register_infos_mips64[] =
-{
- // General purpose registers. GCC, DWARF, Generic, GDB
- DEFINE_GPR(zero, "r0", gcc_dwarf_zero_mips64, gcc_dwarf_zero_mips64, LLDB_INVALID_REGNUM, gdb_zero_mips64),
- DEFINE_GPR(r1, NULL, gcc_dwarf_r1_mips64, gcc_dwarf_r1_mips64, LLDB_INVALID_REGNUM, gdb_r1_mips64),
- DEFINE_GPR(r2, NULL, gcc_dwarf_r2_mips64, gcc_dwarf_r2_mips64, LLDB_INVALID_REGNUM, gdb_r2_mips64),
- DEFINE_GPR(r3, NULL, gcc_dwarf_r3_mips64, gcc_dwarf_r3_mips64, LLDB_INVALID_REGNUM, gdb_r3_mips64),
- DEFINE_GPR(r4, NULL, gcc_dwarf_r4_mips64, gcc_dwarf_r4_mips64, LLDB_INVALID_REGNUM, gdb_r4_mips64),
- DEFINE_GPR(r5, NULL, gcc_dwarf_r5_mips64, gcc_dwarf_r5_mips64, LLDB_INVALID_REGNUM, gdb_r5_mips64),
- DEFINE_GPR(r6, NULL, gcc_dwarf_r6_mips64, gcc_dwarf_r6_mips64, LLDB_INVALID_REGNUM, gdb_r6_mips64),
- DEFINE_GPR(r7, NULL, gcc_dwarf_r7_mips64, gcc_dwarf_r7_mips64, LLDB_INVALID_REGNUM, gdb_r7_mips64),
- DEFINE_GPR(r8, NULL, gcc_dwarf_r8_mips64, gcc_dwarf_r8_mips64, LLDB_INVALID_REGNUM, gdb_r8_mips64),
- DEFINE_GPR(r9, NULL, gcc_dwarf_r9_mips64, gcc_dwarf_r9_mips64, LLDB_INVALID_REGNUM, gdb_r9_mips64),
- DEFINE_GPR(r10, NULL, gcc_dwarf_r10_mips64, gcc_dwarf_r10_mips64, LLDB_INVALID_REGNUM, gdb_r10_mips64),
- DEFINE_GPR(r11, NULL, gcc_dwarf_r11_mips64, gcc_dwarf_r11_mips64, LLDB_INVALID_REGNUM, gdb_r11_mips64),
- DEFINE_GPR(r12, NULL, gcc_dwarf_r12_mips64, gcc_dwarf_r12_mips64, LLDB_INVALID_REGNUM, gdb_r12_mips64),
- DEFINE_GPR(r13, NULL, gcc_dwarf_r13_mips64, gcc_dwarf_r13_mips64, LLDB_INVALID_REGNUM, gdb_r13_mips64),
- DEFINE_GPR(r14, NULL, gcc_dwarf_r14_mips64, gcc_dwarf_r14_mips64, LLDB_INVALID_REGNUM, gdb_r14_mips64),
- DEFINE_GPR(r15, NULL, gcc_dwarf_r15_mips64, gcc_dwarf_r15_mips64, LLDB_INVALID_REGNUM, gdb_r15_mips64),
- DEFINE_GPR(r16, NULL, gcc_dwarf_r16_mips64, gcc_dwarf_r16_mips64, LLDB_INVALID_REGNUM, gdb_r16_mips64),
- DEFINE_GPR(r17, NULL, gcc_dwarf_r17_mips64, gcc_dwarf_r17_mips64, LLDB_INVALID_REGNUM, gdb_r17_mips64),
- DEFINE_GPR(r18, NULL, gcc_dwarf_r18_mips64, gcc_dwarf_r18_mips64, LLDB_INVALID_REGNUM, gdb_r18_mips64),
- DEFINE_GPR(r19, NULL, gcc_dwarf_r19_mips64, gcc_dwarf_r19_mips64, LLDB_INVALID_REGNUM, gdb_r19_mips64),
- DEFINE_GPR(r20, NULL, gcc_dwarf_r20_mips64, gcc_dwarf_r20_mips64, LLDB_INVALID_REGNUM, gdb_r20_mips64),
- DEFINE_GPR(r21, NULL, gcc_dwarf_r21_mips64, gcc_dwarf_r21_mips64, LLDB_INVALID_REGNUM, gdb_r21_mips64),
- DEFINE_GPR(r22, NULL, gcc_dwarf_r22_mips64, gcc_dwarf_r22_mips64, LLDB_INVALID_REGNUM, gdb_r22_mips64),
- DEFINE_GPR(r23, NULL, gcc_dwarf_r23_mips64, gcc_dwarf_r23_mips64, LLDB_INVALID_REGNUM, gdb_r23_mips64),
- DEFINE_GPR(r24, NULL, gcc_dwarf_r24_mips64, gcc_dwarf_r24_mips64, LLDB_INVALID_REGNUM, gdb_r24_mips64),
- DEFINE_GPR(r25, NULL, gcc_dwarf_r25_mips64, gcc_dwarf_r25_mips64, LLDB_INVALID_REGNUM, gdb_r25_mips64),
- DEFINE_GPR(r26, NULL, gcc_dwarf_r26_mips64, gcc_dwarf_r26_mips64, LLDB_INVALID_REGNUM, gdb_r26_mips64),
- DEFINE_GPR(r27, NULL, gcc_dwarf_r27_mips64, gcc_dwarf_r27_mips64, LLDB_INVALID_REGNUM, gdb_r27_mips64),
- DEFINE_GPR(gp, "r28", gcc_dwarf_gp_mips64, gcc_dwarf_gp_mips64, LLDB_INVALID_REGNUM, gdb_gp_mips64),
- DEFINE_GPR(sp, "r29", gcc_dwarf_sp_mips64, gcc_dwarf_sp_mips64, LLDB_REGNUM_GENERIC_SP, gdb_sp_mips64),
- DEFINE_GPR(r30, NULL, gcc_dwarf_r30_mips64, gcc_dwarf_r30_mips64, LLDB_INVALID_REGNUM, gdb_r30_mips64),
- DEFINE_GPR(ra, "r31", gcc_dwarf_ra_mips64, gcc_dwarf_ra_mips64, LLDB_INVALID_REGNUM, gdb_ra_mips64),
- DEFINE_GPR(sr, NULL, gcc_dwarf_sr_mips64, gcc_dwarf_sr_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(mullo, NULL, gcc_dwarf_lo_mips64, gcc_dwarf_lo_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(mulhi, NULL, gcc_dwarf_hi_mips64, gcc_dwarf_hi_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(badvaddr, NULL, gcc_dwarf_bad_mips64, gcc_dwarf_bad_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(cause, NULL, gcc_dwarf_cause_mips64, gcc_dwarf_cause_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(pc, "pc", gcc_dwarf_pc_mips64, gcc_dwarf_pc_mips64, LLDB_REGNUM_GENERIC_PC, LLDB_INVALID_REGNUM),
- DEFINE_GPR(ic, NULL, gcc_dwarf_ic_mips64, gcc_dwarf_ic_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
- DEFINE_GPR(dummy, NULL, gcc_dwarf_dummy_mips64, gcc_dwarf_dummy_mips64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
-};
-static_assert((sizeof(g_register_infos_mips64) / sizeof(g_register_infos_mips64[0])) == k_num_registers_mips64,
- "g_register_infos_mips64 has wrong number of register infos");
-
-#undef DEFINE_GPR
-
-#endif // DECLARE_REGISTER_INFOS_MIPS64_STRUCT
-
-#undef GPR_OFFSET
-
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h b/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h
deleted file mode 100644
index 86abdba..0000000
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h
+++ /dev/null
@@ -1,409 +0,0 @@
-//===-- RegisterInfos_x86_64.h ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===---------------------------------------------------------------------===//
-#include "llvm/Support/Compiler.h"
-
-// Computes the offset of the given GPR in the user data area.
-#define GPR_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(GPR, regname))
-
-// Computes the offset of the given FPR in the extended data area.
-#define FPR_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(FPR, xstate) + \
- LLVM_EXTENSION offsetof(FXSAVE, regname))
-
-// Computes the offset of the YMM register assembled from register halves.
-#define YMM_OFFSET(regname) \
- (LLVM_EXTENSION offsetof(YMM, regname))
-
-#ifdef DECLARE_REGISTER_INFOS_X86_64_STRUCT
-
-// Number of bytes needed to represent a FPR.
-#define FPR_SIZE(reg) sizeof(((FXSAVE*)NULL)->reg)
-
-// Number of bytes needed to represent the i'th FP register.
-#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes)
-
-// Number of bytes needed to represent an XMM register.
-#define XMM_SIZE sizeof(XMMReg)
-
-// Number of bytes needed to represent a YMM register.
-#define YMM_SIZE sizeof(YMMReg)
-
-// RegisterKind: GCC, DWARF, Generic, GDB, LLDB
-
-// Note that the size and offset will be updated by platform-specific classes.
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
- { #reg, alt, sizeof(GPR::reg), GPR_OFFSET(reg), eEncodingUint, \
- eFormatHex, { kind1, kind2, kind3, kind4, gpr_##reg##_x86_64 }, NULL, NULL }
-
-#define DEFINE_FPR(name, reg, kind1, kind2, kind3, kind4) \
- { #name, NULL, FPR_SIZE(reg), FPR_OFFSET(reg), eEncodingUint, \
- eFormatHex, { kind1, kind2, kind3, kind4, fpu_##name##_x86_64 }, NULL, NULL }
-
-#define DEFINE_FP_ST(reg, i) \
- { #reg#i, NULL, FP_SIZE, LLVM_EXTENSION FPR_OFFSET(stmm[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { gcc_dwarf_st##i##_x86_64, gcc_dwarf_st##i##_x86_64, LLDB_INVALID_REGNUM, gdb_st##i##_x86_64, fpu_st##i##_x86_64 }, \
- NULL, NULL }
-
-#define DEFINE_FP_MM(reg, i) \
- { #reg#i, NULL, sizeof(uint64_t), LLVM_EXTENSION FPR_OFFSET(stmm[i]), \
- eEncodingUint, eFormatHex, \
- { gcc_dwarf_mm##i##_x86_64, gcc_dwarf_mm##i##_x86_64, LLDB_INVALID_REGNUM, gdb_st##i##_x86_64, fpu_mm##i##_x86_64 }, \
- NULL, NULL }
-
-#define DEFINE_XMM(reg, i) \
- { #reg#i, NULL, XMM_SIZE, LLVM_EXTENSION FPR_OFFSET(reg[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { gcc_dwarf_##reg##i##_x86_64, gcc_dwarf_##reg##i##_x86_64, LLDB_INVALID_REGNUM, gdb_##reg##i##_x86_64, fpu_##reg##i##_x86_64}, \
- NULL, NULL }
-
-#define DEFINE_YMM(reg, i) \
- { #reg#i, NULL, YMM_SIZE, LLVM_EXTENSION YMM_OFFSET(reg[i]), \
- eEncodingVector, eFormatVectorOfUInt8, \
- { gcc_dwarf_##reg##i##h_x86_64, gcc_dwarf_##reg##i##h_x86_64, LLDB_INVALID_REGNUM, gdb_##reg##i##h_x86_64, fpu_##reg##i##_x86_64 }, \
- NULL, NULL }
-
-#define DEFINE_DR(reg, i) \
- { #reg#i, NULL, DR_SIZE, DR_OFFSET(i), eEncodingUint, eFormatHex, \
- { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
- LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL }
-
-#define DEFINE_GPR_PSEUDO_32(reg32, reg64) \
- { #reg32, NULL, 4, GPR_OFFSET(reg64), eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg32##_x86_64 }, RegisterContextPOSIX_x86::g_contained_##reg64, RegisterContextPOSIX_x86::g_invalidate_##reg64 }
-#define DEFINE_GPR_PSEUDO_16(reg16, reg64) \
- { #reg16, NULL, 2, GPR_OFFSET(reg64), eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg16##_x86_64 }, RegisterContextPOSIX_x86::g_contained_##reg64, RegisterContextPOSIX_x86::g_invalidate_##reg64 }
-#define DEFINE_GPR_PSEUDO_8H(reg8, reg64) \
- { #reg8, NULL, 1, GPR_OFFSET(reg64)+1, eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg8##_x86_64 }, RegisterContextPOSIX_x86::g_contained_##reg64, RegisterContextPOSIX_x86::g_invalidate_##reg64 }
-#define DEFINE_GPR_PSEUDO_8L(reg8, reg64) \
- { #reg8, NULL, 1, GPR_OFFSET(reg64), eEncodingUint, \
- eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_##reg8##_x86_64 }, RegisterContextPOSIX_x86::g_contained_##reg64, RegisterContextPOSIX_x86::g_invalidate_##reg64 }
-
-static RegisterInfo
-g_register_infos_x86_64[] =
-{
- // General purpose registers. GCC, DWARF, Generic, GDB
- DEFINE_GPR(rax, NULL, gcc_dwarf_rax_x86_64, gcc_dwarf_rax_x86_64, LLDB_INVALID_REGNUM, gdb_rax_x86_64),
- DEFINE_GPR(rbx, NULL, gcc_dwarf_rbx_x86_64, gcc_dwarf_rbx_x86_64, LLDB_INVALID_REGNUM, gdb_rbx_x86_64),
- DEFINE_GPR(rcx, "arg4", gcc_dwarf_rcx_x86_64, gcc_dwarf_rcx_x86_64, LLDB_REGNUM_GENERIC_ARG4, gdb_rcx_x86_64),
- DEFINE_GPR(rdx, "arg3", gcc_dwarf_rdx_x86_64, gcc_dwarf_rdx_x86_64, LLDB_REGNUM_GENERIC_ARG3, gdb_rdx_x86_64),
- DEFINE_GPR(rdi, "arg1", gcc_dwarf_rdi_x86_64, gcc_dwarf_rdi_x86_64, LLDB_REGNUM_GENERIC_ARG1, gdb_rdi_x86_64),
- DEFINE_GPR(rsi, "arg2", gcc_dwarf_rsi_x86_64, gcc_dwarf_rsi_x86_64, LLDB_REGNUM_GENERIC_ARG2, gdb_rsi_x86_64),
- DEFINE_GPR(rbp, "fp", gcc_dwarf_rbp_x86_64, gcc_dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP, gdb_rbp_x86_64),
- DEFINE_GPR(rsp, "sp", gcc_dwarf_rsp_x86_64, gcc_dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP, gdb_rsp_x86_64),
- DEFINE_GPR(r8, "arg5", gcc_dwarf_r8_x86_64, gcc_dwarf_r8_x86_64, LLDB_REGNUM_GENERIC_ARG5, gdb_r8_x86_64),
- DEFINE_GPR(r9, "arg6", gcc_dwarf_r9_x86_64, gcc_dwarf_r9_x86_64, LLDB_REGNUM_GENERIC_ARG6, gdb_r9_x86_64),
- DEFINE_GPR(r10, NULL, gcc_dwarf_r10_x86_64, gcc_dwarf_r10_x86_64, LLDB_INVALID_REGNUM, gdb_r10_x86_64),
- DEFINE_GPR(r11, NULL, gcc_dwarf_r11_x86_64, gcc_dwarf_r11_x86_64, LLDB_INVALID_REGNUM, gdb_r11_x86_64),
- DEFINE_GPR(r12, NULL, gcc_dwarf_r12_x86_64, gcc_dwarf_r12_x86_64, LLDB_INVALID_REGNUM, gdb_r12_x86_64),
- DEFINE_GPR(r13, NULL, gcc_dwarf_r13_x86_64, gcc_dwarf_r13_x86_64, LLDB_INVALID_REGNUM, gdb_r13_x86_64),
- DEFINE_GPR(r14, NULL, gcc_dwarf_r14_x86_64, gcc_dwarf_r14_x86_64, LLDB_INVALID_REGNUM, gdb_r14_x86_64),
- DEFINE_GPR(r15, NULL, gcc_dwarf_r15_x86_64, gcc_dwarf_r15_x86_64, LLDB_INVALID_REGNUM, gdb_r15_x86_64),
- DEFINE_GPR(rip, "pc", gcc_dwarf_rip_x86_64, gcc_dwarf_rip_x86_64, LLDB_REGNUM_GENERIC_PC, gdb_rip_x86_64),
- DEFINE_GPR(rflags, "flags", gcc_dwarf_rflags_x86_64, gcc_dwarf_rflags_x86_64, LLDB_REGNUM_GENERIC_FLAGS, gdb_rflags_x86_64),
- DEFINE_GPR(cs, NULL, gcc_dwarf_cs_x86_64, gcc_dwarf_cs_x86_64, LLDB_INVALID_REGNUM, gdb_cs_x86_64),
- DEFINE_GPR(fs, NULL, gcc_dwarf_fs_x86_64, gcc_dwarf_fs_x86_64, LLDB_INVALID_REGNUM, gdb_fs_x86_64),
- DEFINE_GPR(gs, NULL, gcc_dwarf_gs_x86_64, gcc_dwarf_gs_x86_64, LLDB_INVALID_REGNUM, gdb_gs_x86_64),
- DEFINE_GPR(ss, NULL, gcc_dwarf_ss_x86_64, gcc_dwarf_ss_x86_64, LLDB_INVALID_REGNUM, gdb_ss_x86_64),
- DEFINE_GPR(ds, NULL, gcc_dwarf_ds_x86_64, gcc_dwarf_ds_x86_64, LLDB_INVALID_REGNUM, gdb_ds_x86_64),
- DEFINE_GPR(es, NULL, gcc_dwarf_es_x86_64, gcc_dwarf_es_x86_64, LLDB_INVALID_REGNUM, gdb_es_x86_64),
-
- DEFINE_GPR_PSEUDO_32(eax, rax),
- DEFINE_GPR_PSEUDO_32(ebx, rbx),
- DEFINE_GPR_PSEUDO_32(ecx, rcx),
- DEFINE_GPR_PSEUDO_32(edx, rdx),
- DEFINE_GPR_PSEUDO_32(edi, rdi),
- DEFINE_GPR_PSEUDO_32(esi, rsi),
- DEFINE_GPR_PSEUDO_32(ebp, rbp),
- DEFINE_GPR_PSEUDO_32(esp, rsp),
- DEFINE_GPR_PSEUDO_32(r8d, r8),
- DEFINE_GPR_PSEUDO_32(r9d, r9),
- DEFINE_GPR_PSEUDO_32(r10d, r10),
- DEFINE_GPR_PSEUDO_32(r11d, r11),
- DEFINE_GPR_PSEUDO_32(r12d, r12),
- DEFINE_GPR_PSEUDO_32(r13d, r13),
- DEFINE_GPR_PSEUDO_32(r14d, r14),
- DEFINE_GPR_PSEUDO_32(r15d, r15),
- DEFINE_GPR_PSEUDO_16(ax, rax),
- DEFINE_GPR_PSEUDO_16(bx, rbx),
- DEFINE_GPR_PSEUDO_16(cx, rcx),
- DEFINE_GPR_PSEUDO_16(dx, rdx),
- DEFINE_GPR_PSEUDO_16(di, rdi),
- DEFINE_GPR_PSEUDO_16(si, rsi),
- DEFINE_GPR_PSEUDO_16(bp, rbp),
- DEFINE_GPR_PSEUDO_16(sp, rsp),
- DEFINE_GPR_PSEUDO_16(r8w, r8),
- DEFINE_GPR_PSEUDO_16(r9w, r9),
- DEFINE_GPR_PSEUDO_16(r10w, r10),
- DEFINE_GPR_PSEUDO_16(r11w, r11),
- DEFINE_GPR_PSEUDO_16(r12w, r12),
- DEFINE_GPR_PSEUDO_16(r13w, r13),
- DEFINE_GPR_PSEUDO_16(r14w, r14),
- DEFINE_GPR_PSEUDO_16(r15w, r15),
- DEFINE_GPR_PSEUDO_8H(ah, rax),
- DEFINE_GPR_PSEUDO_8H(bh, rbx),
- DEFINE_GPR_PSEUDO_8H(ch, rcx),
- DEFINE_GPR_PSEUDO_8H(dh, rdx),
- DEFINE_GPR_PSEUDO_8L(al, rax),
- DEFINE_GPR_PSEUDO_8L(bl, rbx),
- DEFINE_GPR_PSEUDO_8L(cl, rcx),
- DEFINE_GPR_PSEUDO_8L(dl, rdx),
- DEFINE_GPR_PSEUDO_8L(dil, rdi),
- DEFINE_GPR_PSEUDO_8L(sil, rsi),
- DEFINE_GPR_PSEUDO_8L(bpl, rbp),
- DEFINE_GPR_PSEUDO_8L(spl, rsp),
- DEFINE_GPR_PSEUDO_8L(r8l, r8),
- DEFINE_GPR_PSEUDO_8L(r9l, r9),
- DEFINE_GPR_PSEUDO_8L(r10l, r10),
- DEFINE_GPR_PSEUDO_8L(r11l, r11),
- DEFINE_GPR_PSEUDO_8L(r12l, r12),
- DEFINE_GPR_PSEUDO_8L(r13l, r13),
- DEFINE_GPR_PSEUDO_8L(r14l, r14),
- DEFINE_GPR_PSEUDO_8L(r15l, r15),
-
- // i387 Floating point registers. GCC, DWARF, Generic, GDB
- DEFINE_FPR(fctrl, fctrl, gcc_dwarf_fctrl_x86_64, gcc_dwarf_fctrl_x86_64, LLDB_INVALID_REGNUM, gdb_fctrl_x86_64),
- DEFINE_FPR(fstat, fstat, gcc_dwarf_fstat_x86_64, gcc_dwarf_fstat_x86_64, LLDB_INVALID_REGNUM, gdb_fstat_x86_64),
- DEFINE_FPR(ftag, ftag, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_ftag_x86_64),
- DEFINE_FPR(fop, fop, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fop_x86_64),
- DEFINE_FPR(fiseg, ptr.i386.fiseg, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fiseg_x86_64),
- DEFINE_FPR(fioff, ptr.i386.fioff, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fioff_x86_64),
- DEFINE_FPR(foseg, ptr.i386.foseg, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_foseg_x86_64),
- DEFINE_FPR(fooff, ptr.i386.fooff, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gdb_fooff_x86_64),
- DEFINE_FPR(mxcsr, mxcsr, gcc_dwarf_mxcsr_x86_64, gcc_dwarf_mxcsr_x86_64, LLDB_INVALID_REGNUM, gdb_mxcsr_x86_64),
- DEFINE_FPR(mxcsrmask, mxcsrmask, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
-
- // FP registers.
- DEFINE_FP_ST(st, 0),
- DEFINE_FP_ST(st, 1),
- DEFINE_FP_ST(st, 2),
- DEFINE_FP_ST(st, 3),
- DEFINE_FP_ST(st, 4),
- DEFINE_FP_ST(st, 5),
- DEFINE_FP_ST(st, 6),
- DEFINE_FP_ST(st, 7),
- DEFINE_FP_MM(mm, 0),
- DEFINE_FP_MM(mm, 1),
- DEFINE_FP_MM(mm, 2),
- DEFINE_FP_MM(mm, 3),
- DEFINE_FP_MM(mm, 4),
- DEFINE_FP_MM(mm, 5),
- DEFINE_FP_MM(mm, 6),
- DEFINE_FP_MM(mm, 7),
-
- // XMM registers
- DEFINE_XMM(xmm, 0),
- DEFINE_XMM(xmm, 1),
- DEFINE_XMM(xmm, 2),
- DEFINE_XMM(xmm, 3),
- DEFINE_XMM(xmm, 4),
- DEFINE_XMM(xmm, 5),
- DEFINE_XMM(xmm, 6),
- DEFINE_XMM(xmm, 7),
- DEFINE_XMM(xmm, 8),
- DEFINE_XMM(xmm, 9),
- DEFINE_XMM(xmm, 10),
- DEFINE_XMM(xmm, 11),
- DEFINE_XMM(xmm, 12),
- DEFINE_XMM(xmm, 13),
- DEFINE_XMM(xmm, 14),
- DEFINE_XMM(xmm, 15),
-
- // Copy of YMM registers assembled from xmm and ymmh
- DEFINE_YMM(ymm, 0),
- DEFINE_YMM(ymm, 1),
- DEFINE_YMM(ymm, 2),
- DEFINE_YMM(ymm, 3),
- DEFINE_YMM(ymm, 4),
- DEFINE_YMM(ymm, 5),
- DEFINE_YMM(ymm, 6),
- DEFINE_YMM(ymm, 7),
- DEFINE_YMM(ymm, 8),
- DEFINE_YMM(ymm, 9),
- DEFINE_YMM(ymm, 10),
- DEFINE_YMM(ymm, 11),
- DEFINE_YMM(ymm, 12),
- DEFINE_YMM(ymm, 13),
- DEFINE_YMM(ymm, 14),
- DEFINE_YMM(ymm, 15),
-
- // Debug registers for lldb internal use
- DEFINE_DR(dr, 0),
- DEFINE_DR(dr, 1),
- DEFINE_DR(dr, 2),
- DEFINE_DR(dr, 3),
- DEFINE_DR(dr, 4),
- DEFINE_DR(dr, 5),
- DEFINE_DR(dr, 6),
- DEFINE_DR(dr, 7)
-};
-static_assert((sizeof(g_register_infos_x86_64) / sizeof(g_register_infos_x86_64[0])) == k_num_registers_x86_64,
- "g_register_infos_x86_64 has wrong number of register infos");
-
-#undef FPR_SIZE
-#undef FP_SIZE
-#undef XMM_SIZE
-#undef YMM_SIZE
-#undef DEFINE_GPR
-#undef DEFINE_FPR
-#undef DEFINE_FP
-#undef DEFINE_XMM
-#undef DEFINE_YMM
-#undef DEFINE_DR
-#undef DEFINE_GPR_PSEUDO_32
-#undef DEFINE_GPR_PSEUDO_16
-#undef DEFINE_GPR_PSEUDO_8H
-#undef DEFINE_GPR_PSEUDO_8L
-
-#endif // DECLARE_REGISTER_INFOS_X86_64_STRUCT
-
-
-#ifdef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
-
-#define UPDATE_GPR_INFO(reg, reg64) \
-do { \
- g_register_infos[gpr_##reg##_i386].byte_offset = GPR_OFFSET(reg64); \
-} while(false);
-
-#define UPDATE_GPR_INFO_8H(reg, reg64) \
-do { \
- g_register_infos[gpr_##reg##_i386].byte_offset = GPR_OFFSET(reg64) + 1; \
-} while(false);
-
-#define UPDATE_FPR_INFO(reg, reg64) \
-do { \
- g_register_infos[fpu_##reg##_i386].byte_offset = FPR_OFFSET(reg64); \
-} while(false);
-
-#define UPDATE_FP_INFO(reg, i) \
-do { \
- g_register_infos[fpu_##reg##i##_i386].byte_offset = FPR_OFFSET(stmm[i]); \
-} while(false);
-
-#define UPDATE_XMM_INFO(reg, i) \
-do { \
- g_register_infos[fpu_##reg##i##_i386].byte_offset = FPR_OFFSET(reg[i]); \
-} while(false);
-
-#define UPDATE_YMM_INFO(reg, i) \
-do { \
- g_register_infos[fpu_##reg##i##_i386].byte_offset = YMM_OFFSET(reg[i]); \
-} while(false);
-
-#define UPDATE_DR_INFO(reg_index) \
-do { \
- g_register_infos[dr##reg_index##_i386].byte_offset = DR_OFFSET(reg_index); \
-} while(false);
-
- // Update the register offsets
- UPDATE_GPR_INFO(eax, rax);
- UPDATE_GPR_INFO(ebx, rbx);
- UPDATE_GPR_INFO(ecx, rcx);
- UPDATE_GPR_INFO(edx, rdx);
- UPDATE_GPR_INFO(edi, rdi);
- UPDATE_GPR_INFO(esi, rsi);
- UPDATE_GPR_INFO(ebp, rbp);
- UPDATE_GPR_INFO(esp, rsp);
- UPDATE_GPR_INFO(eip, rip);
- UPDATE_GPR_INFO(eflags, rflags);
- UPDATE_GPR_INFO(cs, cs);
- UPDATE_GPR_INFO(fs, fs);
- UPDATE_GPR_INFO(gs, gs);
- UPDATE_GPR_INFO(ss, ss);
- UPDATE_GPR_INFO(ds, ds);
- UPDATE_GPR_INFO(es, es);
-
- UPDATE_GPR_INFO(ax, rax);
- UPDATE_GPR_INFO(bx, rbx);
- UPDATE_GPR_INFO(cx, rcx);
- UPDATE_GPR_INFO(dx, rdx);
- UPDATE_GPR_INFO(di, rdi);
- UPDATE_GPR_INFO(si, rsi);
- UPDATE_GPR_INFO(bp, rbp);
- UPDATE_GPR_INFO(sp, rsp);
- UPDATE_GPR_INFO_8H(ah, rax);
- UPDATE_GPR_INFO_8H(bh, rbx);
- UPDATE_GPR_INFO_8H(ch, rcx);
- UPDATE_GPR_INFO_8H(dh, rdx);
- UPDATE_GPR_INFO(al, rax);
- UPDATE_GPR_INFO(bl, rbx);
- UPDATE_GPR_INFO(cl, rcx);
- UPDATE_GPR_INFO(dl, rdx);
-
- UPDATE_FPR_INFO(fctrl, fctrl);
- UPDATE_FPR_INFO(fstat, fstat);
- UPDATE_FPR_INFO(ftag, ftag);
- UPDATE_FPR_INFO(fop, fop);
- UPDATE_FPR_INFO(fiseg, ptr.i386.fiseg);
- UPDATE_FPR_INFO(fioff, ptr.i386.fioff);
- UPDATE_FPR_INFO(fooff, ptr.i386.fooff);
- UPDATE_FPR_INFO(foseg, ptr.i386.foseg);
- UPDATE_FPR_INFO(mxcsr, mxcsr);
- UPDATE_FPR_INFO(mxcsrmask, mxcsrmask);
-
- UPDATE_FP_INFO(st, 0);
- UPDATE_FP_INFO(st, 1);
- UPDATE_FP_INFO(st, 2);
- UPDATE_FP_INFO(st, 3);
- UPDATE_FP_INFO(st, 4);
- UPDATE_FP_INFO(st, 5);
- UPDATE_FP_INFO(st, 6);
- UPDATE_FP_INFO(st, 7);
- UPDATE_FP_INFO(mm, 0);
- UPDATE_FP_INFO(mm, 1);
- UPDATE_FP_INFO(mm, 2);
- UPDATE_FP_INFO(mm, 3);
- UPDATE_FP_INFO(mm, 4);
- UPDATE_FP_INFO(mm, 5);
- UPDATE_FP_INFO(mm, 6);
- UPDATE_FP_INFO(mm, 7);
-
- UPDATE_XMM_INFO(xmm, 0);
- UPDATE_XMM_INFO(xmm, 1);
- UPDATE_XMM_INFO(xmm, 2);
- UPDATE_XMM_INFO(xmm, 3);
- UPDATE_XMM_INFO(xmm, 4);
- UPDATE_XMM_INFO(xmm, 5);
- UPDATE_XMM_INFO(xmm, 6);
- UPDATE_XMM_INFO(xmm, 7);
-
- UPDATE_YMM_INFO(ymm, 0);
- UPDATE_YMM_INFO(ymm, 1);
- UPDATE_YMM_INFO(ymm, 2);
- UPDATE_YMM_INFO(ymm, 3);
- UPDATE_YMM_INFO(ymm, 4);
- UPDATE_YMM_INFO(ymm, 5);
- UPDATE_YMM_INFO(ymm, 6);
- UPDATE_YMM_INFO(ymm, 7);
-
- UPDATE_DR_INFO(0);
- UPDATE_DR_INFO(1);
- UPDATE_DR_INFO(2);
- UPDATE_DR_INFO(3);
- UPDATE_DR_INFO(4);
- UPDATE_DR_INFO(5);
- UPDATE_DR_INFO(6);
- UPDATE_DR_INFO(7);
-
-#undef UPDATE_GPR_INFO
-#undef UPDATE_GPR_INFO_8H
-#undef UPDATE_FPR_INFO
-#undef UPDATE_FP_INFO
-#undef UPDATE_XMM_INFO
-#undef UPDATE_YMM_INFO
-#undef UPDATE_DR_INFO
-
-#endif // UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
-
-#undef GPR_OFFSET
-#undef FPR_OFFSET
-#undef YMM_OFFSET
OpenPOWER on IntegriCloud