[Lldb-commits] [PATCH] D47838: [lldb-mi] Re-implement MI -exec-step command.

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 11 09:26:28 PDT 2018


polyakov.alex added inline comments.


================
Comment at: lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp:524
 bool CMICmdCmdExecStep::Acknowledge() {
-  if (m_lldbResult.GetErrorSize() > 0) {
-    const char *pLldbErr = m_lldbResult.GetError();
-    MIunused(pLldbErr);
-    const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
-    const CMICmnMIValueResult miValueResult("message", miValueConst);
-    const CMICmnMIResultRecord miRecordResult(
-        m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
-        miValueResult);
-    m_miResultRecord = miRecordResult;
-  } else {
-    const CMICmnMIResultRecord miRecordResult(
-        m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
-    m_miResultRecord = miRecordResult;
-  }
-
+  m_miResultRecord = CMICmnMIResultRecord(
+      m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
----------------
clayborg wrote:
> How does this code handle the error case for stepping now?
If there is an error in lldb-mi command execution, it'll be detected in `Execute` function:
```
if (error.Success())
  return MIstatus::sucess;

SetError(error.GetCString());
return MIstatus::failure
```

If `Execute` function returns `MIstatus::failure`, then `Acknowledge` function won't be called.


Repository:
  rL LLVM

https://reviews.llvm.org/D47838





More information about the lldb-commits mailing list