[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Jun 23 03:36:04 PDT 2018


apolyakov added inline comments.


================
Comment at: tools/lldb-mi/MICmdCmdExec.cpp:137
+  auto successHandler = [this] {
+    // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
+    if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) {
----------------
aprantl wrote:
> Is this a copy&paste error?
It is, thanks.


================
Comment at: tools/lldb-mi/MICmdCmdExec.cpp:142
+          MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
+          this->m_cmdData.strMiCmd.c_str(),
+          rErrMsg.c_str()));
----------------
aprantl wrote:
> Might want to factor this out into a HandleBoolReturnValue helper if it appears more than once.
The good solution is to add anonymous namespace with a function `bool HandleDriverStateChanging(bool status, CMICmdBase *cmd)`, but it's impossible since `SetError` and `m_cmdData` are protected members of `CMICmdBase`.

Another way is to add this function to CMICmdBase, but again there are only 3 commands that use that code. It seems unreasonable to do it for all commands.


https://reviews.llvm.org/D47992





More information about the lldb-commits mailing list