diff options
Diffstat (limited to 'lldb/source/Plugins')
6 files changed, 55 insertions, 50 deletions
diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index 1088924bfea..25a195e11a0 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -15,7 +15,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Interpreter/Args.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Core/RegularExpression.h" #include "lldb/Core/StreamFile.h" #include "lldb/DataFormatters/FormatManager.h" @@ -158,8 +158,8 @@ DynamicRegisterInfo::SetRegisterInfo (const lldb_private::PythonDictionary &dict regex_match.GetMatchAtIndex(slice_cstr, 2, msbit_str) && regex_match.GetMatchAtIndex(slice_cstr, 3, lsbit_str)) { - const uint32_t msbit = Args::StringToUInt32(msbit_str.c_str(), UINT32_MAX); - const uint32_t lsbit = Args::StringToUInt32(lsbit_str.c_str(), UINT32_MAX); + const uint32_t msbit = StringConvert::ToUInt32(msbit_str.c_str(), UINT32_MAX); + const uint32_t lsbit = StringConvert::ToUInt32(lsbit_str.c_str(), UINT32_MAX); if (msbit != UINT32_MAX && lsbit != UINT32_MAX) { if (msbit > lsbit) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 919fa540511..2ad4103cae4 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -26,6 +26,7 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Host/Pipe.h" #include "lldb/Host/Socket.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/Process.h" @@ -887,7 +888,7 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, if (error.Success()) { assert (num_bytes > 0 && port_cstr[num_bytes-1] == '\0'); - out_port = Args::StringToUInt32(port_cstr, 0); + out_port = StringConvert::ToUInt32(port_cstr, 0); if (log) log->Printf("GDBRemoteCommunication::%s() debugserver listens %u port", __FUNCTION__, out_port); } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 52750de5a25..70eed881452 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -28,6 +28,7 @@ #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/Target.h" @@ -1559,7 +1560,7 @@ GDBRemoteCommunicationClient::GetGDBServerVersion() size_t dot_pos = value.find('.'); if (dot_pos != std::string::npos) value[dot_pos] = '\0'; - const uint32_t version = Args::StringToUInt32(value.c_str(), UINT32_MAX, 0); + const uint32_t version = StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0); if (version != UINT32_MAX) { success = true; @@ -1625,14 +1626,14 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force) if (name.compare("cputype") == 0) { // exception type in big endian hex - cpu = Args::StringToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 0); + cpu = StringConvert::ToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 0); if (cpu != LLDB_INVALID_CPUTYPE) ++num_keys_decoded; } else if (name.compare("cpusubtype") == 0) { // exception count in big endian hex - sub = Args::StringToUInt32 (value.c_str(), 0, 0); + sub = StringConvert::ToUInt32 (value.c_str(), 0, 0); if (sub != 0) ++num_keys_decoded; } @@ -1700,7 +1701,7 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force) } else if (name.compare("ptrsize") == 0) { - pointer_byte_size = Args::StringToUInt32 (value.c_str(), 0, 0); + pointer_byte_size = StringConvert::ToUInt32 (value.c_str(), 0, 0); if (pointer_byte_size != 0) ++num_keys_decoded; } @@ -1725,7 +1726,7 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force) } else if (name.compare("default_packet_timeout") == 0) { - m_default_packet_timeout = Args::StringToUInt32(value.c_str(), 0); + m_default_packet_timeout = StringConvert::ToUInt32(value.c_str(), 0); if (m_default_packet_timeout > 0) { SetPacketTimeout(m_default_packet_timeout); @@ -2006,13 +2007,13 @@ GDBRemoteCommunicationClient::GetMemoryRegionInfo (lldb::addr_t addr, { if (name.compare ("start") == 0) { - addr_value = Args::StringToUInt64(value.c_str(), LLDB_INVALID_ADDRESS, 16, &success); + addr_value = StringConvert::ToUInt64(value.c_str(), LLDB_INVALID_ADDRESS, 16, &success); if (success) region_info.GetRange().SetRangeBase(addr_value); } else if (name.compare ("size") == 0) { - addr_value = Args::StringToUInt64(value.c_str(), 0, 16, &success); + addr_value = StringConvert::ToUInt64(value.c_str(), 0, 16, &success); if (success) region_info.GetRange().SetByteSize (addr_value); } @@ -2107,7 +2108,7 @@ GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num) { if (name.compare ("num") == 0) { - num = Args::StringToUInt32(value.c_str(), 0, 0); + num = StringConvert::ToUInt32(value.c_str(), 0, 0); m_num_supported_hardware_watchpoints = num; } } @@ -2309,27 +2310,27 @@ GDBRemoteCommunicationClient::DecodeProcessInfoResponse (StringExtractorGDBRemot { if (name.compare("pid") == 0) { - process_info.SetProcessID (Args::StringToUInt32 (value.c_str(), LLDB_INVALID_PROCESS_ID, 0)); + process_info.SetProcessID (StringConvert::ToUInt32 (value.c_str(), LLDB_INVALID_PROCESS_ID, 0)); } else if (name.compare("ppid") == 0) { - process_info.SetParentProcessID (Args::StringToUInt32 (value.c_str(), LLDB_INVALID_PROCESS_ID, 0)); + process_info.SetParentProcessID (StringConvert::ToUInt32 (value.c_str(), LLDB_INVALID_PROCESS_ID, 0)); } else if (name.compare("uid") == 0) { - process_info.SetUserID (Args::StringToUInt32 (value.c_str(), UINT32_MAX, 0)); + process_info.SetUserID (StringConvert::ToUInt32 (value.c_str(), UINT32_MAX, 0)); } else if (name.compare("euid") == 0) { - process_info.SetEffectiveUserID (Args::StringToUInt32 (value.c_str(), UINT32_MAX, 0)); + process_info.SetEffectiveUserID (StringConvert::ToUInt32 (value.c_str(), UINT32_MAX, 0)); } else if (name.compare("gid") == 0) { - process_info.SetGroupID (Args::StringToUInt32 (value.c_str(), UINT32_MAX, 0)); + process_info.SetGroupID (StringConvert::ToUInt32 (value.c_str(), UINT32_MAX, 0)); } else if (name.compare("egid") == 0) { - process_info.SetEffectiveGroupID (Args::StringToUInt32 (value.c_str(), UINT32_MAX, 0)); + process_info.SetEffectiveGroupID (StringConvert::ToUInt32 (value.c_str(), UINT32_MAX, 0)); } else if (name.compare("triple") == 0) { @@ -2351,11 +2352,11 @@ GDBRemoteCommunicationClient::DecodeProcessInfoResponse (StringExtractorGDBRemot } else if (name.compare("cputype") == 0) { - cpu = Args::StringToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 16); + cpu = StringConvert::ToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 16); } else if (name.compare("cpusubtype") == 0) { - sub = Args::StringToUInt32 (value.c_str(), 0, 16); + sub = StringConvert::ToUInt32 (value.c_str(), 0, 16); } else if (name.compare("vendor") == 0) { @@ -2441,13 +2442,13 @@ GDBRemoteCommunicationClient::GetCurrentProcessInfo () { if (name.compare("cputype") == 0) { - cpu = Args::StringToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 16); + cpu = StringConvert::ToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 16); if (cpu != LLDB_INVALID_CPUTYPE) ++num_keys_decoded; } else if (name.compare("cpusubtype") == 0) { - sub = Args::StringToUInt32 (value.c_str(), 0, 16); + sub = StringConvert::ToUInt32 (value.c_str(), 0, 16); if (sub != 0) ++num_keys_decoded; } @@ -2483,13 +2484,13 @@ GDBRemoteCommunicationClient::GetCurrentProcessInfo () } else if (name.compare("ptrsize") == 0) { - pointer_byte_size = Args::StringToUInt32 (value.c_str(), 0, 16); + pointer_byte_size = StringConvert::ToUInt32 (value.c_str(), 0, 16); if (pointer_byte_size != 0) ++num_keys_decoded; } else if (name.compare("pid") == 0) { - pid = Args::StringToUInt64(value.c_str(), 0, 16); + pid = StringConvert::ToUInt64(value.c_str(), 0, 16); if (pid != LLDB_INVALID_PROCESS_ID) ++num_keys_decoded; } @@ -2857,9 +2858,9 @@ GDBRemoteCommunicationClient::LaunchGDBserverAndGetPort (lldb::pid_t &pid, const while (response.GetNameColonValue(name, value)) { if (name.compare("port") == 0) - port = Args::StringToUInt32(value.c_str(), 0, 0); + port = StringConvert::ToUInt32(value.c_str(), 0, 0); else if (name.compare("pid") == 0) - pid = Args::StringToUInt64(value.c_str(), LLDB_INVALID_PROCESS_ID, 0); + pid = StringConvert::ToUInt64(value.c_str(), LLDB_INVALID_PROCESS_ID, 0); } return port; } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index a7149505e86..2df2ed8927b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -34,6 +34,7 @@ #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/FileAction.h" #include "lldb/Target/Platform.h" @@ -1512,27 +1513,27 @@ GDBRemoteCommunicationServer::Handle_qfProcessInfo (StringExtractorGDBRemote &pa } else if (key.compare("pid") == 0) { - match_info.GetProcessInfo().SetProcessID (Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0, &success)); + match_info.GetProcessInfo().SetProcessID (StringConvert::ToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0, &success)); } else if (key.compare("parent_pid") == 0) { - match_info.GetProcessInfo().SetParentProcessID (Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0, &success)); + match_info.GetProcessInfo().SetParentProcessID (StringConvert::ToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0, &success)); } else if (key.compare("uid") == 0) { - match_info.GetProcessInfo().SetUserID (Args::StringToUInt32(value.c_str(), UINT32_MAX, 0, &success)); + match_info.GetProcessInfo().SetUserID (StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0, &success)); } else if (key.compare("gid") == 0) { - match_info.GetProcessInfo().SetGroupID (Args::StringToUInt32(value.c_str(), UINT32_MAX, 0, &success)); + match_info.GetProcessInfo().SetGroupID (StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0, &success)); } else if (key.compare("euid") == 0) { - match_info.GetProcessInfo().SetEffectiveUserID (Args::StringToUInt32(value.c_str(), UINT32_MAX, 0, &success)); + match_info.GetProcessInfo().SetEffectiveUserID (StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0, &success)); } else if (key.compare("egid") == 0) { - match_info.GetProcessInfo().SetEffectiveGroupID (Args::StringToUInt32(value.c_str(), UINT32_MAX, 0, &success)); + match_info.GetProcessInfo().SetEffectiveGroupID (StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0, &success)); } else if (key.compare("all_users") == 0) { @@ -1627,7 +1628,7 @@ GDBRemoteCommunicationServer::Handle_qSpeedTest (StringExtractorGDBRemote &packe bool success = packet.GetNameColonValue(key, value); if (success && key.compare("response_size") == 0) { - uint32_t response_size = Args::StringToUInt32(value.c_str(), 0, 0, &success); + uint32_t response_size = StringConvert::ToUInt32(value.c_str(), 0, 0, &success); if (success) { if (response_size == 0) @@ -1901,7 +1902,7 @@ GDBRemoteCommunicationServer::Handle_qLaunchGDBServer (StringExtractorGDBRemote if (name.compare ("host") == 0) hostname.swap(value); else if (name.compare ("port") == 0) - port = Args::StringToUInt32(value.c_str(), 0, 0); + port = StringConvert::ToUInt32(value.c_str(), 0, 0); } if (port == UINT16_MAX) port = GetNextAvailablePort(); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index fe99706969c..de165454f58 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -42,6 +42,7 @@ #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" #include "lldb/Host/HostThread.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Host/Symbols.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/TimeValue.h" @@ -431,11 +432,11 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) } else if (name.compare("bitsize") == 0) { - reg_info.byte_size = Args::StringToUInt32(value.c_str(), 0, 0) / CHAR_BIT; + reg_info.byte_size = StringConvert::ToUInt32(value.c_str(), 0, 0) / CHAR_BIT; } else if (name.compare("offset") == 0) { - uint32_t offset = Args::StringToUInt32(value.c_str(), UINT32_MAX, 0); + uint32_t offset = StringConvert::ToUInt32(value.c_str(), UINT32_MAX, 0); if (reg_offset != offset) { reg_offset = offset; @@ -483,11 +484,11 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) } else if (name.compare("gcc") == 0) { - reg_info.kinds[eRegisterKindGCC] = Args::StringToUInt32(value.c_str(), LLDB_INVALID_REGNUM, 0); + reg_info.kinds[eRegisterKindGCC] = StringConvert::ToUInt32(value.c_str(), LLDB_INVALID_REGNUM, 0); } else if (name.compare("dwarf") == 0) { - reg_info.kinds[eRegisterKindDWARF] = Args::StringToUInt32(value.c_str(), LLDB_INVALID_REGNUM, 0); + reg_info.kinds[eRegisterKindDWARF] = StringConvert::ToUInt32(value.c_str(), LLDB_INVALID_REGNUM, 0); } else if (name.compare("generic") == 0) { @@ -502,7 +503,7 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) value_pair = value_pair.second.split(','); if (!value_pair.first.empty()) { - uint32_t reg = Args::StringToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); + uint32_t reg = StringConvert::ToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); if (reg != LLDB_INVALID_REGNUM) value_regs.push_back (reg); } @@ -517,7 +518,7 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) value_pair = value_pair.second.split(','); if (!value_pair.first.empty()) { - uint32_t reg = Args::StringToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); + uint32_t reg = StringConvert::ToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); if (reg != LLDB_INVALID_REGNUM) invalidate_regs.push_back (reg); } @@ -1656,17 +1657,17 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) if (name.compare("metype") == 0) { // exception type in big endian hex - exc_type = Args::StringToUInt32 (value.c_str(), 0, 16); + exc_type = StringConvert::ToUInt32 (value.c_str(), 0, 16); } else if (name.compare("medata") == 0) { // exception data in big endian hex - exc_data.push_back(Args::StringToUInt64 (value.c_str(), 0, 16)); + exc_data.push_back(StringConvert::ToUInt64 (value.c_str(), 0, 16)); } else if (name.compare("thread") == 0) { // thread in big endian hex - lldb::tid_t tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); + lldb::tid_t tid = StringConvert::ToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); // m_thread_list_real does have its own mutex, but we need to // hold onto the mutex between the call to m_thread_list_real.FindThreadByID(...) // and the m_thread_list_real.AddThread(...) so it doesn't change on us @@ -1702,12 +1703,12 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) { value[comma_pos] = '\0'; // thread in big endian hex - tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); + tid = StringConvert::ToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); if (tid != LLDB_INVALID_THREAD_ID) m_thread_ids.push_back (tid); value.erase(0, comma_pos + 1); } - tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); + tid = StringConvert::ToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); if (tid != LLDB_INVALID_THREAD_ID) m_thread_ids.push_back (tid); } @@ -1726,7 +1727,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) } else if (name.compare("qaddr") == 0) { - thread_dispatch_qaddr = Args::StringToUInt64 (value.c_str(), 0, 16); + thread_dispatch_qaddr = StringConvert::ToUInt64 (value.c_str(), 0, 16); } else if (name.compare("reason") == 0) { @@ -1747,7 +1748,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) // so it won't have to go and read it. if (gdb_thread) { - uint32_t reg = Args::StringToUInt32 (name.c_str(), UINT32_MAX, 16); + uint32_t reg = StringConvert::ToUInt32 (name.c_str(), UINT32_MAX, 16); if (reg != UINT32_MAX) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 067449a289b..8935f7143e4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -13,6 +13,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" +#include "lldb/Host/StringConvert.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/ObjectFile.h" @@ -992,11 +993,11 @@ DWARFCompileUnit::ParseProducerInfo () { std::string str; if (regex_match.GetMatchAtIndex (producer_cstr, 1, str)) - m_producer_version_major = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10); + m_producer_version_major = StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10); if (regex_match.GetMatchAtIndex (producer_cstr, 2, str)) - m_producer_version_minor = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10); + m_producer_version_minor = StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10); if (regex_match.GetMatchAtIndex (producer_cstr, 3, str)) - m_producer_version_update = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10); + m_producer_version_update = StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10); } m_producer = eProducerClang; } |