Weird, you linked to a phabricator revision but i never saw it come across to the mailing list<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">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-project?rev=279198&view=rev</a><br>
Log:<br>
Add StructuredData plugin type; showcase with new DarwinLog feature<br>
<br>
See docs/structured_data/StructuredDataPlugins.md for details.<br>
<br>
differential review: <a href="https://reviews.llvm.org/D22976" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22976</a><br>
<br>
reviewers: clayborg, jingham<br>
<br>
Added:<br>
lldb/trunk/docs/structured_data/<br>
lldb/trunk/docs/structured_data/DarwinLog.md<br>
lldb/trunk/docs/structured_data/StructuredDataPlugins.md<br>
lldb/trunk/include/lldb/API/SBStructuredData.h<br>
lldb/trunk/include/lldb/Target/StructuredDataPlugin.h<br>
lldb/trunk/include/lldb/Target/ThreadPlanCallOnFunctionExit.h<br>
lldb/trunk/packages/Python/lldbsuite/test/darwin_log.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/TestDarwinLogBasic.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/basic/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/common/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/common/darwin_log_common.h<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/message/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/message/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/message/TestDarwinLogFilterRegexMessage.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/message/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/format/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/format/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/format/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/main.c<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/Makefile<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/main.c<br>
lldb/trunk/scripts/interface/SBStructuredData.i<br>
lldb/trunk/source/API/SBStructuredData.cpp<br>
lldb/trunk/source/Plugins/StructuredData/<br>
lldb/trunk/source/Plugins/StructuredData/CMakeLists.txt<br>
lldb/trunk/source/Plugins/StructuredData/DarwinLog/<br>
lldb/trunk/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt<br>
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp<br>
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h<br>
lldb/trunk/source/Target/StructuredDataPlugin.cpp<br>
lldb/trunk/source/Target/ThreadPlanCallOnFunctionExit.cpp<br>
lldb/trunk/tools/debugserver/source/JSON.cpp<br>
lldb/trunk/tools/debugserver/source/JSON.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStore.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStore.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStreamSPI.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/CMakeLists.txt<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogEvent.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogInterfaces.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogTypes.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilter.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilter.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterChain.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterChain.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterExactMatch.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterExactMatch.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessage.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessage.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp<br>
lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.h<br>
Modified:<br>
lldb/trunk/.gitignore<br>
lldb/trunk/cmake/LLDBDependencies.cmake<br>
lldb/trunk/include/lldb/API/LLDB.h<br>
lldb/trunk/include/lldb/API/SBDefines.h<br>
lldb/trunk/include/lldb/API/SBError.h<br>
lldb/trunk/include/lldb/API/SBProcess.h<br>
lldb/trunk/include/lldb/API/SBStream.h<br>
lldb/trunk/include/lldb/Core/Broadcaster.h<br>
lldb/trunk/include/lldb/Core/Event.h<br>
lldb/trunk/include/lldb/Core/PluginManager.h<br>
lldb/trunk/include/lldb/Interpreter/Args.h<br>
lldb/trunk/include/lldb/Target/Process.h<br>
lldb/trunk/include/lldb/lldb-forward.h<br>
lldb/trunk/include/lldb/lldb-private-interfaces.h<br>
lldb/trunk/lldb.xcodeproj/project.pbxproj<br>
lldb/trunk/scripts/interface/SBProcess.i<br>
lldb/trunk/scripts/interface/SBTarget.i<br>
lldb/trunk/scripts/lldb.swig<br>
lldb/trunk/source/API/CMakeLists.txt<br>
lldb/trunk/source/API/SBDebugger.cpp<br>
lldb/trunk/source/API/SBProcess.cpp<br>
lldb/trunk/source/API/SystemInitializerFull.cpp<br>
lldb/trunk/source/Core/Debugger.cpp<br>
lldb/trunk/source/Core/Event.cpp<br>
lldb/trunk/source/Core/PluginManager.cpp<br>
lldb/trunk/source/Interpreter/Args.cpp<br>
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp<br>
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h<br>
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h<br>
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp<br>
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h<br>
lldb/trunk/source/Target/CMakeLists.txt<br>
lldb/trunk/source/Target/Platform.cpp<br>
lldb/trunk/source/Target/Process.cpp<br>
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj<br>
lldb/trunk/tools/debugserver/source/CMakeLists.txt<br>
lldb/trunk/tools/debugserver/source/DNB.cpp<br>
lldb/trunk/tools/debugserver/source/DNB.h<br>
lldb/trunk/tools/debugserver/source/DNBDefs.h<br>
lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt<br>
lldb/trunk/tools/debugserver/source/RNBContext.cpp<br>
lldb/trunk/tools/debugserver/source/RNBContext.h<br>
lldb/trunk/tools/debugserver/source/RNBRemote.cpp<br>
lldb/trunk/tools/debugserver/source/RNBRemote.h<br>
lldb/trunk/tools/debugserver/source/debugserver.cpp<br>
lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp<br>
lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.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-project/lldb/trunk/.gitignore?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<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/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-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)<br>
+++ lldb/trunk/cmake/LLDBDependencies.cmake Thu Aug 18 21:52:07 2016<br>
@@ -47,6 +47,7 @@ set( LLDB_USED_LIBS<br>
lldbPluginObjectContainerMachOArchive<br>
lldbPluginObjectContainerBSDArchive<br>
lldbPluginPlatformMacOSX<br>
+ lldbPluginStructuredDataDarwinLog<br>
lldbPluginDynamicLoaderMacOSXDYLD<br>
lldbPluginUnwindAssemblyInstEmulation<br>
lldbPluginUnwindAssemblyX86<br>
<br>
Added: lldb/trunk/docs/structured_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-project/lldb/trunk/docs/structured_data/DarwinLog.md?rev=279198&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/docs/structured_data/DarwinLog.md (added)<br>
+++ lldb/trunk/docs/structured_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-log.enable-on-startup'<br>
+<br>
+ and<br>
+<br>
+ 'settings set \<br>
+ plugin.structured-data.darwin-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-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.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_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-project/lldb/trunk/docs/structured_data/StructuredDataPlugins.md?rev=279198&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/docs/structured_data/StructuredDataPlugins.md (added)<br>
+++ lldb/trunk/docs/structured_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>
+ MapSupportedStructuredDataPlugins(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.{plugin-name}.<br>
<br>
Modified: lldb/trunk/include/lldb/API/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-project/lldb/trunk/include/lldb/API/LLDB.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/LLDB.h (original)<br>
+++ lldb/trunk/include/lldb/API/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.h"<br>
<br>
Modified: lldb/trunk/include/lldb/API/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-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/SBDefines.h (original)<br>
+++ lldb/trunk/include/lldb/API/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/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-project/lldb/trunk/include/lldb/API/SBError.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/SBError.h (original)<br>
+++ lldb/trunk/include/lldb/API/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/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-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/SBProcess.h (original)<br>
+++ lldb/trunk/include/lldb/API/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/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-project/lldb/trunk/include/lldb/API/SBStream.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/SBStream.h (original)<br>
+++ lldb/trunk/include/lldb/API/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/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-project/lldb/trunk/include/lldb/API/SBStructuredData.h?rev=279198&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/API/SBStructuredData.h (added)<br>
+++ lldb/trunk/include/lldb/API/SBStructuredData.h Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,52 @@<br>
+//===-- SBStructuredData.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>
+//===----------------------------------------------------------------------===//<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/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-project/lldb/trunk/include/lldb/Core/Broadcaster.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/Broadcaster.h (original)<br>
+++ lldb/trunk/include/lldb/Core/Broadcaster.h Thu Aug 18 21:52:07 2016<br>
@@ -272,11 +272,10 @@ private:<br>
/// //----------------------------------------------------------<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>
//----------------------------------------------------------------------<br>
<br>
Modified: lldb/trunk/include/lldb/Core/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-project/lldb/trunk/include/lldb/Core/Event.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/Event.h (original)<br>
+++ lldb/trunk/include/lldb/Core/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>
//----------------------------------------------------------------------<br>
+/// This class handles one or more StructuredData::Dictionary entries<br>
+/// that are raised for structured data events.<br>
+//----------------------------------------------------------------------<br>
+<br>
+class EventDataStructuredData : public EventData<br>
+{<br>
+public:<br>
+<br>
+ //------------------------------------------------------------------<br>
+ // Constructors<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ // Member functions<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ // Static functions<br>
+ //------------------------------------------------------------------<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(EventDataStructuredData);<br>
+};<br>
+<br>
+//----------------------------------------------------------------------<br>
// lldb::Event<br>
//----------------------------------------------------------------------<br>
class Event<br>
<br>
Modified: lldb/trunk/include/lldb/Core/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-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)<br>
+++ lldb/trunk/include/lldb/Core/PluginManager.h Thu Aug 18 21:52:07 2016<br>
@@ -328,6 +328,65 @@ public:<br>
CommandInterpreter &interpreter);<br>
<br>
//------------------------------------------------------------------<br>
+ // StructuredDataPlugin<br>
+ //------------------------------------------------------------------<br>
+<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ static bool<br>
+ RegisterPlugin(const ConstString &name,<br>
+ const char *description,<br>
+ StructuredDataPluginCreateInstance create_callback,<br>
+ DebuggerInitializeCallback debugger_init_callback = nullptr,<br>
+ StructuredDataFilterLaunchInfo filter_callback<br>
+ = nullptr);<br>
+<br>
+ static bool<br>
+ UnregisterPlugin(StructuredDataPluginCreateInstance create_callback);<br>
+<br>
+ static StructuredDataPluginCreateInstance<br>
+ GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx);<br>
+<br>
+ static StructuredDataPluginCreateInstance<br>
+ GetStructuredDataPluginCreateCallbackForPluginName(const ConstString &name);<br>
+<br>
+ static StructuredDataFilterLaunchInfo<br>
+ GetStructuredDataFilterCallbackAtIndex(uint32_t idx,<br>
+ bool &iteration_complete);<br>
+<br>
+ //------------------------------------------------------------------<br>
// SymbolFile<br>
//------------------------------------------------------------------<br>
static bool<br>
@@ -531,6 +590,16 @@ public:<br>
static bool CreateSettingForOperatingSystemPlugin(Debugger &debugger,<br>
const lldb::OptionValuePropertiesSP &properties_sp,<br>
const ConstString &description, bool is_global_property);<br>
+<br>
+ static lldb::OptionValuePropertiesSP<br>
+ GetSettingForStructuredDataPlugin(Debugger &debugger,<br>
+ const ConstString &setting_name);<br>
+<br>
+ static bool<br>
+ CreateSettingForStructuredDataPlugin(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/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-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Interpreter/Args.h (original)<br>
+++ lldb/trunk/include/lldb/Interpreter/Args.h Thu Aug 18 21:52:07 2016<br>
@@ -451,6 +451,17 @@ public:<br>
LongestCommonPrefix (std::string &common_prefix);<br>
<br>
//------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ void<br>
+ AddOrReplaceEnvironmentVariable(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>
//------------------------------------------------------------------<br>
bool<br>
- ContainsEnvironmentVariable(const char *env_var_name) const;<br>
+ ContainsEnvironmentVariable(const char *env_var_name,<br>
+ size_t *argument_index = nullptr) const;<br>
<br>
protected:<br>
//------------------------------------------------------------------<br>
<br>
Modified: lldb/trunk/include/lldb/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-project/lldb/trunk/include/lldb/Target/Process.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/Process.h (original)<br>
+++ lldb/trunk/include/lldb/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>
AdvanceAddressToNextBranchInstruction (Address default_stop_addr,<br>
AddressRange range_bounds);<br>
<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ virtual Error<br>
+ ConfigureStructuredData(const ConstString &type_name,<br>
+ const StructuredData::ObjectSP &config_sp);<br>
+<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ void<br>
+ BroadcastStructuredData(const StructuredData::ObjectSP &object_sp,<br>
+ const lldb::StructuredDataPluginSP &plugin_sp);<br>
+<br>
+ //------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<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>
//------------------------------------------------------------------<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>
+ //------------------------------------------------------------------<br>
+ void<br>
+ MapSupportedStructuredDataPlugins(const StructuredData::Array<br>
+ &supported_type_names);<br>
+<br>
+ //------------------------------------------------------------------<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>
+ /// HandleArrivalOfStructuredData(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>
+ //------------------------------------------------------------------<br>
+ bool<br>
+ RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp);<br>
+<br>
+ //------------------------------------------------------------------<br>
// Type definitions<br>
//------------------------------------------------------------------<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>;<br>
<br>
//------------------------------------------------------------------<br>
// Member variables<br>
@@ -3477,7 +3597,9 @@ protected:<br>
bool m_can_interpret_function_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(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/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-project/lldb/trunk/include/lldb/Target/StructuredDataPlugin.h?rev=279198&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/StructuredDataPlugin.h (added)<br>
+++ lldb/trunk/include/lldb/Target/StructuredDataPlugin.h Thu Aug 18 21:52:07 2016<br>
@@ -0,0 +1,204 @@<br>
+//===-- StructuredDataPlugin.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>
+//===----------------------------------------------------------------------===//<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>
+// -----------------------------------------------------------------------------<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>
+// -----------------------------------------------------------------------------<br>
+<br>
+class StructuredDataPlugin :<br>
+ public PluginInterface,<br>
+ public std::enable_shared_from_this<StructuredDataPlugin><br>
+{<br>
+public:<br>
+<br>
+ virtual ~StructuredDataPlugin();<br>
+<br>
+ lldb::ProcessSP<br>
+ GetProcess() const;<br>
+<br>
+ // -------------------------------------------------------------------------<br>
+ // Public instance API<br>
+ // -------------------------------------------------------------------------<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ virtual bool<br>
+ SupportsStructuredDataType(const ConstString &type_name) = 0;<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ virtual void<br>
+ HandleArrivalOfStructuredData(Process &process,<br>
+ const ConstString &type_name,<br>
+ const StructuredData::ObjectSP<br>
+ &object_sp) = 0;<br>
+<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ virtual Error<br>
+ GetDescription(const StructuredData::ObjectSP &object_sp,<br>
+ lldb_private::Stream &stream) = 0;<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ virtual bool<br>
+ GetEnabled(const ConstString &type_name) const;<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ virtual void<br>
+ ModulesDidLoad(Process &process, ModuleList &module_list);<br>
+<br>
+protected:<br>
+<br>
+ // -------------------------------------------------------------------------<br>
+ // Derived-class API<br>
+ // -------------------------------------------------------------------------<br>
+ StructuredDataPlugin(const lldb::ProcessWP &process_wp);<br>
+<br>
+ // -------------------------------------------------------------------------<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>
+ // -------------------------------------------------------------------------<br>
+ static void<br>
+ InitializeBasePluginForDebugger(Debugger &debugger);<br>
+<br>
+private:<br>
+<br>
+ lldb::ProcessWP m_process_wp;<br>
+<br>
+ DISALLOW_COPY_AND_ASSIGN(StructuredDataPlugin);<br>
+<br>
+};<br>
+<br>
+}<br>
+<br>
+#endif<br>
<br>
Added: lldb/trunk/include/lldb/Target/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-project/lldb/trunk/include/lldb/Target/ThreadPlanCallOnFunctionExit.h?rev=279198&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/ThreadPlanCallOnFunctionExit.h (added)<br>
+++ lldb/trunk/include/lldb/Target/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>
+//===----------------------------------------------------------------------===//<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>
+// =============================================================================<br>
+/// This thread plan calls a function object when the current function exits.<br>
+// =============================================================================<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(Thread &thread, const Callback &callback);<br>
+<br>
+ void<br>
+ DidPush() override;<br>
+<br>
+ // -------------------------------------------------------------------------<br>
+ // ThreadPlan API<br>
+ // -------------------------------------------------------------------------<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-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-project/lldb/trunk/include/lldb/lldb-forward.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/lldb-forward.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-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::DynamicLoader> DynamicLoaderUP;<br>
typedef std::shared_ptr<lldb_private::Event> EventSP;<br>
typedef std::shared_ptr<lldb_private::EventData> EventDataSP;<br>
+ typedef std::shared_ptr<lldb_private::EventDataStructuredData> EventDataStructuredDataSP;<br>
typedef std::shared_ptr<lldb_private::ExecutionContextRef> ExecutionContextRefSP;<br>
typedef std::shared_ptr<lldb_private::ExpressionVariable> ExpressionVariableSP;<br>
typedef std::shared_ptr<lldb_private::File> FileSP;<br>
@@ -415,6 +418,10 @@ namespace lldb {<br>
typedef std::weak_ptr<lldb_private::Stream> StreamWP;<br>
typedef std::shared_ptr<lldb_private::StreamFile> StreamFileSP;<br>
typedef std::shared_ptr<lldb_private::StringSummaryFormat> StringTypeSummaryImplSP;<br>
+ typedef std::shared_ptr<lldb_private::StructuredDataPlugin><br>
+ StructuredDataPluginSP;<br>
+ typedef std::weak_ptr<lldb_private::StructuredDataPlugin><br>
+ StructuredDataPluginWP;<br>
typedef std::shared_ptr<lldb_private::SymbolFile> SymbolFileSP;<br>
typedef std::shared_ptr<lldb_private::SymbolFileType> SymbolFileTypeSP;<br>
typedef std::weak_ptr<lldb_private::SymbolFileType> SymbolFileTypeWP;<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-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-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/lldb-private-interfaces.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-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 *(*LanguageRuntimeCreateInstance) (Process *process, lldb::LanguageType language);<br>
typedef lldb::CommandObjectSP (*LanguageRuntimeGetCommandObject) (CommandInterpreter& interpreter);<br>
+ typedef lldb::StructuredDataPluginSP (*StructuredDataPluginCreateInstance)<br>
+ (Process &process);<br>
+ typedef Error (*StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info, Target *target);<br>
typedef SystemRuntime *(*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/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-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=279198&r1=279197&r2=279198&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)<br>
+++ lldb/trunk/lldb.xcodeproj/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.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.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>