[Lldb-commits] [lldb] [lldb] Add/change options in `statistics dump` to control what sections are dumped (PR #95075)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 17 18:00:11 PDT 2024


================
@@ -29,6 +29,9 @@ struct OptionArgParser {
 
   static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
 
+  static bool ToBoolean(llvm::StringRef option_name, llvm::StringRef option_arg,
+                        bool fail_value, Status &error);
+
----------------
clayborg wrote:

If we are going to add a function here I would suggest we add it with `llvm::Expected`:
```
llvm::Expected<bool> ToBoolean(llvm::StringRef option_arg);
```
This will return a `bool` or a `llvm::Error`. `lldb_private::Status` has a constructor that takes an `llvm::Error`. I will show how to use this in the new code below.

https://github.com/llvm/llvm-project/pull/95075


More information about the lldb-commits mailing list