aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp594
1 files changed, 300 insertions, 294 deletions
diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
index d4d2896..234b4e6 100644
--- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
+++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
@@ -16,16 +16,20 @@
const char *CMICmnLLDBDebugSessionInfoVarObj::ms_aVarFormatStrings[] = {
// CODETAG_SESSIONINFO_VARFORMAT_ENUM
// *** Order is import here.
- "<Invalid var format>", "binary", "octal", "decimal", "hexadecimal", "natural"};
+ "<Invalid var format>", "binary", "octal", "decimal",
+ "hexadecimal", "natural"};
const char *CMICmnLLDBDebugSessionInfoVarObj::ms_aVarFormatChars[] = {
// CODETAG_SESSIONINFO_VARFORMAT_ENUM
// *** Order is import here.
"<Invalid var format>", "t", "o", "d", "x", "N"};
-CMICmnLLDBDebugSessionInfoVarObj::MapKeyToVarObj_t CMICmnLLDBDebugSessionInfoVarObj::ms_mapVarIdToVarObj;
+CMICmnLLDBDebugSessionInfoVarObj::MapKeyToVarObj_t
+ CMICmnLLDBDebugSessionInfoVarObj::ms_mapVarIdToVarObj;
MIuint CMICmnLLDBDebugSessionInfoVarObj::ms_nVarUniqueId = 0; // Index from 0
-CMICmnLLDBDebugSessionInfoVarObj::varFormat_e CMICmnLLDBDebugSessionInfoVarObj::ms_eDefaultFormat = eVarFormat_Natural;
+CMICmnLLDBDebugSessionInfoVarObj::varFormat_e
+ CMICmnLLDBDebugSessionInfoVarObj::ms_eDefaultFormat = eVarFormat_Natural;
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
// Type: Method.
// Args: None.
@@ -33,119 +37,124 @@ CMICmnLLDBDebugSessionInfoVarObj::varFormat_e CMICmnLLDBDebugSessionInfoVarObj::
// Throws: None.
//--
CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj()
- : m_eVarFormat(eVarFormat_Natural)
- , m_eVarType(eVarType_Internal)
-{
- // Do not call UpdateValue() in here as not necessary
+ : m_eVarFormat(eVarFormat_Natural), m_eVarType(eVarType_Internal) {
+ // Do not call UpdateValue() in here as not necessary
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
// Type: Method.
-// Args: vrStrNameReal - (R) The actual name of the variable, the expression.
+// Args: vrStrNameReal - (R) The actual name of the variable, the
+// expression.
// vrStrName - (R) The name given for *this var object.
-// vrValue - (R) The LLDB SBValue object represented by *this object.
+// vrValue - (R) The LLDB SBValue object represented by *this
+// object.
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
- const lldb::SBValue &vrValue)
- : m_eVarFormat(eVarFormat_Natural)
- , m_eVarType(eVarType_Internal)
- , m_strName(vrStrName)
- , m_SBValue(vrValue)
- , m_strNameReal(vrStrNameReal)
-{
- UpdateValue();
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(
+ const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
+ const lldb::SBValue &vrValue)
+ : m_eVarFormat(eVarFormat_Natural), m_eVarType(eVarType_Internal),
+ m_strName(vrStrName), m_SBValue(vrValue), m_strNameReal(vrStrNameReal) {
+ UpdateValue();
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
// Type: Method.
-// Args: vrStrNameReal - (R) The actual name of the variable, the expression.
+// Args: vrStrNameReal - (R) The actual name of the variable, the
+// expression.
// vrStrName - (R) The name given for *this var object.
-// vrValue - (R) The LLDB SBValue object represented by *this object.
-// vrStrVarObjParentName - (R) The var object parent to *this var object (LLDB SBValue equivalent).
+// vrValue - (R) The LLDB SBValue object represented by
+// *this object.
+// vrStrVarObjParentName - (R) The var object parent to *this var
+// object (LLDB SBValue equivalent).
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
- const lldb::SBValue &vrValue, const CMIUtilString &vrStrVarObjParentName)
- : m_eVarFormat(eVarFormat_Natural)
- , m_eVarType(eVarType_Internal)
- , m_strName(vrStrName)
- , m_SBValue(vrValue)
- , m_strNameReal(vrStrNameReal)
- , m_strVarObjParentName(vrStrVarObjParentName)
-{
- UpdateValue();
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(
+ const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
+ const lldb::SBValue &vrValue, const CMIUtilString &vrStrVarObjParentName)
+ : m_eVarFormat(eVarFormat_Natural), m_eVarType(eVarType_Internal),
+ m_strName(vrStrName), m_SBValue(vrValue), m_strNameReal(vrStrNameReal),
+ m_strVarObjParentName(vrStrVarObjParentName) {
+ UpdateValue();
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor.
// Type: Method.
// Args: vrOther - (R) The object to copy from.
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
-{
- CopyOther(vrOther);
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(
+ const CMICmnLLDBDebugSessionInfoVarObj &vrOther) {
+ CopyOther(vrOther);
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor.
// Type: Method.
// Args: vrOther - (R) The object to copy from.
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &vrOther)
-{
- CopyOther(vrOther);
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(
+ CMICmnLLDBDebugSessionInfoVarObj &vrOther) {
+ CopyOther(vrOther);
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj move constructor.
// Type: Method.
// Args: vrwOther - (R) The object to copy from.
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther)
-{
- MoveOther(vrwOther);
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(
+ CMICmnLLDBDebugSessionInfoVarObj &&vrwOther) {
+ MoveOther(vrwOther);
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj assignment operator.
// Type: Method.
// Args: vrOther - (R) The object to copy from.
// Return: CMICmnLLDBDebugSessionInfoVarObj & - Updated *this object.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::operator=(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
-{
- CopyOther(vrOther);
+CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::
+operator=(const CMICmnLLDBDebugSessionInfoVarObj &vrOther) {
+ CopyOther(vrOther);
- return *this;
+ return *this;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj assignment operator.
// Type: Method.
// Args: vrwOther - (R) The object to copy from.
// Return: CMICmnLLDBDebugSessionInfoVarObj & - Updated *this object.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::operator=(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther)
-{
- MoveOther(vrwOther);
+CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::
+operator=(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther) {
+ MoveOther(vrwOther);
- return *this;
+ return *this;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Copy the other instance of that object to *this object.
// Type: Method.
// Args: vrOther - (R) The object to copy from.
@@ -153,25 +162,25 @@ CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::operator=(CM
// MIstatus::failure - Functional failed.
// Throws: None.
//--
-bool
-CMICmnLLDBDebugSessionInfoVarObj::CopyOther(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
-{
- // Check for self-assignment
- if (this == &vrOther)
- return MIstatus::success;
+bool CMICmnLLDBDebugSessionInfoVarObj::CopyOther(
+ const CMICmnLLDBDebugSessionInfoVarObj &vrOther) {
+ // Check for self-assignment
+ if (this == &vrOther)
+ return MIstatus::success;
- m_eVarFormat = vrOther.m_eVarFormat;
- m_eVarType = vrOther.m_eVarType;
- m_strName = vrOther.m_strName;
- m_SBValue = vrOther.m_SBValue;
- m_strNameReal = vrOther.m_strNameReal;
- m_strFormattedValue = vrOther.m_strFormattedValue;
- m_strVarObjParentName = vrOther.m_strVarObjParentName;
+ m_eVarFormat = vrOther.m_eVarFormat;
+ m_eVarType = vrOther.m_eVarType;
+ m_strName = vrOther.m_strName;
+ m_SBValue = vrOther.m_SBValue;
+ m_strNameReal = vrOther.m_strNameReal;
+ m_strFormattedValue = vrOther.m_strFormattedValue;
+ m_strVarObjParentName = vrOther.m_strVarObjParentName;
- return MIstatus::success;
+ return MIstatus::success;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Move that object to *this object.
// Type: Method.
// Args: vrwOther - (RW) The object to copy from.
@@ -179,37 +188,36 @@ CMICmnLLDBDebugSessionInfoVarObj::CopyOther(const CMICmnLLDBDebugSessionInfoVarO
// MIstatus::failure - Functional failed.
// Throws: None.
//--
-bool
-CMICmnLLDBDebugSessionInfoVarObj::MoveOther(CMICmnLLDBDebugSessionInfoVarObj &vrwOther)
-{
- // Check for self-assignment
- if (this == &vrwOther)
- return MIstatus::success;
+bool CMICmnLLDBDebugSessionInfoVarObj::MoveOther(
+ CMICmnLLDBDebugSessionInfoVarObj &vrwOther) {
+ // Check for self-assignment
+ if (this == &vrwOther)
+ return MIstatus::success;
- CopyOther(vrwOther);
- vrwOther.m_eVarFormat = eVarFormat_Natural;
- vrwOther.m_eVarType = eVarType_Internal;
- vrwOther.m_strName.clear();
- vrwOther.m_SBValue.Clear();
- vrwOther.m_strNameReal.clear();
- vrwOther.m_strFormattedValue.clear();
- vrwOther.m_strVarObjParentName.clear();
+ CopyOther(vrwOther);
+ vrwOther.m_eVarFormat = eVarFormat_Natural;
+ vrwOther.m_eVarType = eVarType_Internal;
+ vrwOther.m_strName.clear();
+ vrwOther.m_SBValue.Clear();
+ vrwOther.m_strNameReal.clear();
+ vrwOther.m_strFormattedValue.clear();
+ vrwOther.m_strVarObjParentName.clear();
- return MIstatus::success;
+ return MIstatus::success;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: CMICmnLLDBDebugSessionInfoVarObj destructor.
// Type: Overridden.
// Args: None.
// Return: None.
// Throws: None.
//--
-CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj()
-{
-}
+CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj() {}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the var format enumeration for the specified string.
// Type: Static method.
// Args: vrStrFormat - (R) Text description of the var format.
@@ -218,20 +226,20 @@ CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj()
// Throws: None.
//--
CMICmnLLDBDebugSessionInfoVarObj::varFormat_e
-CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString(const CMIUtilString &vrStrFormat)
-{
- // CODETAG_SESSIONINFO_VARFORMAT_ENUM
- for (MIuint i = 0; i < eVarFormat_count; i++)
- {
- const char *pVarFormatString = ms_aVarFormatStrings[i];
- if (vrStrFormat == pVarFormatString)
- return static_cast<varFormat_e>(i);
- }
+CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString(
+ const CMIUtilString &vrStrFormat) {
+ // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+ for (MIuint i = 0; i < eVarFormat_count; i++) {
+ const char *pVarFormatString = ms_aVarFormatStrings[i];
+ if (vrStrFormat == pVarFormatString)
+ return static_cast<varFormat_e>(i);
+ }
- return eVarFormat_Invalid;
+ return eVarFormat_Invalid;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the var format enumeration for the specified character.
// Type: Static method.
// Args: vcFormat - Character representing the var format.
@@ -240,29 +248,33 @@ CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString(const CMIUtilString &vrS
// Throws: None.
//--
CMICmnLLDBDebugSessionInfoVarObj::varFormat_e
-CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar(char vcFormat)
-{
- if ('r' == vcFormat)
- return eVarFormat_Hex;
-
- // CODETAG_SESSIONINFO_VARFORMAT_ENUM
- for (MIuint i = 0; i < eVarFormat_count; i++)
- {
- const char *pVarFormatChar = ms_aVarFormatChars[i];
- if (*pVarFormatChar == vcFormat)
- return static_cast<varFormat_e>(i);
- }
-
- return eVarFormat_Invalid;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details: Return the equivalent var value formatted string for the given value type,
-// which was prepared for printing (i.e. value was escaped and now it's ready
+CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar(char vcFormat) {
+ if ('r' == vcFormat)
+ return eVarFormat_Hex;
+
+ // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+ for (MIuint i = 0; i < eVarFormat_count; i++) {
+ const char *pVarFormatChar = ms_aVarFormatChars[i];
+ if (*pVarFormatChar == vcFormat)
+ return static_cast<varFormat_e>(i);
+ }
+
+ return eVarFormat_Invalid;
+}
+
+//++
+//------------------------------------------------------------------------------------
+// Details: Return the equivalent var value formatted string for the given value
+// type,
+// which was prepared for printing (i.e. value was escaped and now it's
+// ready
// for wrapping into quotes).
-// The SBValue vrValue parameter is checked by LLDB private code for valid
-// scalar type via MI Driver proxy function as the valued returned can also be
-// an error condition. The proxy function determines if the check was valid
+// The SBValue vrValue parameter is checked by LLDB private code for
+// valid
+// scalar type via MI Driver proxy function as the valued returned can
+// also be
+// an error condition. The proxy function determines if the check was
+// valid
// otherwise return an error condition state by other means saying so.
// Type: Static method.
// Args: vrValue - (R) The var value object.
@@ -270,127 +282,124 @@ CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar(char vcFormat)
// Returns: CMIUtilString - Value formatted string.
// Throws: None.
//--
-CMIUtilString
-CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(const lldb::SBValue &vrValue,
- const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat)
-{
- const CMICmnLLDBUtilSBValue utilValue(vrValue, true);
- if (utilValue.IsIntegerType())
- {
- MIuint64 nValue = 0;
- if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(vrValue, nValue))
- {
- lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
- return GetStringFormatted(nValue, rValue.GetValue(), veVarFormat);
- }
+CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(
+ const lldb::SBValue &vrValue,
+ const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat) {
+ const CMICmnLLDBUtilSBValue utilValue(vrValue, true);
+ if (utilValue.IsIntegerType()) {
+ MIuint64 nValue = 0;
+ if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(vrValue, nValue)) {
+ lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+ return GetStringFormatted(nValue, rValue.GetValue(), veVarFormat);
}
+ }
- return utilValue.GetValue().AddSlashes();
+ return utilValue.GetValue().AddSlashes();
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Return number formatted string according to the given value type.
// Type: Static method.
// Args: vnValue - (R) The number value to get formatted.
-// vpStrValueNatural - (R) The natural representation of the number value.
+// vpStrValueNatural - (R) The natural representation of the number
+// value.
// veVarFormat - (R) Var format enumeration.
// Returns: CMIUtilString - Numerical formatted string.
// Throws: None.
//--
-CMIUtilString
-CMICmnLLDBDebugSessionInfoVarObj::GetStringFormatted(const MIuint64 vnValue, const char *vpStrValueNatural,
- const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat)
-{
- CMIUtilString strFormattedValue;
- CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veFormat = veVarFormat;
- if (ms_eDefaultFormat != eVarFormat_Invalid && veVarFormat == eVarFormat_Natural)
- {
- veFormat = ms_eDefaultFormat;
- }
-
- switch (veFormat)
- {
- case eVarFormat_Binary:
- strFormattedValue = CMIUtilString::FormatBinary(vnValue);
- break;
- case eVarFormat_Octal:
- strFormattedValue = CMIUtilString::Format("0%llo", vnValue);
- break;
- case eVarFormat_Decimal:
- strFormattedValue = CMIUtilString::Format("%lld", vnValue);
- break;
- case eVarFormat_Hex:
- strFormattedValue = CMIUtilString::Format("0x%llx", vnValue);
- break;
- case eVarFormat_Natural:
- default:
- {
- strFormattedValue = (vpStrValueNatural != nullptr) ? vpStrValueNatural : "";
- }
- }
-
- return strFormattedValue;
-}
-
-//++ ------------------------------------------------------------------------------------
+CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetStringFormatted(
+ const MIuint64 vnValue, const char *vpStrValueNatural,
+ const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat) {
+ CMIUtilString strFormattedValue;
+ CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veFormat = veVarFormat;
+ if (ms_eDefaultFormat != eVarFormat_Invalid &&
+ veVarFormat == eVarFormat_Natural) {
+ veFormat = ms_eDefaultFormat;
+ }
+
+ switch (veFormat) {
+ case eVarFormat_Binary:
+ strFormattedValue = CMIUtilString::FormatBinary(vnValue);
+ break;
+ case eVarFormat_Octal:
+ strFormattedValue = CMIUtilString::Format("0%llo", vnValue);
+ break;
+ case eVarFormat_Decimal:
+ strFormattedValue = CMIUtilString::Format("%lld", vnValue);
+ break;
+ case eVarFormat_Hex:
+ strFormattedValue = CMIUtilString::Format("0x%llx", vnValue);
+ break;
+ case eVarFormat_Natural:
+ default: {
+ strFormattedValue = (vpStrValueNatural != nullptr) ? vpStrValueNatural : "";
+ }
+ }
+
+ return strFormattedValue;
+}
+
+//++
+//------------------------------------------------------------------------------------
// Details: Delete internal container contents.
// Type: Static method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjClear()
-{
- ms_mapVarIdToVarObj.clear();
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjClear() {
+ ms_mapVarIdToVarObj.clear();
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Add a var object to the internal container.
// Type: Static method.
// Args: vrVarObj - (R) The var value object.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjAdd(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj)
-{
- VarObjDelete(vrVarObj.GetName());
- MapPairKeyToVarObj_t pr(vrVarObj.GetName(), vrVarObj);
- ms_mapVarIdToVarObj.insert(pr);
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjAdd(
+ const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj) {
+ VarObjDelete(vrVarObj.GetName());
+ MapPairKeyToVarObj_t pr(vrVarObj.GetName(), vrVarObj);
+ ms_mapVarIdToVarObj.insert(pr);
}
-//++ ------------------------------------------------------------------------------------
-// Details: Delete the var object from the internal container matching the specified name.
+//++
+//------------------------------------------------------------------------------------
+// Details: Delete the var object from the internal container matching the
+// specified name.
// Type: Static method.
// Args: vrVarName - (R) The var value name.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjDelete(const CMIUtilString &vrVarName)
-{
- const MapKeyToVarObj_t::const_iterator it = ms_mapVarIdToVarObj.find(vrVarName);
- if (it != ms_mapVarIdToVarObj.end())
- {
- ms_mapVarIdToVarObj.erase(it);
- }
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjDelete(
+ const CMIUtilString &vrVarName) {
+ const MapKeyToVarObj_t::const_iterator it =
+ ms_mapVarIdToVarObj.find(vrVarName);
+ if (it != ms_mapVarIdToVarObj.end()) {
+ ms_mapVarIdToVarObj.erase(it);
+ }
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Update an existing var object in the internal container.
// Type: Static method.
// Args: vrVarObj - (R) The var value object.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj)
-{
- VarObjAdd(vrVarObj);
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(
+ const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj) {
+ VarObjAdd(vrVarObj);
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the var object matching the specified name.
// Type: Static method.
// Args: vrVarName - (R) The var value name.
@@ -398,104 +407,102 @@ CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(const CMICmnLLDBDebugSessionInfoV
// Returns: bool - True = object found, false = object not found.
// Throws: None.
//--
-bool
-CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(const CMIUtilString &vrVarName, CMICmnLLDBDebugSessionInfoVarObj &vrwVarObj)
-{
- const MapKeyToVarObj_t::const_iterator it = ms_mapVarIdToVarObj.find(vrVarName);
- if (it != ms_mapVarIdToVarObj.end())
- {
- const CMICmnLLDBDebugSessionInfoVarObj &rVarObj = (*it).second;
- vrwVarObj = rVarObj;
- return true;
- }
+bool CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(
+ const CMIUtilString &vrVarName,
+ CMICmnLLDBDebugSessionInfoVarObj &vrwVarObj) {
+ const MapKeyToVarObj_t::const_iterator it =
+ ms_mapVarIdToVarObj.find(vrVarName);
+ if (it != ms_mapVarIdToVarObj.end()) {
+ const CMICmnLLDBDebugSessionInfoVarObj &rVarObj = (*it).second;
+ vrwVarObj = rVarObj;
+ return true;
+ }
- return false;
+ return false;
}
-//++ ------------------------------------------------------------------------------------
-// Details: A count is kept of the number of var value objects created. This is count is
+//++
+//------------------------------------------------------------------------------------
+// Details: A count is kept of the number of var value objects created. This is
+// count is
// used to ID the var value object. Reset the count to 0.
// Type: Static method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero()
-{
- ms_nVarUniqueId = 0;
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero() {
+ ms_nVarUniqueId = 0;
}
-//++ ------------------------------------------------------------------------------------
-// Details: Default format is globally used as the data format when "natural" is in effect, that is, this overrides the default
+//++
+//------------------------------------------------------------------------------------
+// Details: Default format is globally used as the data format when "natural" is
+// in effect, that is, this overrides the default
// Type: Static method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat(varFormat_e eDefaultFormat)
-{
- ms_eDefaultFormat = eDefaultFormat;
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat(
+ varFormat_e eDefaultFormat) {
+ ms_eDefaultFormat = eDefaultFormat;
}
-
-//++ ------------------------------------------------------------------------------------
-// Details: A count is kept of the number of var value objects created. This is count is
+//++
+//------------------------------------------------------------------------------------
+// Details: A count is kept of the number of var value objects created. This is
+// count is
// used to ID the var value object. Increment the count by 1.
// Type: Static method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc()
-{
- ms_nVarUniqueId++;
-}
+void CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc() { ms_nVarUniqueId++; }
-//++ ------------------------------------------------------------------------------------
-// Details: A count is kept of the number of var value objects created. This is count is
+//++
+//------------------------------------------------------------------------------------
+// Details: A count is kept of the number of var value objects created. This is
+// count is
// used to ID the var value object. Retrieve ID.
// Type: Static method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-MIuint
-CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet()
-{
- return ms_nVarUniqueId;
+MIuint CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet() {
+ return ms_nVarUniqueId;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the value formatted object's name.
// Type: Method.
// Args: None.
// Returns: CMIUtilString & - Value's var%u name text.
// Throws: None.
//--
-const CMIUtilString &
-CMICmnLLDBDebugSessionInfoVarObj::GetName() const
-{
- return m_strName;
+const CMIUtilString &CMICmnLLDBDebugSessionInfoVarObj::GetName() const {
+ return m_strName;
}
-//++ ------------------------------------------------------------------------------------
-// Details: Retrieve the value formatted object's variable name as given in the MI command
+//++
+//------------------------------------------------------------------------------------
+// Details: Retrieve the value formatted object's variable name as given in the
+// MI command
// to create the var object.
// Type: Method.
// Args: None.
// Returns: CMIUtilString & - Value's real name text.
// Throws: None.
//--
-const CMIUtilString &
-CMICmnLLDBDebugSessionInfoVarObj::GetNameReal() const
-{
- return m_strNameReal;
+const CMIUtilString &CMICmnLLDBDebugSessionInfoVarObj::GetNameReal() const {
+ return m_strNameReal;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the value formatted string.
// Type: Method.
// Args: None.
@@ -503,38 +510,36 @@ CMICmnLLDBDebugSessionInfoVarObj::GetNameReal() const
// Throws: None.
//--
const CMIUtilString &
-CMICmnLLDBDebugSessionInfoVarObj::GetValueFormatted() const
-{
- return m_strFormattedValue;
+CMICmnLLDBDebugSessionInfoVarObj::GetValueFormatted() const {
+ return m_strFormattedValue;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the LLDB Value object.
// Type: Method.
// Args: None.
// Returns: lldb::SBValue & - LLDB Value object.
// Throws: None.
//--
-lldb::SBValue &
-CMICmnLLDBDebugSessionInfoVarObj::GetValue()
-{
- return m_SBValue;
+lldb::SBValue &CMICmnLLDBDebugSessionInfoVarObj::GetValue() {
+ return m_SBValue;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the LLDB Value object.
// Type: Method.
// Args: None.
// Returns: lldb::SBValue & - Constant LLDB Value object.
// Throws: None.
//--
-const lldb::SBValue &
-CMICmnLLDBDebugSessionInfoVarObj::GetValue() const
-{
- return m_SBValue;
+const lldb::SBValue &CMICmnLLDBDebugSessionInfoVarObj::GetValue() const {
+ return m_SBValue;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Set the var format type for *this object and update the formatting.
// Type: Method.
// Args: None.
@@ -542,37 +547,37 @@ CMICmnLLDBDebugSessionInfoVarObj::GetValue() const
// MIstatus::failure - Functional failed.
// Throws: None.
//--
-bool
-CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat(const varFormat_e veVarFormat)
-{
- if (veVarFormat >= eVarFormat_count)
- return MIstatus::failure;
+bool CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat(
+ const varFormat_e veVarFormat) {
+ if (veVarFormat >= eVarFormat_count)
+ return MIstatus::failure;
- m_eVarFormat = veVarFormat;
- UpdateValue();
- return MIstatus::success;
+ m_eVarFormat = veVarFormat;
+ UpdateValue();
+ return MIstatus::success;
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Update *this var obj. Update it's value and type.
// Type: Method.
// Args: None.
// Returns: None.
// Throws: None.
//--
-void
-CMICmnLLDBDebugSessionInfoVarObj::UpdateValue()
-{
- m_strFormattedValue = GetValueStringFormatted(m_SBValue, m_eVarFormat);
+void CMICmnLLDBDebugSessionInfoVarObj::UpdateValue() {
+ m_strFormattedValue = GetValueStringFormatted(m_SBValue, m_eVarFormat);
- MIuint64 nValue = 0;
- if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(m_SBValue, nValue) == MIstatus::failure)
- m_eVarType = eVarType_Composite;
+ MIuint64 nValue = 0;
+ if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(m_SBValue, nValue) ==
+ MIstatus::failure)
+ m_eVarType = eVarType_Composite;
- CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(*this);
+ CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(*this);
}
-//++ ------------------------------------------------------------------------------------
+//++
+//------------------------------------------------------------------------------------
// Details: Retrieve the enumeration type of the var object.
// Type: Method.
// Args: None.
@@ -580,14 +585,16 @@ CMICmnLLDBDebugSessionInfoVarObj::UpdateValue()
// Throws: None.
//--
CMICmnLLDBDebugSessionInfoVarObj::varType_e
-CMICmnLLDBDebugSessionInfoVarObj::GetType() const
-{
- return m_eVarType;
+CMICmnLLDBDebugSessionInfoVarObj::GetType() const {
+ return m_eVarType;
}
-//++ ------------------------------------------------------------------------------------
-// Details: Retrieve the parent var object's name, the parent var object to *this var
-// object (if assigned). The parent is equivalent to LLDB SBValue variable's
+//++
+//------------------------------------------------------------------------------------
+// Details: Retrieve the parent var object's name, the parent var object to
+// *this var
+// object (if assigned). The parent is equivalent to LLDB SBValue
+// variable's
// parent.
// Type: Method.
// Args: None.
@@ -595,7 +602,6 @@ CMICmnLLDBDebugSessionInfoVarObj::GetType() const
// Throws: None.
//--
const CMIUtilString &
-CMICmnLLDBDebugSessionInfoVarObj::GetVarParentName() const
-{
- return m_strVarObjParentName;
+CMICmnLLDBDebugSessionInfoVarObj::GetVarParentName() const {
+ return m_strVarObjParentName;
}