Add StructuredData plugin type; showcase with new DarwinLog feature

Take 2, with missing cmake line fixed.  Build tested on
Ubuntu 14.04 with clang-3.6.

See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279202
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 1fa78fe..be5c3b5 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1175,7 +1175,7 @@
 {
     Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
     if (log)
-        log->Printf ("ProcessGDBRemote::DidLaunch()");
+        log->Printf ("ProcessGDBRemote::%s()", __FUNCTION__);
     if (GetID() != LLDB_INVALID_PROCESS_ID)
     {
         BuildDynamicRegisterInfo (false);
@@ -1271,6 +1271,13 @@
                 GetTarget().SetArchitecture (process_arch);
             }
         }
+
+        // Find out which StructuredDataPlugins are supported by the
+        // debug monitor.  These plugins transmit data over async $J packets.
+        auto supported_packets_array =
+            m_gdb_comm.GetSupportedStructuredDataPlugins();
+        if (supported_packets_array)
+            MapSupportedStructuredDataPlugins(*supported_packets_array);
     }
 }
 
@@ -4342,6 +4349,13 @@
     return object_sp;
 }
 
+Error
+ProcessGDBRemote::ConfigureStructuredData(const ConstString &type_name,
+                                          const StructuredData::ObjectSP
+                                          &config_sp)
+{
+    return m_gdb_comm.ConfigureRemoteStructuredData(type_name, config_sp);
+}
 
 // Establish the largest memory read/write payloads we should use.
 // If the remote stub has a max packet size, stay under that size.
@@ -5235,6 +5249,13 @@
     BuildDynamicRegisterInfo(true);
 }
 
+bool
+ProcessGDBRemote::HandleAsyncStructuredData(const StructuredData::ObjectSP
+                                            &object_sp)
+{
+    return RouteAsyncStructuredData(object_sp);
+}
+
 class CommandObjectProcessGDBRemoteSpeedTest: public CommandObjectParsed
 {
 public: