Author: abidh Date: Fri Sep 4 06:26:53 2015 New Revision: 246847 URL: http://llvm.org/viewvc/llvm-project?rev=246847&view=rev Log: Fix multiple problems in -break-condition command.
1. To handle the expression with spaces, this command uses 2 arguments. For a case like -break-condition 1 i == 5, the first will pick the 'i' and second will pick the '== 5'. But the second argument was made mandatory which failed in cases when there was no space in the expression like i==5. 2. The function GetRestOfExpressionNotSurroundedInQuotes has 2 locals with the same names. It resulted in one hiding the other and this function always returned empty string. No regression on Linux. Committed as obvious. Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp?rev=246847&r1=246846&r2=246847&view=diff ============================================================================== --- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Fri Sep 4 06:26:53 2015 @@ -937,7 +937,7 @@ CMICmdCmdBreakCondition::ParseArgs() *(new CMICmdArgValOptionLong(m_constStrArgNamedThreadGrp, false, false, CMICmdArgValListBase::eArgValType_ThreadGrp, 1))); m_setCmdArgs.Add(*(new CMICmdArgValNumber(m_constStrArgNamedNumber, true, true))); m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgNamedExpr, true, true, true, true))); - m_setCmdArgs.Add(*(new CMICmdArgValListOfN(m_constStrArgNamedExprNoQuotes, true, false, + m_setCmdArgs.Add(*(new CMICmdArgValListOfN(m_constStrArgNamedExprNoQuotes, false, false, CMICmdArgValListBase::eArgValType_StringQuotedNumber))); return ParseValidateCmdOptions(); } @@ -1042,7 +1042,6 @@ CMICmdCmdBreakCondition::GetRestOfExpres CMICmdArgValListOfN *pArgExprNoQuotes = CMICmdBase::GetOption<CMICmdArgValListOfN>(m_constStrArgNamedExprNoQuotes); if (pArgExprNoQuotes != nullptr) { - CMIUtilString strExpression; const CMICmdArgValListBase::VecArgObjPtr_t &rVecExprParts(pArgExprNoQuotes->GetExpectedOptions()); if (!rVecExprParts.empty()) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits