summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdVar.cpp51
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdVar.h5
-rw-r--r--lldb/tools/lldb-mi/MICmnResources.cpp2
3 files changed, 45 insertions, 13 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCmdVar.cpp b/lldb/tools/lldb-mi/MICmdCmdVar.cpp
index e9568beb173..6fd21d4e906 100644
--- a/lldb/tools/lldb-mi/MICmdCmdVar.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdVar.cpp
@@ -276,6 +276,9 @@ CMICmdCmdVarUpdate::CMICmdCmdVarUpdate(void)
: m_eVarInfoFormat(CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_NoValues)
, m_constStrArgPrintValues("print-values")
, m_constStrArgName("name")
+ , m_constStrArgNoValues("no-values")
+ , m_constStrArgAllValues("all-values")
+ , m_constStrArgSimpleValues("simple-values")
, m_bValueChangedArrayType(false)
, m_bValueChangedCompositeType(false)
, m_bValueChangedNormalType(false)
@@ -312,6 +315,9 @@ bool
CMICmdCmdVarUpdate::ParseArgs(void)
{
bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValNumber(m_constStrArgPrintValues, false, true)));
+ bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValOptionLong(m_constStrArgNoValues, false, true)));
+ bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValOptionLong(m_constStrArgAllValues, false, true)));
+ bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValOptionLong(m_constStrArgSimpleValues, false, true)));
bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
return (bOk && ParseValidateCmdOptions());
}
@@ -330,6 +336,31 @@ CMICmdCmdVarUpdate::Execute(void)
{
CMICMDBASE_GETOPTION(pArgPrintValues, Number, m_constStrArgPrintValues);
CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+ CMICMDBASE_GETOPTION(pArgNoValues, OptionLong, m_constStrArgNoValues);
+ CMICMDBASE_GETOPTION(pArgAllValues, OptionLong, m_constStrArgAllValues);
+ CMICMDBASE_GETOPTION(pArgSimpleValues, OptionLong, m_constStrArgSimpleValues);
+
+ CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e eVarInfoFormat;
+ if (pArgPrintValues->GetFound())
+ {
+ const MIuint nPrintValues = pArgPrintValues->GetValue();
+ if (nPrintValues >= CMICmnLLDBDebugSessionInfo::kNumVariableInfoFormats)
+ {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PRINT_VALUES), m_cmdData.strMiCmd.c_str()));
+ return MIstatus::failure;
+ }
+ eVarInfoFormat = static_cast<CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e>(nPrintValues);
+ }
+ else if (pArgNoValues->GetFound())
+ eVarInfoFormat = CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_NoValues;
+ else if (pArgAllValues->GetFound())
+ eVarInfoFormat = CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_AllValues;
+ else if (pArgSimpleValues->GetFound())
+ eVarInfoFormat = CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_SimpleValues;
+ else
+ // If no print-values, default is "no-values"
+ eVarInfoFormat = CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_NoValues;
+ m_eVarInfoFormat = eVarInfoFormat;
const CMIUtilString &rVarObjName(pArgName->GetValue());
CMICmnLLDBDebugSessionInfoVarObj varObj;
@@ -339,14 +370,6 @@ CMICmdCmdVarUpdate::Execute(void)
return MIstatus::failure;
}
- const MIuint nPrintValues = pArgPrintValues->GetValue();
- if (nPrintValues >= CMICmnLLDBDebugSessionInfo::kNumVariableInfoFormats)
- {
- SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PRINT_VALUES), m_cmdData.strMiCmd.c_str()));
- return MIstatus::failure;
- }
- m_eVarInfoFormat = static_cast<CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e>(nPrintValues);
-
const CMIUtilString &rVarRealName(varObj.GetNameReal());
MIunused(rVarRealName);
lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
@@ -436,7 +459,9 @@ CMICmdCmdVarUpdate::Acknowledge(void)
const CMICmnMIValueConst miValueConst(m_strValueName);
CMICmnMIValueResult miValueResult("name", miValueConst);
CMICmnMIValueTuple miValueTuple(miValueResult);
- if (m_eVarInfoFormat != CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_NoValues)
+ if (m_eVarInfoFormat == CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_AllValues ||
+ (m_eVarInfoFormat == CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_SimpleValues
+ && m_bValueChangedNormalType))
{
const CMICmnMIValueConst miValueConst2(strValue);
CMICmnMIValueResult miValueResult2("value", miValueConst2);
@@ -511,8 +536,12 @@ CMICmdCmdVarUpdate::MIFormResponse(const CMIUtilString &vrStrVarName, const CMIU
CMICmnMIValueResult miValueResult("name", miValueConst);
CMICmnMIValueTuple miValueTuple(miValueResult);
const CMICmnMIValueConst miValueConst2(vrStrValue);
- CMICmnMIValueResult miValueResult2("value", miValueConst2);
- bool bOk = miValueTuple.Add(miValueResult2);
+ bool bOk = true;
+ if(m_eVarInfoFormat == CMICmnLLDBDebugSessionInfo::eVariableInfoFormat_AllValues)
+ {
+ CMICmnMIValueResult miValueResult2("value", miValueConst2);
+ bOk = bOk && miValueTuple.Add(miValueResult2);
+ }
const CMICmnMIValueConst miValueConst3(vrStrScope);
CMICmnMIValueResult miValueResult3("in_scope", miValueConst3);
bOk = bOk && miValueTuple.Add(miValueResult3);
diff --git a/lldb/tools/lldb-mi/MICmdCmdVar.h b/lldb/tools/lldb-mi/MICmdCmdVar.h
index add2058c029..f51ee04bd73 100644
--- a/lldb/tools/lldb-mi/MICmdCmdVar.h
+++ b/lldb/tools/lldb-mi/MICmdCmdVar.h
@@ -131,8 +131,11 @@ class CMICmdCmdVarUpdate : public CMICmdBase
private:
CMIUtilString m_strValueName;
CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e m_eVarInfoFormat;
- const CMIUtilString m_constStrArgPrintValues; // Not handled by *this command
+ const CMIUtilString m_constStrArgPrintValues;
const CMIUtilString m_constStrArgName;
+ const CMIUtilString m_constStrArgNoValues;
+ const CMIUtilString m_constStrArgAllValues;
+ const CMIUtilString m_constStrArgSimpleValues;
bool m_bValueChangedArrayType; // True = yes value changed, false = no change
bool m_bValueChangedCompositeType; // True = yes value changed, false = no change
bool m_bValueChangedNormalType; // True = yes value changed, false = no change
diff --git a/lldb/tools/lldb-mi/MICmnResources.cpp b/lldb/tools/lldb-mi/MICmnResources.cpp
index 84179bb0121..08fe364b669 100644
--- a/lldb/tools/lldb-mi/MICmnResources.cpp
+++ b/lldb/tools/lldb-mi/MICmnResources.cpp
@@ -255,7 +255,7 @@ const CMICmnResources::SRsrcTextData CMICmnResources::ms_pResourceId2TextData[]
{IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK, "Command '%s'. LLDB unable to read entire memory block of %u bytes at address 0x%08x"},
{IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to read memory block of %u bytes at address 0x%08x: %s "},
{IDS_CMD_ERR_INVALID_PROCESS, "Command '%s'. Invalid process during debug session"},
- {IDS_CMD_ERR_INVALID_PRINT_VALUES, "Command '%s'. Unknown value for PRINT_VALUES: must be: 0 or \"--no-values\", 1 or \"all-values\", 2 or \"simple-values\""},
+ {IDS_CMD_ERR_INVALID_PRINT_VALUES, "Command '%s'. Unknown value for PRINT_VALUES: must be: 0 or \"--no-values\", 1 or \"--all-values\", 2 or \"--simple-values\""},
{IDS_CMD_ERR_INVALID_FORMAT_TYPE, "Command '%s'. Invalid var format type '%s'"},
{IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND, "Command '%s'. Breakpoint information for breakpoint ID %d not found"},
{IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to write memory block of %u bytes at address 0x%08x: %s "},
OpenPOWER on IntegriCloud