[Lldb-commits] [PATCH] D29581: Initial implementation of SB APIs for Tracing support.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 7 08:49:46 PST 2017

clayborg added inline comments.

Comment at: include/lldb/API/SBTraceOptions.h:38
+  /// They should be formatted as a JSON Array.
+  void setTraceParams(lldb::SBStream &params);
ravitheja wrote:
> clayborg wrote:
> > This should probably be:
> > 
> > ```
> > void setTraceParams(lldb::SBStructuredData &params);
> > ```
> > 
> > Then we can add extra functions to SBStructuredData that allow you construct one from XML, JSON, Apple plist, or any other structured data.
> Hi, this would also mean we make SBTraceOptions a friend class of SBStructuredData so that we can get access to the StructuredDataObject inside ?
Yeah you need a way for internal clients to get the StructuredData::ObjectSP from the SBStructuredData. You probably need to allow access to the StructuredDataImpl class that is currently defined in SBStructuredData.cpp. So a few things need to happen:

- move StructuredDataImpl somewhere into its own internal header file so that other clients in LLDB can access it
- make a protected member function in SBStructuredData that hands out a "StructuredDataImpl *" to allow clients to access it
- anyone that needs to get to the StructuredData::ObjectSP will then call a new accessor that must be added on StructuredDataImpl to retrieve it
- add new ways to load the SBStructuredData from JSON (something like SBStructuredData::SetFromJSON(...))


More information about the lldb-commits mailing list