[PATCH] D116113: Add LLDB synthetic child and summary scripts for llvm::SmallVector, llvm::Optional, llvm::ErrorOr and llvm::Expected.

Pavel Labath via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 22 04:04:20 PST 2021


labath added a comment.

Seems fairly straight-forward (and definitely useful). Just a couple of quick comments.



================
Comment at: clang/utils/ClangDataFormat.py:28-35
+    debugger.HandleCommand("type summary add -F ClangDataFormat.Optional_summary -x 'llvm::Optional<.*>'")
+    debugger.HandleCommand("type summary add -F ClangDataFormat.SmallVector_summary -x 'llvm::SmallVector<.*>'")
+    debugger.HandleCommand("type summary add -F ClangDataFormat.Expected_summary -x 'llvm::Expected<.*>'")
+    debugger.HandleCommand("type summary add -F ClangDataFormat.ErrorOr_summary -x 'llvm::ErrorOr<.*>'")
+    debugger.HandleCommand("type synthetic add -l ClangDataFormat.Optional -x 'llvm::Optional<.*>'")
+    debugger.HandleCommand("type synthetic add -l ClangDataFormat.SmallVector -x 'llvm::SmallVector<.*>'")
+    debugger.HandleCommand("type synthetic add -l ClangDataFormat.Expected -x 'llvm::Expected<.*>'")
----------------
I believe it's necessary to anchor these regexes to avoid them matching things like `std::vector<llvm::Optional<T>>`


================
Comment at: clang/utils/ClangDataFormat.py:371-373
+        self.error_type = target.FindFirstType('std::__1::error_code')
+        if not self.error_type.IsValid():
+            self.error_type = target.FindFirstType('std::error_code').GetPointerType()
----------------
maybe access as `valobj.GetChildMemberWithName('ErrorStorage').GetType().GetTemplateArgumentType(0)` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116113



More information about the cfe-commits mailing list