jingham added a comment.

I'm a little sad that we don't yet have a way to read the current value of a 
setting into an SBStructuredData, so we do this piecemeal instead.  But that's 
a bigger project, so if you need this now, it doesn't seem fair to block you on 
that.  We should really name the output SBStructuredData keys more 
instructively, however.



================
Comment at: lldb/include/lldb/API/SBTarget.h:91
+  /// \return
+  ///     A SBStructuredData with the source map entries collected.
+  lldb::SBStructuredData GetSourceMap();
----------------
You have to say what the structure is so people will know how to fetch the 
elements.


================
Comment at: lldb/source/API/SBTarget.cpp:222
+
+  std::string json_str =
+      llvm::formatv("{0:2}",
----------------
It seems a little round-about to convert the source map to JSON, then from JSON 
to an SBStructuredData.  You should be able to write the elements directly.  
I'm not sure how much that matters, however.


================
Comment at: lldb/source/Target/PathMappingList.cpp:138
+    llvm::json::Object entry;
+    entry.try_emplace("first", pair.first.GetStringRef().str());
+    entry.try_emplace("second", pair.second.GetStringRef().str());
----------------
Can we call these something more instructive than "first" and "second"?  These 
are the "original" path and the "substitution" path, maybe those would be good 
keys?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133038/new/

https://reviews.llvm.org/D133038

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to