diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -696,6 +696,9 @@ virtual JITLoaderList &GetJITLoaders(); public: + /// Get the system architecture for this process. + virtual ArchSpec GetSystemArchitecture() { return {}; } + /// Get the system runtime plug-in for this process. /// /// \return diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -71,6 +71,8 @@ ThreadList &new_thread_list) override; bool IsAlive() override; + ArchSpec GetSystemArchitecture override(); + size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error) override; size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -576,6 +576,10 @@ } } +ArchSpec ProcessWindows::GetSystemArchitecture() { + return HostInfo::GetArchitecture(); +} + size_t ProcessWindows::DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error) { size_t bytes_read = 0; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -70,6 +70,8 @@ static std::chrono::seconds GetPacketTimeout(); + ArchSpec GetSystemArchitecture() override; + // Check if a given Process bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -208,6 +208,10 @@ return std::chrono::seconds(GetGlobalPluginProperties().GetPacketTimeout()); } +ArchSpec ProcessGDBRemote::GetSystemArchitecture() { + return m_gdb_comm.GetHostArchitecture(); +} + bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) { if (plugin_specified_by_name)