From 4c950235b2ad8e55f3ef83f15e875da0234cbea2 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 26 May 2017 13:53:39 +0000 Subject: [PATCH] Fix 32-bit builds r303972 used GetValueForKeyAsInteger with mismatched types (e.g. instantiating with uint64_t, but passing a size_t argument), which manifested itself on 32-bit architectures. The intended usage of these functions was to not specify the type explicitly, and let the compiler figure that out, so switch to that kind of usage instead. llvm-svn: 303988 --- .../GDBRemoteCommunicationServerLLGS.cpp | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 0b3bbfe..5aa2f49 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -1125,17 +1125,16 @@ GDBRemoteCommunicationServerLLGS::Handle_jTraceStart( auto json_dict = json_object->GetAsDictionary(); - json_dict->GetValueForKeyAsInteger("metabuffersize", - metabuffersize); + json_dict->GetValueForKeyAsInteger("metabuffersize", metabuffersize); options.setMetaDataBufferSize(metabuffersize); - json_dict->GetValueForKeyAsInteger("buffersize", buffersize); + json_dict->GetValueForKeyAsInteger("buffersize", buffersize); options.setTraceBufferSize(buffersize); - json_dict->GetValueForKeyAsInteger("type", type); + json_dict->GetValueForKeyAsInteger("type", type); options.setType(static_cast(type)); - json_dict->GetValueForKeyAsInteger("threadid", tid); + json_dict->GetValueForKeyAsInteger("threadid", tid); options.setThreadID(tid); StructuredData::ObjectSP custom_params_sp = @@ -1188,10 +1187,10 @@ GDBRemoteCommunicationServerLLGS::Handle_jTraceStop( auto json_dict = json_object->GetAsDictionary(); - if (!json_dict->GetValueForKeyAsInteger("traceid", uid)) + if (!json_dict->GetValueForKeyAsInteger("traceid", uid)) return SendIllFormedResponse(packet, "jTraceStop: Ill formed packet "); - json_dict->GetValueForKeyAsInteger("threadid", tid); + json_dict->GetValueForKeyAsInteger("threadid", tid); Status error = m_debugged_process_sp->StopTrace(uid, tid); @@ -1226,11 +1225,11 @@ GDBRemoteCommunicationServerLLGS::Handle_jTraceConfigRead( auto json_dict = json_object->GetAsDictionary(); - if (!json_dict->GetValueForKeyAsInteger("traceid", uid)) + if (!json_dict->GetValueForKeyAsInteger("traceid", uid)) return SendIllFormedResponse(packet, "jTraceConfigRead: Ill formed packet "); - json_dict->GetValueForKeyAsInteger("threadid", threadid); + json_dict->GetValueForKeyAsInteger("threadid", threadid); TraceOptions options; StreamGDBRemote response; @@ -1293,12 +1292,12 @@ GDBRemoteCommunicationServerLLGS::Handle_jTraceRead( auto json_dict = json_object->GetAsDictionary(); - if (!json_dict->GetValueForKeyAsInteger("traceid", uid) || - !json_dict->GetValueForKeyAsInteger("offset", offset) || - !json_dict->GetValueForKeyAsInteger("buffersize", byte_count)) + if (!json_dict->GetValueForKeyAsInteger("traceid", uid) || + !json_dict->GetValueForKeyAsInteger("offset", offset) || + !json_dict->GetValueForKeyAsInteger("buffersize", byte_count)) return SendIllFormedResponse(packet, "jTrace: Ill formed packet "); - json_dict->GetValueForKeyAsInteger("threadid", tid); + json_dict->GetValueForKeyAsInteger("threadid", tid); // Allocate the response buffer. uint8_t *buffer = new (std::nothrow) uint8_t[byte_count]; -- 2.7.4