diff options
Diffstat (limited to 'lldb/tools/debugserver/source/RNBRemote.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/RNBRemote.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index 61bdf0d8dac..64e3bc49abc 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -4643,6 +4643,24 @@ static bool GetHostCPUType(uint32_t &cputype, uint32_t &cpusubtype, return g_host_cputype != 0; } +static bool GetAddressingBits(uint32_t &addressing_bits) { + static uint32_t g_addressing_bits = 0; + static bool g_tried_addressing_bits_syscall = false; + if (g_tried_addressing_bits_syscall == false) { + size_t len = sizeof (uint32_t); + if (::sysctlbyname("machdep.virtual_address_size", + &g_addressing_bits, &len, NULL, 0) != 0) { + g_addressing_bits = 0; + } + } + g_tried_addressing_bits_syscall = true; + addressing_bits = g_addressing_bits; + if (addressing_bits > 0) + return true; + else + return false; +} + rnb_err_t RNBRemote::HandlePacket_qHostInfo(const char *p) { std::ostringstream strm; @@ -4655,6 +4673,11 @@ rnb_err_t RNBRemote::HandlePacket_qHostInfo(const char *p) { strm << "cpusubtype:" << std::dec << cpusubtype << ';'; } + uint32_t addressing_bits = 0; + if (GetAddressingBits(addressing_bits)) { + strm << "addressing_bits:" << std::dec << addressing_bits << ';'; + } + // The OS in the triple should be "ios" or "macosx" which doesn't match our // "Darwin" which gets returned from "kern.ostype", so we need to hardcode // this for now. |