================
@@ -46,8 +48,79 @@ SaveCoreOptions::GetOutputFile() const {
return m_file;
}
+Status SaveCoreOptions::SetProcess(lldb::ProcessSP process_sp) {
+ Status error;
+ if (!process_sp) {
+ ClearProcessSpecificData();
+ m_process_sp = std::nullopt;
+ return error;
+ }
+
+ if (!process_sp->IsValid()) {
+ error.SetErrorString("Cannot assign an invalid process.");
+ return error;
+ }
+
+ if (m_process_sp.has_value())
----------------
clayborg wrote:
m_process_sp should not be optional as the shared pointer being NULL is enough.
This code now becomes:
```
if (m_process_sp)
```
https://github.com/llvm/llvm-project/pull/100443
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits