<div dir="ltr">Huh, that is totally weird.  I wonder what happened there?</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 18, 2016 at 8:12 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Weird, you linked to a phabricator revision but i never saw it come across to the mailing list<div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 18, 2016 at 8:00 PM Todd Fiala via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: tfiala<br>
Date: Thu Aug 18 21:52:07 2016<br>
New Revision: 279198<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279198&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=279198&view=rev</a><br>
Log:<br>
Add StructuredData plugin type; showcase with new DarwinLog feature<br>
<br>
See docs/structured_data/<wbr>StructuredDataPlugins.md for details.<br>
<br>
differential review: <a href="https://reviews.llvm.org/D22976" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D22976</a><br>
<br>
reviewers: clayborg, jingham<br>
<br>
Added:<br>
    lldb/trunk/docs/structured_<wbr>data/<br>
    lldb/trunk/docs/structured_<wbr>data/DarwinLog.md<br>
    lldb/trunk/docs/structured_<wbr>data/StructuredDataPlugins.md<br>
    lldb/trunk/include/lldb/API/<wbr>SBStructuredData.h<br>
    lldb/trunk/include/lldb/<wbr>Target/StructuredDataPlugin.h<br>
    lldb/trunk/include/lldb/<wbr>Target/<wbr>ThreadPlanCallOnFunctionExit.h<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/darwin_log.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>basic/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>basic/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>basic/TestDarwinLogBasic.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>basic/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>common/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>common/darwin_log_common.h<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity-<wbr>chain/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity-<wbr>chain/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity-<wbr>chain/<wbr>TestDarwinLogFilterMatchActivi<wbr>tyChain.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity-<wbr>chain/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity/<wbr>TestDarwinLogFilterMatchActivi<wbr>ty.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/activity/<wbr>main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/category/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/category/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/category/<wbr>TestDarwinLogFilterMatchCatego<wbr>ry.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/category/<wbr>main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/message/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/message/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/message/<wbr>TestDarwinLogFilterMatchMessag<wbr>e.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/message/<wbr>main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/subsystem/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/subsystem/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/subsystem/<wbr>TestDarwinLogFilterMatchSubsys<wbr>tem.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/exact_match/subsystem/<wbr>main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity-chain/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity-chain/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity-chain/<wbr>TestDarwinLogFilterRegexActivi<wbr>tyChain.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity-chain/<wbr>main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity/<wbr>TestDarwinLogFilterRegexActivi<wbr>ty.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/activity/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/category/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/category/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/category/<wbr>TestDarwinLogFilterRegexCatego<wbr>ry.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/category/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/message/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/message/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/message/<wbr>TestDarwinLogFilterRegexMessag<wbr>e.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/message/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/subsystem/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/subsystem/<wbr>Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/subsystem/<wbr>TestDarwinLogFilterRegexSubsys<wbr>tem.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>filter/regex/subsystem/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>format/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>format/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>format/<wbr>TestDarwinLogMessageFormat.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>format/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/debug/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/debug/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/debug/<wbr>TestDarwinLogSourceDebug.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/debug/main.c<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/info/<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/info/Makefile<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/info/<wbr>TestDarwinLogSourceInfo.py<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/darwin_log/<wbr>source/info/main.c<br>
    lldb/trunk/scripts/interface/<wbr>SBStructuredData.i<br>
    lldb/trunk/source/API/<wbr>SBStructuredData.cpp<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/CMakeLists.txt<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/DarwinLog/<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/DarwinLog/<wbr>CMakeLists.txt<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/DarwinLog/<wbr>StructuredDataDarwinLog.cpp<br>
    lldb/trunk/source/Plugins/<wbr>StructuredData/DarwinLog/<wbr>StructuredDataDarwinLog.h<br>
    lldb/trunk/source/Target/<wbr>StructuredDataPlugin.cpp<br>
    lldb/trunk/source/Target/<wbr>ThreadPlanCallOnFunctionExit.<wbr>cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/JSON.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/JSON.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>ActivityStore.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>ActivityStore.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>ActivityStreamSPI.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>CMakeLists.txt<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>DarwinLogCollector.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>DarwinLogCollector.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>DarwinLogEvent.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>DarwinLogInterfaces.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>DarwinLogTypes.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilter.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilter.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterChain.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterChain.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterExactMatch.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterExactMatch.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterRegex.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogFilterRegex.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogMessage.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogMessage.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogMessageOsLog.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/DarwinLog/<wbr>LogMessageOsLog.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/OsLogger.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/OsLogger.h<br>
Modified:<br>
    lldb/trunk/.gitignore<br>
    lldb/trunk/cmake/<wbr>LLDBDependencies.cmake<br>
    lldb/trunk/include/lldb/API/<wbr>LLDB.h<br>
    lldb/trunk/include/lldb/API/<wbr>SBDefines.h<br>
    lldb/trunk/include/lldb/API/<wbr>SBError.h<br>
    lldb/trunk/include/lldb/API/<wbr>SBProcess.h<br>
    lldb/trunk/include/lldb/API/<wbr>SBStream.h<br>
    lldb/trunk/include/lldb/Core/<wbr>Broadcaster.h<br>
    lldb/trunk/include/lldb/Core/<wbr>Event.h<br>
    lldb/trunk/include/lldb/Core/<wbr>PluginManager.h<br>
    lldb/trunk/include/lldb/<wbr>Interpreter/Args.h<br>
    lldb/trunk/include/lldb/<wbr>Target/Process.h<br>
    lldb/trunk/include/lldb/lldb-<wbr>forward.h<br>
    lldb/trunk/include/lldb/lldb-<wbr>private-interfaces.h<br>
    lldb/trunk/lldb.xcodeproj/<wbr>project.pbxproj<br>
    lldb/trunk/scripts/interface/<wbr>SBProcess.i<br>
    lldb/trunk/scripts/interface/<wbr>SBTarget.i<br>
    lldb/trunk/scripts/lldb.swig<br>
    lldb/trunk/source/API/<wbr>CMakeLists.txt<br>
    lldb/trunk/source/API/<wbr>SBDebugger.cpp<br>
    lldb/trunk/source/API/<wbr>SBProcess.cpp<br>
    lldb/trunk/source/API/<wbr>SystemInitializerFull.cpp<br>
    lldb/trunk/source/Core/<wbr>Debugger.cpp<br>
    lldb/trunk/source/Core/Event.<wbr>cpp<br>
    lldb/trunk/source/Core/<wbr>PluginManager.cpp<br>
    lldb/trunk/source/Interpreter/<wbr>Args.cpp<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>GDBRemoteClientBase.cpp<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>GDBRemoteClientBase.h<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>GDBRemoteCommunicationClient.<wbr>cpp<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>GDBRemoteCommunicationClient.h<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>ProcessGDBRemote.cpp<br>
    lldb/trunk/source/Plugins/<wbr>Process/gdb-remote/<wbr>ProcessGDBRemote.h<br>
    lldb/trunk/source/Target/<wbr>CMakeLists.txt<br>
    lldb/trunk/source/Target/<wbr>Platform.cpp<br>
    lldb/trunk/source/Target/<wbr>Process.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>debugserver.xcodeproj/project.<wbr>pbxproj<br>
    lldb/trunk/tools/debugserver/<wbr>source/CMakeLists.txt<br>
    lldb/trunk/tools/debugserver/<wbr>source/DNB.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/DNB.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/DNBDefs.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/MacOSX/CMakeLists.txt<br>
    lldb/trunk/tools/debugserver/<wbr>source/RNBContext.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/RNBContext.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/RNBRemote.cpp<br>
    lldb/trunk/tools/debugserver/<wbr>source/RNBRemote.h<br>
    lldb/trunk/tools/debugserver/<wbr>source/debugserver.cpp<br>
    lldb/trunk/tools/lldb-mi/<wbr>MICmnLLDBDebugger.cpp<br>
    lldb/trunk/tools/lldb-mi/<wbr>MICmnLLDBDebuggerHandleEvents.<wbr>cpp<br>
<br>
Modified: lldb/trunk/.gitignore<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/.gitignore?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/.gitignore?<wbr>rev=279198&r1=279197&r2=<wbr>279198&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/.gitignore (original)<br>
+++ lldb/trunk/.gitignore Thu Aug 18 21:52:07 2016<br>
@@ -40,7 +40,18 @@ __pycache__/<br>
<br>
 clang-module-cache<br>
<br>
+# Skip ctags-style tags files<br>
+tags<br>
+<br>
 # We should ignore Xcode-style embedding of llvm/ at lldb root dir.<br>
 # Do not add trailing '/'s, they skip symlinks.<br>
 /llvm<br>
 /DerivedData<br>
+<br>
+# Ignore test trace directories.<br>
+20??-??-??-??_??_??/<br>
+<br>
+# Ignore crashlog support files.<br>
+crashinfo.lock<br>
+crashinfo.so<br>
+<br>
<br>
Modified: lldb/trunk/cmake/<wbr>LLDBDependencies.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/cmake/<wbr>LLDBDependencies.cmake?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/cmake/<wbr>LLDBDependencies.cmake (original)<br>
+++ lldb/trunk/cmake/<wbr>LLDBDependencies.cmake Thu Aug 18 21:52:07 2016<br>
@@ -47,6 +47,7 @@ set( LLDB_USED_LIBS<br>
   <wbr>lldbPluginObjectContainerMachO<wbr>Archive<br>
   <wbr>lldbPluginObjectContainerBSDAr<wbr>chive<br>
   lldbPluginPlatformMacOSX<br>
+  lldbPluginStructuredDataDarwin<wbr>Log<br>
   <wbr>lldbPluginDynamicLoaderMacOSXD<wbr>YLD<br>
   <wbr>lldbPluginUnwindAssemblyInstEm<wbr>ulation<br>
   lldbPluginUnwindAssemblyX86<br>
<br>
Added: lldb/trunk/docs/structured_<wbr>data/DarwinLog.md<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/structured_data/DarwinLog.md?rev=279198&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/docs/<wbr>structured_data/DarwinLog.md?<wbr>rev=279198&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/docs/structured_<wbr>data/DarwinLog.md (added)<br>
+++ lldb/trunk/docs/structured_<wbr>data/DarwinLog.md Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,160 @@<br>
+# Change Notes<br>
+<br>
+## Summary<br>
+<br>
+This document describes the DarwinLog logging feature.<br>
+<br>
+## StructuredDataDarwinLog feature<br>
+<br>
+The DarwinLog feature supports logging os_log*() and NSLog() messages<br>
+to the command-line lldb console, as well as making those messages<br>
+available to LLDB clients via the event system.  Starting with fall<br>
+2016 OSes, Apple platforms introduce a new fire-hose, stream-style<br>
+logging system where the bulk of the log processing happens on the log<br>
+consumer side.  This reduces logging impact on the system when there<br>
+are no consumers, making it cheaper to include logging at all times.<br>
+However, it also increases the work needed on the consumer end when<br>
+log messages are desired.<br>
+<br>
+The debugserver binary has been modified to support collection of<br>
+os_log*()/NSLog() messages, selection of which messages appear in the<br>
+stream, and fine-grained filtering of what gets passed on to the LLDB<br>
+client.  DarwinLog also tracks the activity chain (i.e. os_activity()<br>
+hierarchy) in effect at the time the log messages were issued.  The<br>
+user is able to configure a number of aspects related to the<br>
+formatting of the log message header fields.<br>
+<br>
+The DarwinLog support is written in a way which should support the<br>
+lldb client side on non-Apple clients talking to an Apple device or<br>
+macOS system; hence, the plugin support is built into all LLDB<br>
+clients, not just those built on an Apple platform.<br>
+<br>
+StructuredDataDarwinLog implements the 'DarwinLog' feature type, and<br>
+the plugin name for it shows up as 'darwin-log'.<br>
+<br>
+The user interface to the darwin-log support is via the following:<br>
+<br>
+* 'plugin structured-data darwin-log enable' command<br>
+<br>
+  This is the main entry point for enabling the command.  It can be<br>
+  set before launching a process or while the process is running.<br>
+  If the user wants to squelch seeing info-level or debug-level<br>
+  messages, which is the default behavior, then the enable command<br>
+  must be made prior to launching the process; otherwise, the<br>
+  info-level and debug-level messages will always show up.  Also,<br>
+  there is a similar "echo os_log()/NSLog() messages to target<br>
+  process stderr" mechanism which is properly disabled when enabling<br>
+  the DarwinLog support prior to launch.  This cannot be squelched<br>
+  if enabling DarwinLog after launch.<br>
+<br>
+  See the help for this command.  There are a number of options<br>
+  to shrink or expand the number of messages that are processed<br>
+  on the remote side and sent over to the client, and other<br>
+  options to control the formatting of messages displayed.<br>
+<br>
+  This command is sticky.  Once enabled, it will stay enabled for<br>
+  future process launches.<br>
+<br>
+* 'plugin structured-data darwin-log disable' command<br>
+<br>
+  Executing this command disables os_log() capture in the currently<br>
+  running process and signals LLDB to stop attempting to launch<br>
+  new processes with DarwinLog support enabled.<br>
+<br>
+* 'settings set \<br>
+  plugin.structured-data.darwin-<wbr>log.enable-on-startup'<br>
+<br>
+  and<br>
+<br>
+  'settings set \<br>
+  plugin.structured-data.darwin-<wbr>log.auto-enable-options -- {options}'<br>
+<br>
+  When enable-on-startup is set to true, then LLDB will automatically<br>
+  enable DarwinLog on startup of relevant processes.  It will use the<br>
+  content provided in the auto-enable-options settings as the<br>
+  options to pass to the enable command.<br>
+<br>
+  Note the '--' required after auto-enable-command.  That is necessary<br>
+  for raw commands like settings set.  The '--' will not become part<br>
+  of the options for the enable command.<br>
+<br>
+### Message flow and related performance considerations<br>
+<br>
+os_log()-style collection is not free.  The more data that must be<br>
+processed, the slower it will be.  There are several knobs available<br>
+to the developer to limit how much data goes through the pipe, and how<br>
+much data ultimately goes over the wire to the LLDB client.  The<br>
+user's goal should be to ensure he or she only collects as many log<br>
+messages are needed, but no more.<br>
+<br>
+The flow of data looks like the following:<br>
+<br>
+1. Data comes into debugserver from the low-level OS facility that<br>
+   receives log messages.  The data that comes through this pipe can<br>
+   be limited or expanded by the '--debug', '--info' and<br>
+   '--all-processes' options of the 'plugin structured-data darwin-log<br>
+   enable' command.  options.  Exclude as many categories as possible<br>
+   here (also the default).  The knobs here are very coarse - for<br>
+   example, whether to include os_log_info()-level or<br>
+   os_log_debug()-level info, or to include callstacks in the log<br>
+   message event data.<br>
+<br>
+2. The debugserver process filters the messages that arrive through a<br>
+   message log filter that may be fully customized by the user.  It<br>
+   works similar to a rules-based packet filter: a set of rules are<br>
+   matched against the log message, each rule tried in sequential<br>
+   order.  The first rule that matches then either accepts or rejects<br>
+   the message.  If the log message does not match any rule, then the<br>
+   message gets the no-match (i.e. fall-through) action.  The no-match<br>
+   action defaults to accepting but may be set to reject.<br>
+<br>
+   Filters can be added via the enable command's '--filter<br>
+   {filter-spec}' option.  Filters are added in order, and multiple<br>
+   --filter entries can be provided to the enable command.<br>
+<br>
+   Filters take the following form:<br>
+<br>
+   {action} {attribute} {op}<br>
+<br>
+   {action} :=<br>
+       accept |<br>
+       reject<br>
+<br>
+   {attribute} :=<br>
+       category       |   // The log message category<br>
+       subsystem      |   // The log message subsystem}<br>
+       activity       |   // The child-most activity in force<br>
+                          // at the time the message was logged.<br>
+       activity-chain |   // The complete activity chain, specified<br>
+                          // as {parent-activity}:{child-<wbr>activity}:<br>
+                          // {grandchild-activity}<br>
+       message        |   // The fully expanded message contents.<br>
+                          // Note this one is expensive because it<br>
+                          // requires expanding the message.  Avoid<br>
+                          // this if possible, or add it further<br>
+                          // down the filter chain.<br>
+<br>
+   {op} :=<br>
+              match {exact-match-text} |<br>
+              regex {search-regex}        // uses C++ std::regex<br>
+                                          // ECMAScript variant.<br>
+<br>
+e.g.<br>
+   --filter "accept subsystem match com.example.mycompany.<wbr>myproduct"<br>
+   --filter "accept subsystem regex com.example.+"<br>
+   --filter "reject category regex spammy-system-[[:digit:]]+"<br>
+<br>
+3. Messages that are accepted by the log message filter get sent to<br>
+   the lldb client, where they are mapped to the<br>
+   StructuredDataDarwinLog plugin.  By default, command-line lldb will<br>
+   issue a Process-level event containing the log message content, and<br>
+   will request the plugin to print the message if the plugin is<br>
+   enabled to do so.<br>
+<br>
+### Log message display<br>
+<br>
+Several settings control aspects of displaying log messages in<br>
+command-line LLDB.  See the enable command's help for a description<br>
+of these.<br>
+<br>
+<br>
<br>
Added: lldb/trunk/docs/structured_<wbr>data/StructuredDataPlugins.md<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/structured_data/StructuredDataPlugins.md?rev=279198&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/docs/<wbr>structured_data/<wbr>StructuredDataPlugins.md?rev=<wbr>279198&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/docs/structured_<wbr>data/StructuredDataPlugins.md (added)<br>
+++ lldb/trunk/docs/structured_<wbr>data/StructuredDataPlugins.md Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,136 @@<br>
+# Change Notes<br>
+<br>
+## Overview<br>
+<br>
+This document describes an infrastructural feature called Structured<br>
+Data plugins.  See the DarwinLog.md doc for a description of one<br>
+such plugin that makes use of this feature.<br>
+<br>
+## StructuredDataPlugin<br>
+<br>
+StructuredDataPlugin instances have the following characteristics:<br>
+<br>
+* Each plugin instance is bound to a single Process instance.<br>
+<br>
+* Each StructuredData feature has a type name that identifies the<br>
+  feature. For instance, the type name for the DarwinLog feature is<br>
+  "DarwinLog". This feature type name is used in various places.<br>
+<br>
+* The process monitor reports the list of supported StructuredData<br>
+  features advertised by the process monitor. Process goes through the<br>
+  list of supported feature type names, and asks each known<br>
+  StructuredDataPlugin if it can handle the feature. The first plugin<br>
+  that supports the feature is mapped to that Process instance for<br>
+  that feature.  Plugins are only mapped when the process monitor<br>
+  advertises that a feature is supported.<br>
+<br>
+* The feature may send asynchronous messages in StructuredData format<br>
+  to the Process instance. Process instances route the asynchronous<br>
+  structured data messages to the plugin mapped to that feature type,<br>
+  if one exists.<br>
+<br>
+* Plugins can request that the Process instance forward on<br>
+  configuration data to the process monitor if the plugin needs/wants<br>
+  to configure the feature. Plugins may call the new Process method<br>
+<br>
+  ```C++<br>
+  virtual Error<br>
+  ConfigureStructuredData(const ConstString &type_name,<br>
+                          const StructuredData::ObjectSP &config_sp)<br>
+  ```<br>
+<br>
+  where type_name is the feature name and config_sp points to the<br>
+  configuration structured data, which may be nullptr.<br>
+<br>
+* Plugins for features present in a process are notified when modules<br>
+  are loaded into the Process instance via this StructuredDataPlugin<br>
+  method:<br>
+<br>
+  ```C++<br>
+  virtual void<br>
+  ModulesDidLoad(Process &process, ModuleList &module_list);<br>
+  ```<br>
+<br>
+* Plugins may optionally broadcast their received structured data as<br>
+  an LLDB process-level event via the following new Process call:<br>
+<br>
+  ```C++<br>
+  void<br>
+  BroadcastStructuredData(const StructuredData::ObjectSP &object_sp,<br>
+                          const lldb::StructuredDataPluginSP &plugin_sp);<br>
+  ```<br>
+<br>
+  IDE clients might use this feature to receive information about the<br>
+  process as it is running to monitor memory usage, CPU usage, and<br>
+  logging.<br>
+<br>
+  Internally, the event type created is an instance of<br>
+  EventDataStructuredData.<br>
+<br>
+* In the case where a plugin chooses to broadcast a received<br>
+  StructuredData event, the command-line LLDB Debugger instance<br>
+  listens for them. The Debugger instance then gives the plugin an<br>
+  opportunity to display info to either the debugger output or error<br>
+  stream at a time that is safe to write to them. The plugin can<br>
+  choose to display something appropriate regarding the structured<br>
+  data that time.<br>
+<br>
+* Plugins can provide a ProcessLaunchInfo filter method when the<br>
+  plugin is registered.  If such a filter method is provided, then<br>
+  when a process is about to be launched for debugging, the filter<br>
+  callback is invoked, given both the launch info and the target.  The<br>
+  plugin may then alter the launch info if needed to better support<br>
+  the feature of the plugin.<br>
+<br>
+* The plugin is entirely independent of the type of Process-derived<br>
+  class that it is working with. The only requirements from the<br>
+  process monitor are the following feature-agnostic elements:<br>
+<br>
+  * Provide a way to discover features supported by the process<br>
+    monitor for the current process.<br>
+<br>
+  * Specify the list of supported feature type names to Process.<br>
+    The process monitor does this by calling the following new<br>
+    method on Process:<br>
+<br>
+    ```C++<br>
+    void<br>
+    MapSupportedStructuredDataPlug<wbr>ins(const StructuredData::Array<br>
+                                      &supported_type_names)<br>
+    ```<br>
+<br>
+    The supported_type_names specifies an array of string entries,<br>
+    where each entry specifies the name of a StructuredData feature.<br>
+<br>
+  * Provide a way to forward on configuration data for a feature type<br>
+    to the process monitor.  This is the manner by which LLDB can<br>
+    configure a feature, perhaps based on settings or commands from<br>
+    the user.  The following virtual method on Process (described<br>
+    earlier) does the job:<br>
+<br>
+    ```C++<br>
+    virtual Error<br>
+    ConfigureStructuredData(const ConstString &type_name,<br>
+                            const StructuredData::ObjectSP &config_sp)<br>
+    ```<br>
+<br>
+  * Listen for asynchronous structured data packets from the process<br>
+    monitor, and forward them on to Process via this new Process<br>
+    member method:<br>
+<br>
+    ```C++<br>
+    bool<br>
+    RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp)<br>
+    ```<br>
+<br>
+* StructuredData producers must send their top-level data as a<br>
+  Dictionary type, with a key called 'type' specifying a string value,<br>
+  where the value is equal to the StructuredData feature/type name<br>
+  previously advertised. Everything else about the content of the<br>
+  dictionary is entirely up to the feature.<br>
+<br>
+* StructuredDataPlugin commands show up under 'plugin structured-data<br>
+  plugin-name'.<br>
+<br>
+* StructuredDataPlugin settings show up under<br>
+  'plugin.structured-data.{<wbr>plugin-name}.<br>
<br>
Modified: lldb/trunk/include/lldb/API/<wbr>LLDB.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/LLDB.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/LLDB.h?rev=279198&r1=<wbr>279197&r2=279198&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>LLDB.h (original)<br>
+++ lldb/trunk/include/lldb/API/<wbr>LLDB.h Thu Aug 18 21:52:07 2016<br>
@@ -55,6 +55,7 @@<br>
 #include "lldb/API/SBSourceManager.h"<br>
 #include "lldb/API/SBStream.h"<br>
 #include "lldb/API/SBStringList.h"<br>
+#include "lldb/API/SBStructuredData.h"<br>
 #include "lldb/API/SBSymbol.h"<br>
 #include "lldb/API/SBSymbolContext.h"<br>
 #include "lldb/API/SBSymbolContextList.<wbr>h"<br>
<br>
Modified: lldb/trunk/include/lldb/API/<wbr>SBDefines.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/SBDefines.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>SBDefines.h (original)<br>
+++ lldb/trunk/include/lldb/API/<wbr>SBDefines.h Thu Aug 18 21:52:07 2016<br>
@@ -71,6 +71,7 @@ class LLDB_API SBSection;<br>
 class LLDB_API SBSourceManager;<br>
 class LLDB_API SBStream;<br>
 class LLDB_API SBStringList;<br>
+class LLDB_API SBStructuredData;<br>
 class LLDB_API SBSymbol;<br>
 class LLDB_API SBSymbolContext;<br>
 class LLDB_API SBSymbolContextList;<br>
<br>
Modified: lldb/trunk/include/lldb/API/<wbr>SBError.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBError.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/SBError.h?rev=279198&<wbr>r1=279197&r2=279198&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>SBError.h (original)<br>
+++ lldb/trunk/include/lldb/API/<wbr>SBError.h Thu Aug 18 21:52:07 2016<br>
@@ -73,6 +73,7 @@ protected:<br>
     friend class SBHostOS;<br>
     friend class SBPlatform;<br>
     friend class SBProcess;<br>
+    friend class SBStructuredData;<br>
     friend class SBThread;<br>
     friend class SBTarget;<br>
     friend class SBValue;<br>
<br>
Modified: lldb/trunk/include/lldb/API/<wbr>SBProcess.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/SBProcess.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>SBProcess.h (original)<br>
+++ lldb/trunk/include/lldb/API/<wbr>SBProcess.h Thu Aug 18 21:52:07 2016<br>
@@ -32,7 +32,8 @@ public:<br>
         eBroadcastBitInterrupt      = (1 << 1),<br>
         eBroadcastBitSTDOUT         = (1 << 2),<br>
         eBroadcastBitSTDERR         = (1 << 3),<br>
-        eBroadcastBitProfileData    = (1 << 4)<br>
+        eBroadcastBitProfileData    = (1 << 4),<br>
+        eBroadcastBitStructuredData = (1 << 5)<br>
     };<br>
<br>
     SBProcess ();<br>
@@ -278,10 +279,16 @@ public:<br>
<br>
     static bool<br>
     GetInterruptedFromEvent (const lldb::SBEvent &event);<br>
-<br>
+<br>
+    static lldb::SBStructuredData<br>
+    GetStructuredDataFromEvent (const lldb::SBEvent &event);<br>
+<br>
     static bool<br>
     EventIsProcessEvent (const lldb::SBEvent &event);<br>
<br>
+    static bool<br>
+    EventIsStructuredDataEvent (const lldb::SBEvent &event);<br>
+<br>
     lldb::SBBroadcaster<br>
     GetBroadcaster () const;<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/API/<wbr>SBStream.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBStream.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/SBStream.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>SBStream.h (original)<br>
+++ lldb/trunk/include/lldb/API/<wbr>SBStream.h Thu Aug 18 21:52:07 2016<br>
@@ -83,6 +83,7 @@ protected:<br>
     friend class SBProcess;<br>
     friend class SBSection;<br>
     friend class SBSourceManager;<br>
+    friend class SBStructuredData;<br>
     friend class SBSymbol;<br>
     friend class SBSymbolContext;<br>
     friend class SBSymbolContextList;<br>
<br>
Added: lldb/trunk/include/lldb/API/<wbr>SBStructuredData.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBStructuredData.h?rev=279198&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/API/SBStructuredData.h?<wbr>rev=279198&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/API/<wbr>SBStructuredData.h (added)<br>
+++ lldb/trunk/include/lldb/API/<wbr>SBStructuredData.h Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,52 @@<br>
+//===-- SBStructuredData.h ------------------------------<wbr>--------*- C++ -*-===//<br>
+//<br>
+//                     The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+<br>
+#ifndef SBStructuredData_h<br>
+#define SBStructuredData_h<br>
+<br>
+#include "lldb/API/SBDefines.h"<br>
+#include "lldb/API/SBModule.h"<br>
+<br>
+namespace lldb {<br>
+<br>
+    class SBStructuredData<br>
+    {<br>
+    public:<br>
+<br>
+        SBStructuredData();<br>
+<br>
+        SBStructuredData(const lldb::SBStructuredData &rhs);<br>
+<br>
+        SBStructuredData(const lldb::EventSP &event_sp);<br>
+<br>
+        ~SBStructuredData();<br>
+<br>
+        lldb::SBStructuredData &<br>
+        operator =(const lldb::SBStructuredData &rhs);<br>
+<br>
+        bool<br>
+        IsValid() const;<br>
+<br>
+        void<br>
+        Clear();<br>
+<br>
+        lldb::SBError<br>
+        GetAsJSON(lldb::SBStream &stream) const;<br>
+<br>
+        lldb::SBError<br>
+        GetDescription(lldb::SBStream &stream) const;<br>
+<br>
+    private:<br>
+<br>
+        class Impl;<br>
+        std::unique_ptr<Impl> m_impl_up;<br>
+    };<br>
+}<br>
+<br>
+#endif /* SBStructuredData_h */<br>
<br>
Modified: lldb/trunk/include/lldb/Core/<wbr>Broadcaster.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Broadcaster.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Core/Broadcaster.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/Core/<wbr>Broadcaster.h (original)<br>
+++ lldb/trunk/include/lldb/Core/<wbr>Broadcaster.h Thu Aug 18 21:52:07 2016<br>
@@ -272,11 +272,10 @@ private:<br>
 ///         //---------------------------<wbr>------------------------------<wbr>-<br>
 ///         enum<br>
 ///         {<br>
-///             eBroadcastBitStateChanged   = (1 << 0),<br>
-///             eBroadcastBitInterrupt      = (1 << 1),<br>
-///             eBroadcastBitSTDOUT         = (1 << 2),<br>
-///             eBroadcastBitSTDERR         = (1 << 3),<br>
-///             eBroadcastBitProfileData    = (1 << 4)<br>
+///             eBroadcastBitOne   = (1 << 0),<br>
+///             eBroadcastBitTwo   = (1 << 1),<br>
+///             eBroadcastBitThree = (1 << 2),<br>
+///             ...<br>
 ///         };<br>
 ///     \endcode<br>
 //---------------------------<wbr>------------------------------<wbr>-------------<br>
<br>
Modified: lldb/trunk/include/lldb/Core/<wbr>Event.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Event.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Core/Event.h?rev=279198&<wbr>r1=279197&r2=279198&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/Core/<wbr>Event.h (original)<br>
+++ lldb/trunk/include/lldb/Core/<wbr>Event.h Thu Aug 18 21:52:07 2016<br>
@@ -20,6 +20,7 @@<br>
 // Project includes<br>
 #include "lldb/lldb-private.h"<br>
 #include "lldb/Core/ConstString.h"<br>
+#include "lldb/Core/StructuredData.h"<br>
 #include "lldb/Host/Predicate.h"<br>
 #include "lldb/Core/Broadcaster.h"<br>
<br>
@@ -159,6 +160,80 @@ private:<br>
 };<br>
<br>
 //---------------------------<wbr>------------------------------<wbr>-------------<br>
+/// This class handles one or more StructuredData::Dictionary entries<br>
+/// that are raised for structured data events.<br>
+//---------------------------<wbr>------------------------------<wbr>-------------<br>
+<br>
+class EventDataStructuredData : public EventData<br>
+{<br>
+public:<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    // Constructors<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    EventDataStructuredData();<br>
+<br>
+    EventDataStructuredData(const lldb::ProcessSP &process_sp,<br>
+                            const StructuredData::ObjectSP &object_sp,<br>
+                            const lldb::StructuredDataPluginSP &plugin_sp);<br>
+<br>
+    ~EventDataStructuredData() override;<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    // Member functions<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    const ConstString &<br>
+    GetFlavor() const override;<br>
+<br>
+    void<br>
+    Dump(Stream *s) const override;<br>
+<br>
+    const lldb::ProcessSP&<br>
+    GetProcess() const;<br>
+<br>
+    const StructuredData::ObjectSP&<br>
+    GetObject() const;<br>
+<br>
+    const lldb::StructuredDataPluginSP&<br>
+    GetStructuredDataPlugin() const;<br>
+<br>
+    void<br>
+    SetProcess(const lldb::ProcessSP &process_sp);<br>
+<br>
+    void<br>
+    SetObject(const StructuredData::ObjectSP &object_sp);<br>
+<br>
+    void<br>
+    SetStructuredDataPlugin(const lldb::StructuredDataPluginSP &plugin_sp);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    // Static functions<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    static const EventDataStructuredData*<br>
+    GetEventDataFromEvent(const Event *event_ptr);<br>
+<br>
+    static lldb::ProcessSP<br>
+    GetProcessFromEvent(const Event *event_ptr);<br>
+<br>
+    static StructuredData::ObjectSP<br>
+    GetObjectFromEvent(const Event *event_ptr);<br>
+<br>
+    static lldb::StructuredDataPluginSP<br>
+    GetPluginFromEvent(const Event *event_ptr);<br>
+<br>
+    static const ConstString &<br>
+    GetFlavorString ();<br>
+<br>
+private:<br>
+<br>
+    lldb::ProcessSP               m_process_sp;<br>
+    StructuredData::ObjectSP      m_object_sp;<br>
+    lldb::StructuredDataPluginSP  m_plugin_sp;<br>
+<br>
+    DISALLOW_COPY_AND_ASSIGN(<wbr>EventDataStructuredData);<br>
+};<br>
+<br>
+//---------------------------<wbr>------------------------------<wbr>-------------<br>
 // lldb::Event<br>
 //---------------------------<wbr>------------------------------<wbr>-------------<br>
 class Event<br>
<br>
Modified: lldb/trunk/include/lldb/Core/<wbr>PluginManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Core/PluginManager.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/Core/<wbr>PluginManager.h (original)<br>
+++ lldb/trunk/include/lldb/Core/<wbr>PluginManager.h Thu Aug 18 21:52:07 2016<br>
@@ -328,6 +328,65 @@ public:<br>
                                     CommandInterpreter &interpreter);<br>
<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
+    // StructuredDataPlugin<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    /// Register a StructuredDataPlugin class along with optional<br>
+    /// callbacks for debugger initialization and Process launch info<br>
+    /// filtering and manipulation.<br>
+    ///<br>
+    /// @param[in] name<br>
+    ///    The name of the plugin.<br>
+    ///<br>
+    /// @param[in] description<br>
+    ///    A description string for the plugin.<br>
+    ///<br>
+    /// @param[in] create_callback<br>
+    ///    The callback that will be invoked to create an instance of<br>
+    ///    the callback.  This may not be nullptr.<br>
+    ///<br>
+    /// @param[in] debugger_init_callback<br>
+    ///    An optional callback that will be made when a Debugger<br>
+    ///    instance is initialized.<br>
+    ///<br>
+    /// @param[in] filter_callback<br>
+    ///    An optional callback that will be invoked before LLDB<br>
+    ///    launches a process for debugging.  The callback must<br>
+    ///    do the following:<br>
+    ///    1. Only do something if the plugin's behavior is enabled.<br>
+    ///    2. Only make changes for processes that are relevant to the<br>
+    ///       plugin.  The callback gets a pointer to the Target, which<br>
+    ///       can be inspected as needed.  The ProcessLaunchInfo is<br>
+    ///       provided in read-write mode, and may be modified by the<br>
+    ///       plugin if, for instance, additional environment variables<br>
+    ///       are needed to support the feature when enabled.<br>
+    ///<br>
+    /// @return<br>
+    ///    Returns true upon success; otherwise, false.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    static bool<br>
+    RegisterPlugin(const ConstString &name,<br>
+                   const char *description,<br>
+                   <wbr>StructuredDataPluginCreateInst<wbr>ance create_callback,<br>
+                   DebuggerInitializeCallback debugger_init_callback = nullptr,<br>
+                   <wbr>StructuredDataFilterLaunchInfo filter_callback<br>
+                   = nullptr);<br>
+<br>
+    static bool<br>
+    UnregisterPlugin(<wbr>StructuredDataPluginCreateInst<wbr>ance create_callback);<br>
+<br>
+    static StructuredDataPluginCreateInst<wbr>ance<br>
+    GetStructuredDataPluginCreateC<wbr>allbackAtIndex(uint32_t idx);<br>
+<br>
+    static StructuredDataPluginCreateInst<wbr>ance<br>
+    GetStructuredDataPluginCreateC<wbr>allbackForPluginName(const ConstString &name);<br>
+<br>
+    static StructuredDataFilterLaunchInfo<br>
+    GetStructuredDataFilterCallbac<wbr>kAtIndex(uint32_t idx,<br>
+                                           bool &iteration_complete);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
     // SymbolFile<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
     static bool<br>
@@ -531,6 +590,16 @@ public:<br>
     static bool CreateSettingForOperatingSyste<wbr>mPlugin(Debugger &debugger,<br>
                                                       const lldb::OptionValuePropertiesSP &properties_sp,<br>
                                                       const ConstString &description, bool is_global_property);<br>
+<br>
+    static lldb::OptionValuePropertiesSP<br>
+    GetSettingForStructuredDataPlu<wbr>gin(Debugger &debugger,<br>
+                                      const ConstString &setting_name);<br>
+<br>
+    static bool<br>
+    CreateSettingForStructuredData<wbr>Plugin(Debugger &debugger,<br>
+                                         const lldb::OptionValuePropertiesSP &properties_sp,<br>
+                                         const ConstString &description,<br>
+                                         bool is_global_property);<br>
 };<br>
<br>
 } // namespace lldb_private<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Interpreter/Args.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Interpreter/Args.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Interpreter/Args.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Interpreter/Args.h Thu Aug 18 21:52:07 2016<br>
@@ -451,6 +451,17 @@ public:<br>
     LongestCommonPrefix (std::string &common_prefix);<br>
<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
+    /// Add or replace an environment variable with the given value.<br>
+    ///<br>
+    /// This command adds the environment variable if it is not already<br>
+    /// present using the given value.  If the environment variable is<br>
+    /// already in the list, it replaces the first such occurrence<br>
+    /// with the new value.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    void<br>
+    AddOrReplaceEnvironmentVariabl<wbr>e(const char *env_var_name,<br>
+                                    const char *new_value);<br>
+<br>
     /// Return whether a given environment variable exists.<br>
     ///<br>
     /// This command treats Args like a list of environment variables,<br>
@@ -460,12 +471,18 @@ public:<br>
     /// @param[in] env_var_name<br>
     ///     Specifies the name of the environment variable to check.<br>
     ///<br>
+    /// @param[out] argument_index<br>
+    ///     If non-null, then when the environment variable is found,<br>
+    ///     the index of the argument position will be returned in<br>
+    ///     the size_t pointed to by this argument.<br>
+    ///<br>
     /// @return<br>
     ///     true if the specified env var name exists in the list in<br>
     ///     either of the above-mentioned formats; otherwise, false.<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
     bool<br>
-    ContainsEnvironmentVariable(<wbr>const char *env_var_name) const;<br>
+    ContainsEnvironmentVariable(<wbr>const char *env_var_name,<br>
+                                size_t *argument_index = nullptr) const;<br>
<br>
 protected:<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Target/Process.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/Process.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/Process.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/Process.h Thu Aug 18 21:52:07 2016<br>
@@ -760,7 +760,8 @@ public:<br>
         eBroadcastBitInterrupt      = (1 << 1),<br>
         eBroadcastBitSTDOUT         = (1 << 2),<br>
         eBroadcastBitSTDERR         = (1 << 3),<br>
-        eBroadcastBitProfileData    = (1 << 4)<br>
+        eBroadcastBitProfileData    = (1 << 4),<br>
+        eBroadcastBitStructuredData = (1 << 5),<br>
     };<br>
<br>
     enum<br>
@@ -3254,6 +3255,71 @@ public:<br>
     <wbr>AdvanceAddressToNextBranchInst<wbr>ruction (Address default_stop_addr,<br>
                                            AddressRange range_bounds);<br>
<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    /// Configure asynchronous structured data feature.<br>
+    ///<br>
+    /// Each Process type that supports using an asynchronous StructuredData<br>
+    /// feature should implement this to enable/disable/configure the feature.<br>
+    /// The default implementation here will always return an error indiciating<br>
+    /// the feature is unsupported.<br>
+    ///<br>
+    /// StructuredDataPlugin implementations will call this to configure<br>
+    /// a feature that has been reported as being supported.<br>
+    ///<br>
+    /// @param[in] type_name<br>
+    ///     The StructuredData type name as previously discovered by<br>
+    ///     the Process-derived instance.<br>
+    ///<br>
+    /// @param[in] config<br>
+    ///     Configuration data for the feature being enabled.  This config<br>
+    ///     data, which may be null, will be passed along to the feature<br>
+    ///     to process.  The feature will dictate whether this is a dictionary,<br>
+    ///     an array or some other object.  If the feature needs to be<br>
+    ///     set up properly before it can be enabled, then the config should<br>
+    ///     also take an enable/disable flag.<br>
+    ///<br>
+    /// @return<br>
+    ///     Returns the result of attempting to configure the feature.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    virtual Error<br>
+    ConfigureStructuredData(const ConstString &type_name,<br>
+                            const StructuredData::ObjectSP &config_sp);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    /// Broadcasts the given structured data object from the given<br>
+    /// plugin.<br>
+    ///<br>
+    /// StructuredDataPlugin instances can use this to optionally<br>
+    /// broadcast any of their data if they want to make it available<br>
+    /// for clients.  The data will come in on the structured data<br>
+    /// event bit (eBroadcastBitStructuredData).<br>
+    ///<br>
+    /// @param[in] object_sp<br>
+    ///     The structured data object to broadcast.<br>
+    ///<br>
+    /// @param[in] plugin_sp<br>
+    ///     The plugin that will be reported in the event's plugin<br>
+    ///     parameter.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    void<br>
+    BroadcastStructuredData(const StructuredData::ObjectSP &object_sp,<br>
+                            const lldb::StructuredDataPluginSP &plugin_sp);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    /// Returns the StructuredDataPlugin associated with a given type<br>
+    /// name, if there is one.<br>
+    ///<br>
+    /// There will only be a plugin for a given StructuredDataType if the<br>
+    /// debugged process monitor claims that the feature is supported.<br>
+    /// This is one way to tell whether a feature is available.<br>
+    ///<br>
+    /// @return<br>
+    ///     The plugin if one is available for the specified feature;<br>
+    ///     otherwise, returns an empty shared pointer.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    lldb::StructuredDataPluginSP<br>
+    GetStructuredDataPlugin(const ConstString &type_name) const;<br>
+<br>
 protected:<br>
     void<br>
     SetState (lldb::EventSP &event_sp);<br>
@@ -3392,6 +3458,57 @@ protected:<br>
     }<br>
<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
+    /// Loads any plugins associated with asynchronous structured data<br>
+    /// and maps the relevant supported type name to the plugin.<br>
+    ///<br>
+    /// Processes can receive asynchronous structured data from the<br>
+    /// process monitor.  This method will load and map any structured<br>
+    /// data plugins that support the given set of supported type names.<br>
+    /// Later, if any of these features are enabled, the process monitor<br>
+    /// is free to generate asynchronous structured data.  The data must<br>
+    /// come in as a single \b StructuredData::Dictionary.  That dictionary<br>
+    /// must have a string field named 'type', with a value that equals<br>
+    /// the relevant type name string (one of the values in<br>
+    /// \b supported_type_names).<br>
+    ///<br>
+    /// @param[in] supported_type_names<br>
+    ///     An array of zero or more type names.  Each must be unique.<br>
+    ///     For each entry in the list, a StructuredDataPlugin will be<br>
+    ///     searched for that supports the structured data type name.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    void<br>
+    MapSupportedStructuredDataPlug<wbr>ins(const StructuredData::Array<br>
+                                           &supported_type_names);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    /// Route the incoming structured data dictionary to the right plugin.<br>
+    ///<br>
+    /// The incoming structured data must be a dictionary, and it must<br>
+    /// have a key named 'type' that stores a string value.  The string<br>
+    /// value must be the name of the structured data feature that<br>
+    /// knows how to handle it.<br>
+    ///<br>
+    /// @param[in] object_sp<br>
+    ///     When non-null and pointing to a dictionary, the 'type'<br>
+    ///     key's string value is used to look up the plugin that<br>
+    ///     was registered for that structured data type.  It then<br>
+    ///     calls the following method on the StructuredDataPlugin<br>
+    ///     instance:<br>
+    ///<br>
+    ///     virtual void<br>
+    ///     <wbr>HandleArrivalOfStructuredData(<wbr>Process &process,<br>
+    ///                                   const ConstString &type_name,<br>
+    ///                                   const StructuredData::ObjectSP<br>
+    ///                                   &object_sp)<br>
+    ///<br>
+    /// @return<br>
+    ///     True if the structured data was routed to a plugin; otherwise,<br>
+    ///     false.<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
+    bool<br>
+    RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp);<br>
+<br>
+    //----------------------------<wbr>------------------------------<wbr>--------<br>
     // Type definitions<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
     typedef std::map<lldb::LanguageType, lldb::LanguageRuntimeSP> LanguageRuntimeCollection;<br>
@@ -3408,6 +3525,9 @@ protected:<br>
         {<br>
         }<br>
     };<br>
+<br>
+    using StructuredDataPluginMap = std::map<ConstString,<br>
+                                             lldb::StructuredDataPluginSP><wbr>;<br>
<br>
     //---------------------------<wbr>------------------------------<wbr>---------<br>
     // Member variables<br>
@@ -3477,7 +3597,9 @@ protected:<br>
     bool m_can_interpret_function_<wbr>calls; // Some targets, e.g the OSX kernel, don't support the ability to modify the stack.<br>
     WarningsCollection          m_warnings_issued;  // A set of object pointers which have already had warnings printed<br>
     std::mutex                  m_run_thread_plan_lock;<br>
-<br>
+    StructuredDataPluginMap     m_structured_data_plugin_map;<br>
+<br>
+<br>
     enum {<br>
         eCanJITDontKnow= 0,<br>
         eCanJITYes,<br>
@@ -3562,7 +3684,7 @@ protected:<br>
<br>
     void<br>
     BroadcastAsyncProfileData(<wbr>const std::string &one_profile_data);<br>
-<br>
+<br>
     static void<br>
     STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len);<br>
<br>
<br>
Added: lldb/trunk/include/lldb/<wbr>Target/StructuredDataPlugin.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StructuredDataPlugin.h?rev=279198&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/<wbr>StructuredDataPlugin.h?rev=<wbr>279198&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/StructuredDataPlugin.h (added)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/StructuredDataPlugin.h Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,204 @@<br>
+//===-- StructuredDataPlugin.h ------------------------------<wbr>----*- C++ -*-===//<br>
+//<br>
+//                     The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+<br>
+#ifndef StructuredDataPlugin_h<br>
+#define StructuredDataPlugin_h<br>
+<br>
+#include "lldb/Core/PluginInterface.h"<br>
+#include "lldb/Core/StructuredData.h"<br>
+<br>
+namespace lldb_private<br>
+{<br>
+<br>
+class CommandObjectMultiword;<br>
+<br>
+// ------------------------------<wbr>------------------------------<wbr>-----------------<br>
+/// Plugin that supports process-related structured data sent asynchronously<br>
+/// from the debug monitor (e.g. debugserver, lldb-server, etc.)<br>
+///<br>
+/// This plugin type is activated by a Process-derived instance when that<br>
+/// instance detects that a given structured data feature is available.<br>
+///<br>
+/// StructuredDataPlugin instances are inherently tied to a process.  The<br>
+/// main functionality they support is the ability to consume asynchronously-<br>
+/// delivered structured data from the process monitor, and do something<br>
+/// reasonable with it.  Something reasonable can include broadcasting a<br>
+/// StructuredData event, which other parts of the system can then do with<br>
+/// as they please.  An IDE could use this facility to retrieve CPU usage,<br>
+/// memory usage, and other run-time aspects of the process.  That data<br>
+/// can then be displayed meaningfully to the user through the IDE.<br>
+<br>
+/// For command-line LLDB, the Debugger instance listens for the structured<br>
+/// data events raised by the plugin, and give the plugin both the output<br>
+/// and error streams such that the plugin can display something about the<br>
+/// event, at a time when the debugger ensures it is safe to write to the<br>
+/// output or error streams.<br>
+// ------------------------------<wbr>------------------------------<wbr>-----------------<br>
+<br>
+class StructuredDataPlugin :<br>
+    public PluginInterface,<br>
+    public std::enable_shared_from_this<<wbr>StructuredDataPlugin><br>
+{<br>
+public:<br>
+<br>
+    virtual ~StructuredDataPlugin();<br>
+<br>
+    lldb::ProcessSP<br>
+    GetProcess() const;<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    // Public instance API<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Return whether this plugin supports the given StructuredData feature.<br>
+    ///<br>
+    /// When Process is informed of a list of process-monitor-supported<br>
+    /// structured data features, Process will go through the list of plugins,<br>
+    /// one at a time, and have the first plugin that supports a given feature<br>
+    /// be the plugin instantiated to handle that feature.  There is a 1-1<br>
+    /// correspondence between a Process instance and a StructuredDataPlugin<br>
+    /// mapped to that process.  A plugin can support handling multiple<br>
+    /// features, and if that happens, there is a single plugin instance<br>
+    /// created covering all of the mapped features for a given process.<br>
+    ///<br>
+    /// @param[in] type_name<br>
+    ///     The name of the feature tag supported by a process.<br>
+    ///     e.g. "darwin-log".<br>
+    ///<br>
+    /// @return<br>
+    ///     true if the plugin supports the feature; otherwise, false.<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    virtual bool<br>
+    SupportsStructuredDataType(<wbr>const ConstString &type_name) = 0;<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Handle the arrival of asynchronous structured data from the process.<br>
+    ///<br>
+    /// When asynchronous structured data arrives from the process monitor,<br>
+    /// it is immediately delivered to the plugin mapped for that feature<br>
+    /// if one exists.  The structured data that arrives from a process<br>
+    /// monitor must be a dictionary, and it must have a string field named<br>
+    /// "type" that must contain the StructuredData feature name set as the<br>
+    /// value.  This is the manner in which the data is routed to the proper<br>
+    /// plugin instance.<br>
+    ///<br>
+    /// @param[in] process<br>
+    ///     The process instance that just received the structured data.<br>
+    ///     This will always be the same process for a given instance of<br>
+    ///     a plugin.<br>
+    ///<br>
+    /// @param[in] type_name<br>
+    ///     The name of the feature tag for the asynchronous structured data.<br>
+    ///     Note this data will also be present in the \b object_sp dictionary<br>
+    ///     under the string value with key "type".<br>
+    ///<br>
+    /// @param[in] object_sp<br>
+    ///     A shared pointer to the structured data that arrived.  This must<br>
+    ///     be a dictionary.  The only key required is the aforementioned<br>
+    ///     key named "type" that must be a string value containing the<br>
+    ///     structured data type name.<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    virtual void<br>
+    HandleArrivalOfStructuredData(<wbr>Process &process,<br>
+                                  const ConstString &type_name,<br>
+                                  const StructuredData::ObjectSP<br>
+                                  &object_sp) = 0;<br>
+<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Get a human-readable description of the contents of the data.<br>
+    ///<br>
+    /// In command-line LLDB, this method will be called by the Debugger<br>
+    /// instance for each structured data event generated, and the output<br>
+    /// will be printed to the LLDB console.  If nothing is added to the stream,<br>
+    /// nothing will be printed; otherwise, a newline will be added to the end<br>
+    /// when displayed.<br>
+    ///<br>
+    /// @param[in] object_sp<br>
+    ///     A shared pointer to the structured data to format.<br>
+    ///<br>
+    /// @param[in] stream<br>
+    ///     The stream where the structured data should be pretty printed.<br>
+    ///<br>
+    /// @return<br>
+    ///     The error if formatting the object contents failed; otherwise,<br>
+    ///     success.<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    virtual Error<br>
+    GetDescription(const StructuredData::ObjectSP &object_sp,<br>
+                   lldb_private::Stream &stream) = 0;<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Returns whether the plugin's features are enabled.<br>
+    ///<br>
+    /// This is a convenience method for plugins that can enable or disable<br>
+    /// their functionality.  It allows retrieval of this state without<br>
+    /// requiring a cast.<br>
+    ///<br>
+    /// @param[in] type_name<br>
+    ///     The name of the feature tag for the asynchronous structured data.<br>
+    ///     This is needed for plugins that support more than one feature.<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    virtual bool<br>
+    GetEnabled(const ConstString &type_name) const;<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Allow the plugin to do work related to modules that loaded in the<br>
+    /// the corresponding process.<br>
+    ///<br>
+    /// This method defaults to doing nothing.  Plugins can override it<br>
+    /// if they have any behavior they want to enable/modify based on loaded<br>
+    /// modules.<br>
+    ///<br>
+    /// @param[in] process<br>
+    ///     The process that just was notified of modules having been loaded.<br>
+    ///     This will always be the same process for a given instance of<br>
+    ///     a plugin.<br>
+    ///<br>
+    /// @param[in] module_list<br>
+    ///     The list of modules that the process registered as having just<br>
+    ///     loaded.  See \b Process::ModulesDidLoad(...).<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    virtual void<br>
+    ModulesDidLoad(Process &process, ModuleList &module_list);<br>
+<br>
+protected:<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    // Derived-class API<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    StructuredDataPlugin(const lldb::ProcessWP &process_wp);<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    /// Derived classes must call this before attempting to hook up commands<br>
+    /// to the 'plugin structured-data' tree.<br>
+    ///<br>
+    /// This ensures the relevant command and options hook points for all<br>
+    /// StructuredDataPlugin derived classes are available for this debugger.<br>
+    /// If this has already happened, this call is a no-op.<br>
+    ///<br>
+    /// @param[in] debugger<br>
+    ///     The Debugger instance for which we're creating the required shared<br>
+    ///     components for the StructuredDataPlugin derived classes.<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    static void<br>
+    InitializeBasePluginForDebugge<wbr>r(Debugger &debugger);<br>
+<br>
+private:<br>
+<br>
+    lldb::ProcessWP m_process_wp;<br>
+<br>
+    DISALLOW_COPY_AND_ASSIGN(<wbr>StructuredDataPlugin);<br>
+<br>
+};<br>
+<br>
+}<br>
+<br>
+#endif<br>
<br>
Added: lldb/trunk/include/lldb/<wbr>Target/<wbr>ThreadPlanCallOnFunctionExit.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallOnFunctionExit.h?rev=279198&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/<wbr>ThreadPlanCallOnFunctionExit.<wbr>h?rev=279198&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/<wbr>ThreadPlanCallOnFunctionExit.h (added)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/<wbr>ThreadPlanCallOnFunctionExit.h Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,69 @@<br>
+//===-- ThreadPlanCallOnFunctionExit.h --------------------------*- C++ -*-===//<br>
+//<br>
+//                     The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+<br>
+#ifndef ThreadPlanCallOnFunctionExit_h<br>
+#define ThreadPlanCallOnFunctionExit_h<br>
+<br>
+#include "lldb/Target/ThreadPlan.h"<br>
+<br>
+#include <functional><br>
+<br>
+namespace lldb_private {<br>
+<br>
+// ==============================<wbr>==============================<wbr>=================<br>
+/// This thread plan calls a function object when the current function exits.<br>
+// ==============================<wbr>==============================<wbr>=================<br>
+<br>
+class ThreadPlanCallOnFunctionExit : public ThreadPlan<br>
+{<br>
+public:<br>
+<br>
+    /// Definition for the callback made when the currently executing thread<br>
+    /// finishes executing its function.<br>
+    using Callback = std::function<void()>;<br>
+<br>
+    ThreadPlanCallOnFunctionExit(<wbr>Thread &thread, const Callback &callback);<br>
+<br>
+    void<br>
+    DidPush() override;<br>
+<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+    // ThreadPlan API<br>
+    // ------------------------------<wbr>------------------------------<wbr>-------------<br>
+<br>
+    void<br>
+    GetDescription (Stream *s, lldb::DescriptionLevel level) override;<br>
+<br>
+    bool<br>
+    ValidatePlan (Stream *error) override;<br>
+<br>
+    bool<br>
+    ShouldStop (Event *event_ptr) override;<br>
+<br>
+    bool<br>
+    WillStop () override;<br>
+<br>
+protected:<br>
+<br>
+    bool<br>
+    DoPlanExplainsStop (Event *event_ptr) override;<br>
+<br>
+    lldb::StateType<br>
+    GetPlanRunState () override;<br>
+<br>
+private:<br>
+<br>
+    Callback m_callback;<br>
+    lldb::ThreadPlanSP m_step_out_threadplan_sp;<br>
+<br>
+};<br>
+<br>
+}<br>
+<br>
+#endif /* ThreadPlanCallOnFunctionExit_h */<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-<wbr>forward.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/lldb-forward.h?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/lldb-<wbr>forward.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-<wbr>forward.h Thu Aug 18 21:52:07 2016<br>
@@ -91,6 +91,7 @@ class   Error;<br>
 class   EvaluateExpressionOptions;<br>
 class   Event;<br>
 class   EventData;<br>
+class   EventDataStructuredData;<br>
 class   ExecutionContext;<br>
 class   ExecutionContextRef;<br>
 class   ExecutionContextRefLocker;<br>
@@ -215,6 +216,7 @@ class   StreamFile;<br>
 class   StreamString;<br>
 class   StringList;<br>
 struct  StringSummaryFormat;<br>
+class   StructuredDataPlugin;<br>
 class   SystemRuntime;<br>
 class   TypeSummaryImpl;<br>
 class   TypeSummaryOptions;<br>
@@ -333,6 +335,7 @@ namespace lldb {<br>
     typedef std::unique_ptr<lldb_private::<wbr>DynamicLoader> DynamicLoaderUP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>Event> EventSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>EventData> EventDataSP;<br>
+    typedef std::shared_ptr<lldb_private::<wbr>EventDataStructuredData> EventDataStructuredDataSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>ExecutionContextRef> ExecutionContextRefSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>ExpressionVariable> ExpressionVariableSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>File> FileSP;<br>
@@ -415,6 +418,10 @@ namespace lldb {<br>
     typedef std::weak_ptr<lldb_private::<wbr>Stream> StreamWP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>StreamFile> StreamFileSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>StringSummaryFormat> StringTypeSummaryImplSP;<br>
+    typedef std::shared_ptr<lldb_private::<wbr>StructuredDataPlugin><br>
+        StructuredDataPluginSP;<br>
+    typedef std::weak_ptr<lldb_private::<wbr>StructuredDataPlugin><br>
+    StructuredDataPluginWP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>SymbolFile> SymbolFileSP;<br>
     typedef std::shared_ptr<lldb_private::<wbr>SymbolFileType> SymbolFileTypeSP;<br>
     typedef std::weak_ptr<lldb_private::<wbr>SymbolFileType> SymbolFileTypeWP;<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-<wbr>private-interfaces.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/lldb-private-interfaces.<wbr>h?rev=279198&r1=279197&r2=<wbr>279198&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/lldb-<wbr>private-interfaces.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-<wbr>private-interfaces.h Thu Aug 18 21:52:07 2016<br>
@@ -35,6 +35,9 @@ namespace lldb_private<br>
     typedef Language *(*LanguageCreateInstance) (lldb::LanguageType language);<br>
     typedef LanguageRuntime *(*<wbr>LanguageRuntimeCreateInstance) (Process *process, lldb::LanguageType language);<br>
     typedef lldb::CommandObjectSP (*<wbr>LanguageRuntimeGetCommandObjec<wbr>t) (CommandInterpreter& interpreter);<br>
+    typedef lldb::StructuredDataPluginSP (*<wbr>StructuredDataPluginCreateInst<wbr>ance)<br>
+        (Process &process);<br>
+    typedef Error (*<wbr>StructuredDataFilterLaunchInfo<wbr>)(ProcessLaunchInfo &launch_info, Target *target);<br>
     typedef SystemRuntime *(*<wbr>SystemRuntimeCreateInstance) (Process *process);<br>
     typedef lldb::PlatformSP (*PlatformCreateInstance) (bool force, const ArchSpec *arch);<br>
     typedef lldb::ProcessSP (*ProcessCreateInstance) (lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path);<br>
<br>
Modified: lldb/trunk/lldb.xcodeproj/<wbr>project.pbxproj<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=279198&r1=279197&r2=279198&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/lldb.<wbr>xcodeproj/project.pbxproj?rev=<wbr>279198&r1=279197&r2=279198&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/lldb.xcodeproj/<wbr>project.pbxproj (original)<br>
+++ lldb/trunk/lldb.xcodeproj/<wbr>project.pbxproj Thu Aug 18 21:52:07 2016<br>
@@ -57,6 +57,8 @@<br>
                23059A0719532B96007B8189 /* LinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0519532B96007B8189 /* LinuxSignals.cpp */; };<br>
                23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */; };<br>
                23059A121958B3B2007B8189 /* SBUnixSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = 23059A111958B37B007B8189 /* SBUnixSignals.h */; settings = {ATTRIBUTES = (Public, ); }; };<br>
+               230EC4591D63C3A7008DF59F /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 230EC4571D63C3A7008DF59F /* CMakeLists.txt */; };<br>
+               230EC45B1D63C3BA008DF59F /* ThreadPlanCallOnFunctionExit.<wbr>cpp in Sources */ = {isa = PBXBuildFile; fileRef = 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.<wbr>cpp */; };<br>
                2326CF441BDD643700A5CEAC /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };<br>
                2326CF491BDD67D800A5CEAC /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF471BDD67C100A5CEAC /* libncurses.dylib */; };<br>
                2326CF4B1BDD681800A5CEAC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4A1BDD681800A5CEAC /* libz.dylib */; };<br>
@@ -72,9 +74,15 @@<br>
                233B007F1960CB280090E598 /* ProcessLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */; };<br>
                236124A41986B4E2004EFC37 /* IOObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A21986B4E2004EFC37 /* IOObject.cpp */; };<br>
                236124A51986B4E2004EFC37 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A31986B4E2004EFC37 /* Socket.cpp */; };<br>
+               2374D7461D4BAA1D005C9575 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2374D7431D4BAA1D005C9575 /* CMakeLists.txt */; };<br>
                2374D7521D4BB299005C9575 /* GDBRemoteClientBase.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2374D74F1D4BB299005C9575 /* GDBRemoteClientBase.h */; };<br>
                2374D7531D4BB2FF005C9575 /* GDBRemoteClientBase.cpp in Sources *</blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-Todd</div></div>
</div>