[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 19 18:19:20 PDT 2018


aprantl added a comment.

Ok, then let's continue this way.



================
Comment at: tools/lldb-mi/MICmdBase.h:89
+                      [] { return MIstatus::failure; },
+                      const lldb::SBError error = lldb::SBError());
   template <class T> T *GetOption(const CMIUtilString &vStrOptionName);
----------------
If you move the error argument to the front, you can use the default error handler in the function below. In fact, I'm not even sure what it would mean to call this function without an error. I guess the error argument should probably not have a default value at all.


================
Comment at: tools/lldb-mi/MICmdCmdExec.cpp:242
       const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
-      SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
-                                     m_cmdData.strMiCmd.c_str(),
-                                     rErrMsg.c_str()));
+      this->SetError(CMIUtilString::Format(
+          MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
----------------
If you add a second variant (or a wrapper) that takes a bool instead of an SBError, you could use that one here, since it's basically the same pattern, just not with an SBError.


https://reviews.llvm.org/D48295





More information about the lldb-commits mailing list