Author: Pavel Labath Date: 2022-02-07T14:58:55+01:00 New Revision: a53c5c66b3b1f576902154af2ecdac3bd2d5d556
URL: https://github.com/llvm/llvm-project/commit/a53c5c66b3b1f576902154af2ecdac3bd2d5d556 DIFF: https://github.com/llvm/llvm-project/commit/a53c5c66b3b1f576902154af2ecdac3bd2d5d556.diff LOG: [lldb/Platform] s/m_name/m_hostname m_name is confusing, as there is a getter called GetName, but it returns a completely different thing. Added: Modified: lldb/include/lldb/Target/Platform.h lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/source/Target/Platform.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index 4ef6c9d82b1a3..b804d4877c59c 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -892,7 +892,7 @@ class Platform : public PluginInterface { FileSpec m_working_dir; // The working directory which is used when installing // modules that have no install path set std::string m_remote_url; - std::string m_name; + std::string m_hostname; llvm::VersionTuple m_os_version; ArchSpec m_system_arch; // The architecture of the kernel or the remote platform diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 2ba791671412d..219d7c7e37b27 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -281,10 +281,10 @@ Status PlatformRemoteGDBServer::DisconnectRemote() { const char *PlatformRemoteGDBServer::GetHostname() { if (m_gdb_client_up) - m_gdb_client_up->GetHostname(m_name); - if (m_name.empty()) + m_gdb_client_up->GetHostname(m_hostname); + if (m_hostname.empty()) return nullptr; - return m_name.c_str(); + return m_hostname.c_str(); } llvm::Optional<std::string> diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 436ce9e00f027..3331235afa8b0 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -385,10 +385,9 @@ ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef trip /// Default Constructor Platform::Platform(bool is_host) : m_is_host(is_host), m_os_version_set_while_connected(false), - m_system_arch_set_while_connected(false), m_sdk_sysroot(), m_sdk_build(), - m_working_dir(), m_remote_url(), m_name(), m_system_arch(), m_mutex(), - m_max_uid_name_len(0), m_max_gid_name_len(0), m_supports_rsync(false), - m_rsync_opts(), m_rsync_prefix(), m_supports_ssh(false), m_ssh_opts(), + m_system_arch_set_while_connected(false), m_max_uid_name_len(0), + m_max_gid_name_len(0), m_supports_rsync(false), m_rsync_opts(), + m_rsync_prefix(), m_supports_ssh(false), m_ssh_opts(), m_ignores_remote_hostname(false), m_trap_handlers(), m_calculated_trap_handlers(false), m_module_cache(std::make_unique<ModuleCache>()) { @@ -793,9 +792,9 @@ const char *Platform::GetHostname() { if (IsHost()) return "127.0.0.1"; - if (m_name.empty()) + if (m_hostname.empty()) return nullptr; - return m_name.c_str(); + return m_hostname.c_str(); } ConstString Platform::GetFullNameForDylib(ConstString basename) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits