[Lldb-commits] [lldb] r303988 - Fix 32-bit builds

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri May 26 06:53:39 PDT 2017


Author: labath
Date: Fri May 26 08:53:39 2017
New Revision: 303988

URL: http://llvm.org/viewvc/llvm-project?rev=303988&view=rev
Log:
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.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=303988&r1=303987&r2=303988&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Fri May 26 08:53:39 2017
@@ -1125,17 +1125,16 @@ GDBRemoteCommunicationServerLLGS::Handle
 
   auto json_dict = json_object->GetAsDictionary();
 
-  json_dict->GetValueForKeyAsInteger<uint64_t>("metabuffersize",
-                                               metabuffersize);
+  json_dict->GetValueForKeyAsInteger("metabuffersize", metabuffersize);
   options.setMetaDataBufferSize(metabuffersize);
 
-  json_dict->GetValueForKeyAsInteger<uint64_t>("buffersize", buffersize);
+  json_dict->GetValueForKeyAsInteger("buffersize", buffersize);
   options.setTraceBufferSize(buffersize);
 
-  json_dict->GetValueForKeyAsInteger<uint64_t>("type", type);
+  json_dict->GetValueForKeyAsInteger("type", type);
   options.setType(static_cast<lldb::TraceType>(type));
 
-  json_dict->GetValueForKeyAsInteger<uint64_t>("threadid", tid);
+  json_dict->GetValueForKeyAsInteger("threadid", tid);
   options.setThreadID(tid);
 
   StructuredData::ObjectSP custom_params_sp =
@@ -1188,10 +1187,10 @@ GDBRemoteCommunicationServerLLGS::Handle
 
   auto json_dict = json_object->GetAsDictionary();
 
-  if (!json_dict->GetValueForKeyAsInteger<lldb::user_id_t>("traceid", uid))
+  if (!json_dict->GetValueForKeyAsInteger("traceid", uid))
     return SendIllFormedResponse(packet, "jTraceStop: Ill formed packet ");
 
-  json_dict->GetValueForKeyAsInteger<lldb::tid_t>("threadid", tid);
+  json_dict->GetValueForKeyAsInteger("threadid", tid);
 
   Status error = m_debugged_process_sp->StopTrace(uid, tid);
 
@@ -1226,11 +1225,11 @@ GDBRemoteCommunicationServerLLGS::Handle
 
   auto json_dict = json_object->GetAsDictionary();
 
-  if (!json_dict->GetValueForKeyAsInteger<lldb::user_id_t>("traceid", uid))
+  if (!json_dict->GetValueForKeyAsInteger("traceid", uid))
     return SendIllFormedResponse(packet,
                                  "jTraceConfigRead: Ill formed packet ");
 
-  json_dict->GetValueForKeyAsInteger<lldb::tid_t>("threadid", threadid);
+  json_dict->GetValueForKeyAsInteger("threadid", threadid);
 
   TraceOptions options;
   StreamGDBRemote response;
@@ -1293,12 +1292,12 @@ GDBRemoteCommunicationServerLLGS::Handle
 
   auto json_dict = json_object->GetAsDictionary();
 
-  if (!json_dict->GetValueForKeyAsInteger<lldb::user_id_t>("traceid", uid) ||
-      !json_dict->GetValueForKeyAsInteger<uint64_t>("offset", offset) ||
-      !json_dict->GetValueForKeyAsInteger<uint64_t>("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<lldb::tid_t>("threadid", tid);
+  json_dict->GetValueForKeyAsInteger("threadid", tid);
 
   // Allocate the response buffer.
   uint8_t *buffer = new (std::nothrow) uint8_t[byte_count];




More information about the lldb-commits mailing list