[Lldb-commits] [lldb] r222150 - Reformat lldb-mi using clang-format.

Zachary Turner zturner at google.com
Mon Nov 17 10:06:24 PST 2014


Modified: lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp Mon Nov 17 12:06:21 2014
@@ -8,23 +8,23 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdCmdVar.cpp
+// File:        MICmdCmdVar.cpp
 //
-// Overview:	CMICmdCmdVarCreate					implementation.
-//				CMICmdCmdVarUpdate					implementation.
-//				CMICmdCmdVarDelete					implementation.
-//				CMICmdCmdVarAssign					implementation.
-//				CMICmdCmdVarSetFormat				implementation.
-//				CMICmdCmdVarListChildren			implementation.
-//				CMICmdCmdVarEvaluateExpression		implementation.
-//				CMICmdCmdVarInfoPathExpression		implementation.
-//				CMICmdCmdVarShowAttributes			implementation.
+// Overview:    CMICmdCmdVarCreate                  implementation.
+//              CMICmdCmdVarUpdate                  implementation.
+//              CMICmdCmdVarDelete                  implementation.
+//              CMICmdCmdVarAssign                  implementation.
+//              CMICmdCmdVarSetFormat               implementation.
+//              CMICmdCmdVarListChildren            implementation.
+//              CMICmdCmdVarEvaluateExpression      implementation.
+//              CMICmdCmdVarInfoPathExpression      implementation.
+//              CMICmdCmdVarShowAttributes          implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third Party Headers:
@@ -47,1445 +47,1492 @@
 #include "MICmnLLDBUtilSBValue.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarCreate constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarCreate::CMICmdCmdVarCreate( void )
-:	m_nChildren( 0 )
-,	m_nThreadId( 0 )
-,	m_strType( "??" )
-,	m_bValid( false )
-,	m_strValue( "??" )
-,	m_constStrArgThread( "thread" )
-,	m_constStrArgThreadGroup( "thread-group" )
-,	m_constStrArgFrame( "frame" )
-,	m_constStrArgName( "name" )
-,	m_constStrArgFrameAddr( "frame-addr" )
-,	m_constStrArgExpression( "expression" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-create";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarCreate::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarCreate destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarCreate::~CMICmdCmdVarCreate( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarCreate::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValOptionLong( m_constStrArgThread, false, true, CMICmdArgValListBase::eArgValType_Number, 1 ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValOptionLong( m_constStrArgThreadGroup, false, false, CMICmdArgValListBase::eArgValType_ThreadGrp, 1 ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValOptionLong( m_constStrArgFrame, false, true, CMICmdArgValListBase::eArgValType_Number, 1 ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, false, true ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgFrameAddr, false, true ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgExpression, true, true, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarCreate::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgThread, OptionLong, m_constStrArgThread );
-	CMICMDBASE_GETOPTION( pArgFrame, OptionLong, m_constStrArgFrame );
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-	CMICMDBASE_GETOPTION( pArgFrameAddr, String, m_constStrArgFrameAddr );
-	CMICMDBASE_GETOPTION( pArgExpression, String, m_constStrArgExpression );
-
-	// Retrieve the --thread option's thread ID (only 1)
-	MIuint64 nThreadId = UINT64_MAX;
-	if( !pArgThread->GetExpectedOption< CMICmdArgValNumber, MIuint64 >( nThreadId ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_OPTION_NOT_FOUND ), m_cmdData.strMiCmd.c_str(), m_constStrArgThread.c_str() ) );
-		return MIstatus::failure;
-	}
-	m_nThreadId = nThreadId;
-
-	// Retrieve the --frame option's number
-	MIuint64 nFrame = UINT64_MAX;
-	if( !pArgFrame->GetExpectedOption< CMICmdArgValNumber, MIuint64 >( nFrame ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_OPTION_NOT_FOUND ), m_cmdData.strMiCmd.c_str(), m_constStrArgFrame.c_str() ) );
-		return MIstatus::failure;
-	}
-	
-	const CMICmdArgValOptionLong::VecArgObjPtr_t & rVecFrameId( pArgFrame->GetExpectedOptions() );
-	CMICmdArgValOptionLong::VecArgObjPtr_t::const_iterator it2 = rVecFrameId.begin();
-	if( it2 != rVecFrameId.end() )
-	{
-		const CMICmdArgValNumber * pOption = static_cast< CMICmdArgValNumber * >( *it2 );
-		nFrame = pOption->GetValue();
-	}
-
-	bool bAutoName = false;
-	const CMIUtilString strArgName;
-	if( pArgName->GetFound() )
-	{
-		const CMIUtilString & rArg = pArgName->GetValue();
-		bAutoName = (rArg == "-");
-	}
-
-	const CMIUtilString & rStrExpression( pArgExpression->GetValue() );
-	m_strExpression = rStrExpression;
-	
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
-	m_strVarName = "<unnamedvariable>";
-	if( bAutoName )
-	{
-		m_strVarName = CMIUtilString::Format( "var%u", CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet() );
-		CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc();
-	}
-	lldb::SBProcess & rProcess = rSessionInfo.m_lldbProcess;
-	lldb::SBThread thread = rProcess.GetThreadByIndexID( nThreadId );
-	lldb::SBFrame frame = thread.GetFrameAtIndex( nFrame );
-	lldb::SBValue value = frame.FindVariable( rStrExpression.c_str() );
-	if( !value.IsValid() )
-		value = frame.EvaluateExpression( rStrExpression.c_str() );
-	if( value.IsValid() )
-	{
-		m_bValid = true;
-		m_nChildren = value.GetNumChildren();
-		m_strType = CMICmnLLDBUtilSBValue( value ).GetTypeNameDisplay();	
-			
-		// This gets added to CMICmnLLDBDebugSessionInfoVarObj static container of varObjs
-		CMICmnLLDBDebugSessionInfoVarObj varObj( rStrExpression, m_strVarName, value );
-		m_strValue = varObj.GetValueFormatted();
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarCreate::Acknowledge( void )
-{
-	if( m_bValid )
-	{
-		// MI print "%s^done,name=\"%s\",numchild=\"%d\",value=\"%s\",type=\"%s\",thread-id=\"%llu\",has_more=\"%u\""
-		const CMICmnMIValueConst miValueConst( m_strVarName );
-		CMICmnMIValueResult miValueResultAll( "name", miValueConst );
-		const CMIUtilString strNumChild( CMIUtilString::Format( "%d", m_nChildren ) );
-		const CMICmnMIValueConst miValueConst2( strNumChild );
-		miValueResultAll.Add( "numchild", miValueConst2 );
-		const CMICmnMIValueConst miValueConst3( m_strValue );
-		miValueResultAll.Add( "value", miValueConst3 );
-		const CMICmnMIValueConst miValueConst4( m_strType );
-		miValueResultAll.Add( "type", miValueConst4 );
-		const CMIUtilString strThreadId( CMIUtilString::Format( "%llu", m_nThreadId ) );
-		const CMICmnMIValueConst miValueConst5( strThreadId );
-		miValueResultAll.Add( "thread-id", miValueConst5 );
-		const CMICmnMIValueConst miValueConst6( "0" );
-		miValueResultAll.Add( "has_more", miValueConst6 );
-		
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResultAll );
-		m_miResultRecord = miRecordResult;
-
-		return MIstatus::success;
-	}
-
-	const CMICmnMIValueConst miValueConst( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_CREATION_FAILED ), m_strExpression.c_str() ) );
-	CMICmnMIValueResult miValueResult( "msg", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult );
-	m_miResultRecord = miRecordResult;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarCreate::CreateSelf( void )
-{
-	return new CMICmdCmdVarCreate();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarUpdate constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarUpdate::CMICmdCmdVarUpdate( void )
-:	m_constStrArgPrintValues( "print-values" )
-,	m_constStrArgName( "name" )
-,	m_bValueChangedArrayType( false )
-,	m_bValueChangedCompositeType( false )
-,	m_bValueChangedNormalType( false )
-,	m_miValueList( true )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-update";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarUpdate::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarUpdate destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarUpdate::~CMICmdCmdVarUpdate( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarUpdate::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValNumber( m_constStrArgPrintValues, false, false ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarUpdate::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	const CMIUtilString & rVarRealName( varObj.GetNameReal() ); MIunused( rVarRealName );
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-	const bool bValid = rValue.IsValid();
-	if( bValid && rValue.GetValueDidChange() )
-	{
-		m_bValueChangedNormalType = true;
-		varObj.UpdateValue();
-		m_strValueName = rVarObjName;
-		return MIstatus::success;
-	}
-
-	// Examine an array type variable
-	if( !ExamineSBValueForChange( varObj, false, m_bValueChangedArrayType ) )
-		return MIstatus::failure;
-
-	// Handle composite types i.e. struct or arrays
-	const MIuint nChildren = rValue.GetNumChildren();
-	for( MIuint i = 0; i < nChildren; i++ )
-	{
-		lldb::SBValue member = rValue.GetChildAtIndex( i );
-		if( !member.IsValid() )
-			continue;
-
-		const CMIUtilString varName( CMIUtilString::Format( "%s.%s", rVarObjName.c_str(), member.GetName() ) );
-		if( member.GetValueDidChange() )
-		{
-			// Handle composite
-			const CMIUtilString strValue( CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted( member, CMICmnLLDBDebugSessionInfoVarObj::eVarFormat_Natural ) );
-			const CMIUtilString strInScope( member.IsInScope() ? "true" : "false" );
-			MIFormResponse( varName, strValue, strInScope );
-
-			m_bValueChangedCompositeType = true;
-		}
-		else
-		{
-			// Handle array of composites
-			CMICmnLLDBDebugSessionInfoVarObj varObj;
-			if( CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( varName, varObj ) )
-			{
-				bool bValueChanged = false;
-				if( ExamineSBValueForChange( varObj, true, bValueChanged ) )
-				{
-					if( bValueChanged && CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( varName, varObj ) )
-					{
-						lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-						const bool bValid = rValue.IsValid();
-						const CMIUtilString strValue( bValid ? varObj.GetValueFormatted() : "<unknown>" );
-						const CMIUtilString strInScope( (bValid && rValue.IsInScope()) ? "true" : "false" );
-						MIFormResponse( varName, strValue, strInScope );
-						
-						m_bValueChangedCompositeType = true;
-					}
-				}
-				else
-					return MIstatus::failure;
-			}
-		}		
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarUpdate::Acknowledge( void )
-{
-	if( m_bValueChangedArrayType || m_bValueChangedNormalType )
-	{
-		CMICmnLLDBDebugSessionInfoVarObj varObj;
-		CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( m_strValueName, varObj );
-		lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-		const bool bValid = rValue.IsValid();
-		const CMIUtilString strValue( bValid ? varObj.GetValueFormatted() : "<unknown>" );
-		const CMIUtilString strInScope( (bValid && rValue.IsInScope()) ? "true" : "false" );
-	
-		// MI print "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
-		const CMICmnMIValueConst miValueConst( m_strValueName );
-		CMICmnMIValueResult miValueResult( "name", miValueConst );
-		CMICmnMIValueTuple miValueTuple( miValueResult );
-		const CMICmnMIValueConst miValueConst2( strValue );
-		CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-		miValueTuple.Add( miValueResult2 );
-		const CMICmnMIValueConst miValueConst3( strInScope );
-		CMICmnMIValueResult miValueResult3( "in_scope", miValueConst3 );
-		miValueTuple.Add( miValueResult3 );
-		const CMICmnMIValueConst miValueConst4( "false" );
-		CMICmnMIValueResult miValueResult4( "type_changed", miValueConst4 );
-		miValueTuple.Add( miValueResult4 );
-		const CMICmnMIValueConst miValueConst5( "0" );
-		CMICmnMIValueResult miValueResult5( "has_more", miValueConst5 );
-		miValueTuple.Add( miValueResult5 );
-		const CMICmnMIValueList miValueList( miValueTuple );
-		CMICmnMIValueResult miValueResult6( "changelist", miValueList );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6 );
-		m_miResultRecord = miRecordResult;
-	
-		return MIstatus::success;
-	}
-	else if( m_bValueChangedCompositeType )
-	{
-		// MI print "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"},{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
-		CMICmnMIValueResult miValueResult6( "changelist", m_miValueList );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6 );
-		m_miResultRecord = miRecordResult;
-	}
-	else
-	{
-		// MI: "%s^done,changelist=[]"
-		const CMICmnMIValueList miValueList( true );
-		CMICmnMIValueResult miValueResult6( "changelist", miValueList );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6 );
-		m_miResultRecord = miRecordResult;
-		return MIstatus::success;
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarUpdate::CreateSelf( void )
-{
-	return new CMICmdCmdVarUpdate();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form the MI response for multiple variables.
-// Type:	Method.
-// Args:	vrStrVarName	- (R)	Session var object's name.
-//			vrStrValue		- (R)	Text version of the value held in the variable. 
-//			vrStrScope		- (R)	In scope "yes" or "no".
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarUpdate::MIFormResponse( const CMIUtilString & vrStrVarName, const CMIUtilString & vrStrValue, const CMIUtilString & vrStrScope )
-{
-	// MI print "[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
-	const CMICmnMIValueConst miValueConst( vrStrVarName );
-	CMICmnMIValueResult miValueResult( "name", miValueConst );
-	CMICmnMIValueTuple miValueTuple( miValueResult );
-	const CMICmnMIValueConst miValueConst2( vrStrValue );
-	CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-	bool bOk = miValueTuple.Add( miValueResult2 );
-	const CMICmnMIValueConst miValueConst3( vrStrScope );
-	CMICmnMIValueResult miValueResult3( "in_scope", miValueConst3 );
-	bOk = bOk && miValueTuple.Add( miValueResult3 );
-	const CMICmnMIValueConst miValueConst4( "false" );
-	CMICmnMIValueResult miValueResult4( "type_changed", miValueConst4 );
-	bOk = bOk && miValueTuple.Add( miValueResult4 );
-	const CMICmnMIValueConst miValueConst5( "0" );
-	CMICmnMIValueResult miValueResult5( "has_more", miValueConst5 );
-	bOk = bOk && miValueTuple.Add( miValueResult5 );
-	bOk = bOk && m_miValueList.Add( miValueTuple );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Determine if the var object is a array type variable. LLDB does not 'detect'
-//			a value change for some types like elements in an array so have to re-evaluate
-//			the expression again.
-// Type:	Method.
-// Args:	vrVarObj	- (R)	Session var object to examine.
-//			vrwbChanged	- (W)	True = Is an array type and it changed, 
-//								False = Not an array type or not changed.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarUpdate::ExamineSBValueForChange( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj, const bool vbIgnoreVarType, bool & vrwbChanged )
-{
-	vrwbChanged = false;
-
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
-	lldb::SBProcess & rProcess = rSessionInfo.m_lldbProcess;
-	lldb::SBThread thread = rProcess.GetSelectedThread();
-	if( thread.GetNumFrames() == 0 )
-	{
-		return MIstatus::success;
-	}
-
-	const CMIUtilString & strVarObjParentName = vrVarObj.GetVarParentName();
-	lldb::SBFrame frame = thread.GetSelectedFrame();
-	const CMIUtilString & rExpression( vrVarObj.GetNameReal() );
-	CMIUtilString varExpression;
-	if( strVarObjParentName.empty() )
-	{
-		varExpression = rExpression;
-	}
-	else
-	{
-		CMICmnLLDBDebugSessionInfoVarObj varObjParent;
-		if( CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( strVarObjParentName, varObjParent ) )
-			varExpression = CMIUtilString::Format( "%s.%s", varObjParent.GetNameReal().c_str(), rExpression.c_str() );
-		else
-		{
-			// The parent is only assigned in the CMICmdCmdVarListChildren command, we have a problem, need to investigate
-			SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), strVarObjParentName.c_str() ) );
-			return MIstatus::failure;
-		}
-	}
-
-	lldb::SBValue value = frame.EvaluateExpression( varExpression.c_str() );
-	if( !value.IsValid() )
-		value = frame.FindVariable( rExpression.c_str() );
-	if( value.IsValid() )
-	{
-		lldb::SBType valueType = value.GetType();
-		const lldb::BasicType eValueType = valueType.GetBasicType();
-		if( vbIgnoreVarType || (eValueType != lldb::BasicType::eBasicTypeInvalid) )
-		{
-			MIuint64 nPrevValue = 0;
-			MIuint64 nRevaluateValue = 0;
-			lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrVarObj.GetValue() );
-			if( CMICmnLLDBProxySBValue::GetValueAsUnsigned( rValue, nPrevValue ) &&
-				CMICmnLLDBProxySBValue::GetValueAsUnsigned( value, nRevaluateValue ) &&
-				(nPrevValue != nRevaluateValue) )
-			{
-				// Have a value change so update the var object
-				vrwbChanged = true;
-				const CMICmnLLDBDebugSessionInfoVarObj varObj( rExpression, vrVarObj.GetName(), value, strVarObjParentName );
-			}
-		}
-	}
-
-	return MIstatus::success;
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarDelete constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarDelete::CMICmdCmdVarDelete( void )
-:	m_constStrArgName( "name" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-delete";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarDelete::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarDelete::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarDelete destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarDelete::~CMICmdCmdVarDelete( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarDelete::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj::VarObjDelete( rVarObjName );
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarDelete::Acknowledge( void )
-{
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done );
-	m_miResultRecord = miRecordResult;
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarDelete::CreateSelf( void )
-{
-	return new CMICmdCmdVarDelete();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarAssign constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarAssign::CMICmdCmdVarAssign( void )
-:	m_bOk( true )
-,	m_constStrArgName( "name" )
-,	m_constStrArgExpression( "expression" ) 
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-assign";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarAssign::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarAssign destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarAssign::~CMICmdCmdVarAssign( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarAssign::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgExpression, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarAssign::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-	CMICMDBASE_GETOPTION( pArgExpression, String, m_constStrArgExpression );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	const CMIUtilString & rExpression( pArgExpression->GetValue() );
-	
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-	m_varObjName = rVarObjName;
-
-	CMIUtilString strExpression( rExpression.Trim() );
-	strExpression = strExpression.Trim( '"' );
-	lldb::SBValue & rValue( const_cast< lldb::SBValue & >( varObj.GetValue() ) );
-	m_bOk = rValue.SetValueFromCString( strExpression.c_str() );
-	if( m_bOk )
-		varObj.UpdateValue();
-		
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarAssign::Acknowledge( void )
-{
-	if( m_bOk )
-	{
-		// MI print "%s^done,value=\"%s\""
-		CMICmnLLDBDebugSessionInfoVarObj varObj;
-		CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( m_varObjName, varObj );
-		const CMICmnMIValueConst miValueConst( varObj.GetValueFormatted() );
-		const CMICmnMIValueResult miValueResult( "value", miValueConst );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-		m_miResultRecord = miRecordResult;
-	
-		return MIstatus::success;
-	}
-
-	const CMICmnMIValueConst miValueConst( "expression could not be evaluated" );
-	const CMICmnMIValueResult miValueResult( "msg", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult );
-	m_miResultRecord = miRecordResult;
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarAssign::CreateSelf( void )
-{
-	return new CMICmdCmdVarAssign();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarSetFormat constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarSetFormat::CMICmdCmdVarSetFormat( void )
-:	m_constStrArgName( "name" )
-,	m_constStrArgFormatSpec( "format-spec" ) 
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-set-format";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarSetFormat::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarSetFormat destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarSetFormat::~CMICmdCmdVarSetFormat( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarSetFormat::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgFormatSpec, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarSetFormat::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-	CMICMDBASE_GETOPTION( pArgFormatSpec, String, m_constStrArgFormatSpec );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	const CMIUtilString & rExpression( pArgFormatSpec->GetValue() );
-
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-	if( !varObj.SetVarFormat( CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString( rExpression ) ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_ENUM_INVALID ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str(), rExpression.c_str() ) );
-		return MIstatus::failure;
-	}
-	varObj.UpdateValue();
-
-	m_varObjName = rVarObjName;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarSetFormat::Acknowledge( void )
-{
-	// MI print "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( m_varObjName, varObj );
-	const CMICmnMIValueConst miValueConst( m_varObjName );
-	const CMICmnMIValueResult miValueResult( "name", miValueConst );
-	CMICmnMIValueTuple miValueTuple( miValueResult );
-	const CMICmnMIValueConst miValueConst2( varObj.GetValueFormatted() );
-	const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-	miValueTuple.Add( miValueResult2 );
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-	const CMICmnMIValueConst miValueConst3( rValue.IsInScope() ? "true" : "false" );
-	const CMICmnMIValueResult miValueResult3( "in_scope", miValueConst3 );
-	miValueTuple.Add( miValueResult3 );
-	const CMICmnMIValueConst miValueConst4( "false" );
-	const CMICmnMIValueResult miValueResult4( "type_changed", miValueConst4 );
-	miValueTuple.Add( miValueResult4 );
-	const CMICmnMIValueConst miValueConst5( "0" );
-	const CMICmnMIValueResult miValueResult5( "type_changed", miValueConst5 );
-	miValueTuple.Add( miValueResult5 );
-	const CMICmnMIValueList miValueList( miValueTuple );
-	const CMICmnMIValueResult miValueResult6( "changelist", miValueList );
-	
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6 );
-	m_miResultRecord = miRecordResult;
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarSetFormat::CreateSelf( void )
-{
-	return new CMICmdCmdVarSetFormat();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarListChildren constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarListChildren::CMICmdCmdVarListChildren( void )
-:	m_bValueValid( false )
-,	m_nChildren( 0 )
-,	m_constStrArgPrintValues( "print-values" )
-,	m_constStrArgName( "name" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-list-children";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarListChildren::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarListChildren destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarListChildren::~CMICmdCmdVarListChildren( void )
-{
-	m_vecMiValueResult.clear();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarListChildren::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValNumber( m_constStrArgPrintValues, false, false ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarListChildren::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-	
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-	m_bValueValid = rValue.IsValid();
-	if( !m_bValueValid )
-		return MIstatus::success;
-
-	m_vecMiValueResult.clear();
-	m_nChildren = rValue.GetNumChildren();
-	for( MIuint i = 0; i < m_nChildren; i++ )
-	{
-		lldb::SBValue member = rValue.GetChildAtIndex( i );
-		if( !member.IsValid() )
-			continue; 
-		const CMICmnLLDBUtilSBValue utilValue( member );
-		const CMIUtilString strExp = utilValue.GetName();
-		const CMIUtilString name( CMIUtilString::Format( "%s.%s", rVarObjName.c_str(), strExp.c_str() ) );
-		const MIuint nChildren = member.GetNumChildren();
-		const CMIUtilString strThreadId( CMIUtilString::Format( "%u", member.GetThread().GetIndexID() ) );
-
-		// Varobj gets added to CMICmnLLDBDebugSessionInfoVarObj static container of varObjs
-		CMICmnLLDBDebugSessionInfoVarObj var( strExp, name, member, rVarObjName );
-		
-		// MI print "child={name=\"%s\",exp=\"%s\",numchild=\"%d\",value=\"%s\",type=\"%s\",thread-id=\"%u\",has_more=\"%u\"}"
-		const CMICmnMIValueConst miValueConst( name );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		CMICmnMIValueTuple miValueTuple( miValueResult );
-		const CMICmnMIValueConst miValueConst2( strExp );
-		const CMICmnMIValueResult miValueResult2( "exp", miValueConst2 );
-		miValueTuple.Add( miValueResult2 );
-		const CMIUtilString strNumChild( CMIUtilString::Format( "%d", nChildren ) );
-		const CMICmnMIValueConst miValueConst3( strNumChild );
-		const CMICmnMIValueResult miValueResult3( "numchild", miValueConst3 );
-		miValueTuple.Add( miValueResult3 );
-		const CMICmnMIValueConst miValueConst5( utilValue.GetTypeNameDisplay() );
-		const CMICmnMIValueResult miValueResult5( "type", miValueConst5 );
-		miValueTuple.Add( miValueResult5 );
-		const CMICmnMIValueConst miValueConst6( strThreadId );
-		const CMICmnMIValueResult miValueResult6( "thread-id", miValueConst6 );
-		miValueTuple.Add( miValueResult6 );
-		const CMICmnMIValueConst miValueConst7( "0" );
-		const CMICmnMIValueResult miValueResult7( "has_more", miValueConst7 );
-		miValueTuple.Add( miValueResult7 );
-		const CMICmnMIValueResult miValueResult8( "child", miValueTuple );
-		m_vecMiValueResult.push_back( miValueResult8 );
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarListChildren::Acknowledge( void )
-{
-	if( m_bValueValid )
-	{
-		// MI print "%s^done,numchild=\"%u\",children=[]""
-		const CMIUtilString strNumChild( CMIUtilString::Format( "%u", m_nChildren ) );
-		const CMICmnMIValueConst miValueConst( strNumChild );
-		CMICmnMIValueResult miValueResult( "numchild", miValueConst );
-		
-		VecMIValueResult_t::const_iterator it = m_vecMiValueResult.begin();
-		if( it == m_vecMiValueResult.end() )
-		{
-			const CMICmnMIValueConst miValueConst( "[]" );
-			miValueResult.Add( "children", miValueConst );
-		}
-		else
-		{
-			CMICmnMIValueList miValueList( *it );
-			++it;
-			while( it != m_vecMiValueResult.end() )
-			{
-				const CMICmnMIValueResult & rResult( *it );
-				miValueList.Add( rResult );
-
-				// Next
-				++it;
-			}
-			miValueResult.Add( "children", miValueList );
-		}
-
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-		m_miResultRecord = miRecordResult;
-		return MIstatus::success;
-	}
-
-	// MI print "%s^done,numchild=\"0\""
-	const CMICmnMIValueConst miValueConst( "0" );
-	const CMICmnMIValueResult miValueResult( "numchild", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-	m_miResultRecord = miRecordResult;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarListChildren::CreateSelf( void )
-{
-	return new CMICmdCmdVarListChildren();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarEvaluateExpression constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarEvaluateExpression::CMICmdCmdVarEvaluateExpression( void )
-:	m_bValueValid( true )
-,	m_constStrArgFormatSpec( "-f" )
-,	m_constStrArgName( "name" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-evaluate-expression";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarEvaluateExpression::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarEvaluateExpression destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarEvaluateExpression::~CMICmdCmdVarEvaluateExpression( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarEvaluateExpression::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValOptionShort( m_constStrArgFormatSpec, false, false, CMICmdArgValListBase::eArgValType_String, 1 ) ) );
-	bOk = bOk && m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarEvaluateExpression::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-	m_bValueValid = rValue.IsValid();
-	if( !m_bValueValid )
-		return MIstatus::success;
-
-	m_varObjName = rVarObjName;
-	varObj.UpdateValue();
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarEvaluateExpression::Acknowledge( void )
-{
-	if( m_bValueValid )
-	{
-		CMICmnLLDBDebugSessionInfoVarObj varObj;
-		CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( m_varObjName, varObj );
-		const CMICmnMIValueConst miValueConst( varObj.GetValueFormatted() );
-		const CMICmnMIValueResult miValueResult( "value", miValueConst );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-		m_miResultRecord = miRecordResult;
-		return MIstatus::success;
-	}
-
-	const CMICmnMIValueConst miValueConst( "variable invalid" );
-	const CMICmnMIValueResult miValueResult( "msg", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult );
-	m_miResultRecord = miRecordResult;
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarEvaluateExpression::CreateSelf( void )
-{
-	return new CMICmdCmdVarEvaluateExpression();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarInfoPathExpression constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarInfoPathExpression::CMICmdCmdVarInfoPathExpression( void )
-:	m_bValueValid( true )
-,	m_constStrArgName( "name" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-info-path-expression";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarInfoPathExpression::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarInfoPathExpression destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarInfoPathExpression::~CMICmdCmdVarInfoPathExpression( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarInfoPathExpression::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarInfoPathExpression::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( varObj.GetValue() );
-	m_bValueValid = rValue.IsValid();
-	if( !m_bValueValid )
-		return MIstatus::success;
-
-	lldb::SBStream stream;
-	if( !rValue.GetExpressionPath( stream, true ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-	
-	const MIchar * pPathExpression = stream.GetData();
-	if( pPathExpression == nullptr )
-	{
-		// Build expression from what we do know
-		m_strPathExpression = varObj.GetNameReal();
-		return MIstatus::success;
-	}
-
-	// Has LLDB returned a var signature of it's own
-	if( pPathExpression[ 0 ] != '$' )
-	{
-		m_strPathExpression = pPathExpression;
-		return MIstatus::success;
-	}
-
-	// Build expression from what we do know
-	const CMIUtilString & rVarParentName( varObj.GetVarParentName() );
-	if( rVarParentName.empty() )
-	{
-		m_strPathExpression = varObj.GetNameReal();
-	}
-	else
-	{
-		CMICmnLLDBDebugSessionInfoVarObj varObjParent;
-		if( !CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarParentName, varObjParent ) )
-		{
-			SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarParentName.c_str() ) );
-			return MIstatus::failure;
-		}
-		m_strPathExpression = CMIUtilString::Format( "%s.%s", varObjParent.GetNameReal().c_str(), varObj.GetNameReal().c_str() );
-	}
-		
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarInfoPathExpression::Acknowledge( void )
-{
-	if( m_bValueValid )
-	{
-		const CMICmnMIValueConst miValueConst( m_strPathExpression );
-		const CMICmnMIValueResult miValueResult( "path_expr", miValueConst );
-		const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-		m_miResultRecord = miRecordResult;
-		return MIstatus::success;
-	}
-
-	const CMICmnMIValueConst miValueConst( "variable invalid" );
-	const CMICmnMIValueResult miValueResult( "msg", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult );
-	m_miResultRecord = miRecordResult;
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
-//--
-CMICmdBase * CMICmdCmdVarInfoPathExpression::CreateSelf( void )
-{
-	return new CMICmdCmdVarInfoPathExpression();
-}
-
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarShowAttributes constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarShowAttributes::CMICmdCmdVarShowAttributes( void )
-:	m_constStrArgName( "name" )
-{
-	// Command factory matches this name with that received from the stdin stream
-	m_strMiCmd = "var-show-attributes";
-	
-	// Required by the CMICmdFactory when registering *this command
-	m_pSelfCreatorFn = &CMICmdCmdVarShowAttributes::CreateSelf;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdCmdVarShowAttributes destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdCmdVarShowAttributes::~CMICmdCmdVarShowAttributes( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The parses the command line options 
-//			arguments to extract values for each of those arguments.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarShowAttributes::ParseArgs( void )
-{
-	bool bOk = m_setCmdArgs.Add( *(new CMICmdArgValString( m_constStrArgName, true, true ) ) );
-	return (bOk && ParseValidateCmdOptions() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command does work in this function.
-//			The command is likely to communicate with the LLDB SBDebugger in here.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarShowAttributes::Execute( void )
-{
-	CMICMDBASE_GETOPTION( pArgName, String, m_constStrArgName );
-
-	const CMIUtilString & rVarObjName( pArgName->GetValue() );
-	CMICmnLLDBDebugSessionInfoVarObj varObj;
-	if( CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( rVarObjName, varObj ) )
-	{
-		SetError( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_VARIABLE_DOESNOTEXIST ), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str() ) );
-		return MIstatus::failure;
-	}
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The invoker requires this function. The command prepares a MI Record Result
-//			for the work carried out in the Execute().
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdCmdVarShowAttributes::Acknowledge( void )
-{
-	// MI output: "%s^done,status=\"editable\"]"
-	const CMICmnMIValueConst miValueConst( "editable" );
-	const CMICmnMIValueResult miValueResult( "status", miValueConst );
-	const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
-	m_miResultRecord = miRecordResult;
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdFactory when registering *this command. The factory
-//			calls this function to create an instance of *this command.
-// Type:	Static method.
-// Args:	None.
-// Return:	CMICmdBase * - Pointer to a new command.
-// Throws:	None.
+// Details: CMICmdCmdVarCreate constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmdBase * CMICmdCmdVarShowAttributes::CreateSelf( void )
+CMICmdCmdVarCreate::CMICmdCmdVarCreate(void)
+    : m_nChildren(0)
+    , m_nThreadId(0)
+    , m_strType("??")
+    , m_bValid(false)
+    , m_strValue("??")
+    , m_constStrArgThread("thread")
+    , m_constStrArgThreadGroup("thread-group")
+    , m_constStrArgFrame("frame")
+    , m_constStrArgName("name")
+    , m_constStrArgFrameAddr("frame-addr")
+    , m_constStrArgExpression("expression")
 {
-	return new CMICmdCmdVarShowAttributes();
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-create";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarCreate::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarCreate destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarCreate::~CMICmdCmdVarCreate(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarCreate::ParseArgs(void)
+{
+    bool bOk =
+        m_setCmdArgs.Add(*(new CMICmdArgValOptionLong(m_constStrArgThread, false, true, CMICmdArgValListBase::eArgValType_Number, 1)));
+    bOk = bOk &&
+          m_setCmdArgs.Add(
+              *(new CMICmdArgValOptionLong(m_constStrArgThreadGroup, false, false, CMICmdArgValListBase::eArgValType_ThreadGrp, 1)));
+    bOk = bOk &&
+          m_setCmdArgs.Add(*(new CMICmdArgValOptionLong(m_constStrArgFrame, false, true, CMICmdArgValListBase::eArgValType_Number, 1)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, false, true)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgFrameAddr, false, true)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgExpression, true, true, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarCreate::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgThread, OptionLong, m_constStrArgThread);
+    CMICMDBASE_GETOPTION(pArgFrame, OptionLong, m_constStrArgFrame);
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+    CMICMDBASE_GETOPTION(pArgFrameAddr, String, m_constStrArgFrameAddr);
+    CMICMDBASE_GETOPTION(pArgExpression, String, m_constStrArgExpression);
+
+    // Retrieve the --thread option's thread ID (only 1)
+    MIuint64 nThreadId = UINT64_MAX;
+    if (!pArgThread->GetExpectedOption<CMICmdArgValNumber, MIuint64>(nThreadId))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_OPTION_NOT_FOUND), m_cmdData.strMiCmd.c_str(), m_constStrArgThread.c_str()));
+        return MIstatus::failure;
+    }
+    m_nThreadId = nThreadId;
+
+    // Retrieve the --frame option's number
+    MIuint64 nFrame = UINT64_MAX;
+    if (!pArgFrame->GetExpectedOption<CMICmdArgValNumber, MIuint64>(nFrame))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_OPTION_NOT_FOUND), m_cmdData.strMiCmd.c_str(), m_constStrArgFrame.c_str()));
+        return MIstatus::failure;
+    }
+
+    const CMICmdArgValOptionLong::VecArgObjPtr_t &rVecFrameId(pArgFrame->GetExpectedOptions());
+    CMICmdArgValOptionLong::VecArgObjPtr_t::const_iterator it2 = rVecFrameId.begin();
+    if (it2 != rVecFrameId.end())
+    {
+        const CMICmdArgValNumber *pOption = static_cast<CMICmdArgValNumber *>(*it2);
+        nFrame = pOption->GetValue();
+    }
+
+    bool bAutoName = false;
+    const CMIUtilString strArgName;
+    if (pArgName->GetFound())
+    {
+        const CMIUtilString &rArg = pArgName->GetValue();
+        bAutoName = (rArg == "-");
+    }
+
+    const CMIUtilString &rStrExpression(pArgExpression->GetValue());
+    m_strExpression = rStrExpression;
+
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    m_strVarName = "<unnamedvariable>";
+    if (bAutoName)
+    {
+        m_strVarName = CMIUtilString::Format("var%u", CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet());
+        CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc();
+    }
+    lldb::SBProcess &rProcess = rSessionInfo.m_lldbProcess;
+    lldb::SBThread thread = rProcess.GetThreadByIndexID(nThreadId);
+    lldb::SBFrame frame = thread.GetFrameAtIndex(nFrame);
+    lldb::SBValue value = frame.FindVariable(rStrExpression.c_str());
+    if (!value.IsValid())
+        value = frame.EvaluateExpression(rStrExpression.c_str());
+    if (value.IsValid())
+    {
+        m_bValid = true;
+        m_nChildren = value.GetNumChildren();
+        m_strType = CMICmnLLDBUtilSBValue(value).GetTypeNameDisplay();
+
+        // This gets added to CMICmnLLDBDebugSessionInfoVarObj static container of varObjs
+        CMICmnLLDBDebugSessionInfoVarObj varObj(rStrExpression, m_strVarName, value);
+        m_strValue = varObj.GetValueFormatted();
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarCreate::Acknowledge(void)
+{
+    if (m_bValid)
+    {
+        // MI print "%s^done,name=\"%s\",numchild=\"%d\",value=\"%s\",type=\"%s\",thread-id=\"%llu\",has_more=\"%u\""
+        const CMICmnMIValueConst miValueConst(m_strVarName);
+        CMICmnMIValueResult miValueResultAll("name", miValueConst);
+        const CMIUtilString strNumChild(CMIUtilString::Format("%d", m_nChildren));
+        const CMICmnMIValueConst miValueConst2(strNumChild);
+        miValueResultAll.Add("numchild", miValueConst2);
+        const CMICmnMIValueConst miValueConst3(m_strValue);
+        miValueResultAll.Add("value", miValueConst3);
+        const CMICmnMIValueConst miValueConst4(m_strType);
+        miValueResultAll.Add("type", miValueConst4);
+        const CMIUtilString strThreadId(CMIUtilString::Format("%llu", m_nThreadId));
+        const CMICmnMIValueConst miValueConst5(strThreadId);
+        miValueResultAll.Add("thread-id", miValueConst5);
+        const CMICmnMIValueConst miValueConst6("0");
+        miValueResultAll.Add("has_more", miValueConst6);
+
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResultAll);
+        m_miResultRecord = miRecordResult;
+
+        return MIstatus::success;
+    }
+
+    const CMICmnMIValueConst miValueConst(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_CREATION_FAILED), m_strExpression.c_str()));
+    CMICmnMIValueResult miValueResult("msg", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarCreate::CreateSelf(void)
+{
+    return new CMICmdCmdVarCreate();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarUpdate constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarUpdate::CMICmdCmdVarUpdate(void)
+    : m_constStrArgPrintValues("print-values")
+    , m_constStrArgName("name")
+    , m_bValueChangedArrayType(false)
+    , m_bValueChangedCompositeType(false)
+    , m_bValueChangedNormalType(false)
+    , m_miValueList(true)
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-update";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarUpdate::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarUpdate destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarUpdate::~CMICmdCmdVarUpdate(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarUpdate::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValNumber(m_constStrArgPrintValues, false, false)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarUpdate::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    const CMIUtilString &rVarRealName(varObj.GetNameReal());
+    MIunused(rVarRealName);
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+    const bool bValid = rValue.IsValid();
+    if (bValid && rValue.GetValueDidChange())
+    {
+        m_bValueChangedNormalType = true;
+        varObj.UpdateValue();
+        m_strValueName = rVarObjName;
+        return MIstatus::success;
+    }
+
+    // Examine an array type variable
+    if (!ExamineSBValueForChange(varObj, false, m_bValueChangedArrayType))
+        return MIstatus::failure;
+
+    // Handle composite types i.e. struct or arrays
+    const MIuint nChildren = rValue.GetNumChildren();
+    for (MIuint i = 0; i < nChildren; i++)
+    {
+        lldb::SBValue member = rValue.GetChildAtIndex(i);
+        if (!member.IsValid())
+            continue;
+
+        const CMIUtilString varName(CMIUtilString::Format("%s.%s", rVarObjName.c_str(), member.GetName()));
+        if (member.GetValueDidChange())
+        {
+            // Handle composite
+            const CMIUtilString strValue(
+                CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(member, CMICmnLLDBDebugSessionInfoVarObj::eVarFormat_Natural));
+            const CMIUtilString strInScope(member.IsInScope() ? "true" : "false");
+            MIFormResponse(varName, strValue, strInScope);
+
+            m_bValueChangedCompositeType = true;
+        }
+        else
+        {
+            // Handle array of composites
+            CMICmnLLDBDebugSessionInfoVarObj varObj;
+            if (CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(varName, varObj))
+            {
+                bool bValueChanged = false;
+                if (ExamineSBValueForChange(varObj, true, bValueChanged))
+                {
+                    if (bValueChanged && CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(varName, varObj))
+                    {
+                        lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+                        const bool bValid = rValue.IsValid();
+                        const CMIUtilString strValue(bValid ? varObj.GetValueFormatted() : "<unknown>");
+                        const CMIUtilString strInScope((bValid && rValue.IsInScope()) ? "true" : "false");
+                        MIFormResponse(varName, strValue, strInScope);
+
+                        m_bValueChangedCompositeType = true;
+                    }
+                }
+                else
+                    return MIstatus::failure;
+            }
+        }
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarUpdate::Acknowledge(void)
+{
+    if (m_bValueChangedArrayType || m_bValueChangedNormalType)
+    {
+        CMICmnLLDBDebugSessionInfoVarObj varObj;
+        CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(m_strValueName, varObj);
+        lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+        const bool bValid = rValue.IsValid();
+        const CMIUtilString strValue(bValid ? varObj.GetValueFormatted() : "<unknown>");
+        const CMIUtilString strInScope((bValid && rValue.IsInScope()) ? "true" : "false");
+
+        // MI print "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
+        const CMICmnMIValueConst miValueConst(m_strValueName);
+        CMICmnMIValueResult miValueResult("name", miValueConst);
+        CMICmnMIValueTuple miValueTuple(miValueResult);
+        const CMICmnMIValueConst miValueConst2(strValue);
+        CMICmnMIValueResult miValueResult2("value", miValueConst2);
+        miValueTuple.Add(miValueResult2);
+        const CMICmnMIValueConst miValueConst3(strInScope);
+        CMICmnMIValueResult miValueResult3("in_scope", miValueConst3);
+        miValueTuple.Add(miValueResult3);
+        const CMICmnMIValueConst miValueConst4("false");
+        CMICmnMIValueResult miValueResult4("type_changed", miValueConst4);
+        miValueTuple.Add(miValueResult4);
+        const CMICmnMIValueConst miValueConst5("0");
+        CMICmnMIValueResult miValueResult5("has_more", miValueConst5);
+        miValueTuple.Add(miValueResult5);
+        const CMICmnMIValueList miValueList(miValueTuple);
+        CMICmnMIValueResult miValueResult6("changelist", miValueList);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6);
+        m_miResultRecord = miRecordResult;
+
+        return MIstatus::success;
+    }
+    else if (m_bValueChangedCompositeType)
+    {
+        // MI print
+        // "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"},{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
+        CMICmnMIValueResult miValueResult6("changelist", m_miValueList);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6);
+        m_miResultRecord = miRecordResult;
+    }
+    else
+    {
+        // MI: "%s^done,changelist=[]"
+        const CMICmnMIValueList miValueList(true);
+        CMICmnMIValueResult miValueResult6("changelist", miValueList);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6);
+        m_miResultRecord = miRecordResult;
+        return MIstatus::success;
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarUpdate::CreateSelf(void)
+{
+    return new CMICmdCmdVarUpdate();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form the MI response for multiple variables.
+// Type:    Method.
+// Args:    vrStrVarName    - (R)   Session var object's name.
+//          vrStrValue      - (R)   Text version of the value held in the variable.
+//          vrStrScope      - (R)   In scope "yes" or "no".
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarUpdate::MIFormResponse(const CMIUtilString &vrStrVarName, const CMIUtilString &vrStrValue, const CMIUtilString &vrStrScope)
+{
+    // MI print "[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
+    const CMICmnMIValueConst miValueConst(vrStrVarName);
+    CMICmnMIValueResult miValueResult("name", miValueConst);
+    CMICmnMIValueTuple miValueTuple(miValueResult);
+    const CMICmnMIValueConst miValueConst2(vrStrValue);
+    CMICmnMIValueResult miValueResult2("value", miValueConst2);
+    bool bOk = miValueTuple.Add(miValueResult2);
+    const CMICmnMIValueConst miValueConst3(vrStrScope);
+    CMICmnMIValueResult miValueResult3("in_scope", miValueConst3);
+    bOk = bOk && miValueTuple.Add(miValueResult3);
+    const CMICmnMIValueConst miValueConst4("false");
+    CMICmnMIValueResult miValueResult4("type_changed", miValueConst4);
+    bOk = bOk && miValueTuple.Add(miValueResult4);
+    const CMICmnMIValueConst miValueConst5("0");
+    CMICmnMIValueResult miValueResult5("has_more", miValueConst5);
+    bOk = bOk && miValueTuple.Add(miValueResult5);
+    bOk = bOk && m_miValueList.Add(miValueTuple);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Determine if the var object is a array type variable. LLDB does not 'detect'
+//          a value change for some types like elements in an array so have to re-evaluate
+//          the expression again.
+// Type:    Method.
+// Args:    vrVarObj    - (R)   Session var object to examine.
+//          vrwbChanged - (W)   True = Is an array type and it changed,
+//                              False = Not an array type or not changed.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarUpdate::ExamineSBValueForChange(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj, const bool vbIgnoreVarType, bool &vrwbChanged)
+{
+    vrwbChanged = false;
+
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    lldb::SBProcess &rProcess = rSessionInfo.m_lldbProcess;
+    lldb::SBThread thread = rProcess.GetSelectedThread();
+    if (thread.GetNumFrames() == 0)
+    {
+        return MIstatus::success;
+    }
+
+    const CMIUtilString &strVarObjParentName = vrVarObj.GetVarParentName();
+    lldb::SBFrame frame = thread.GetSelectedFrame();
+    const CMIUtilString &rExpression(vrVarObj.GetNameReal());
+    CMIUtilString varExpression;
+    if (strVarObjParentName.empty())
+    {
+        varExpression = rExpression;
+    }
+    else
+    {
+        CMICmnLLDBDebugSessionInfoVarObj varObjParent;
+        if (CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(strVarObjParentName, varObjParent))
+            varExpression = CMIUtilString::Format("%s.%s", varObjParent.GetNameReal().c_str(), rExpression.c_str());
+        else
+        {
+            // The parent is only assigned in the CMICmdCmdVarListChildren command, we have a problem, need to investigate
+            SetError(
+                CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), strVarObjParentName.c_str()));
+            return MIstatus::failure;
+        }
+    }
+
+    lldb::SBValue value = frame.EvaluateExpression(varExpression.c_str());
+    if (!value.IsValid())
+        value = frame.FindVariable(rExpression.c_str());
+    if (value.IsValid())
+    {
+        lldb::SBType valueType = value.GetType();
+        const lldb::BasicType eValueType = valueType.GetBasicType();
+        if (vbIgnoreVarType || (eValueType != lldb::BasicType::eBasicTypeInvalid))
+        {
+            MIuint64 nPrevValue = 0;
+            MIuint64 nRevaluateValue = 0;
+            lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrVarObj.GetValue());
+            if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(rValue, nPrevValue) &&
+                CMICmnLLDBProxySBValue::GetValueAsUnsigned(value, nRevaluateValue) && (nPrevValue != nRevaluateValue))
+            {
+                // Have a value change so update the var object
+                vrwbChanged = true;
+                const CMICmnLLDBDebugSessionInfoVarObj varObj(rExpression, vrVarObj.GetName(), value, strVarObjParentName);
+            }
+        }
+    }
+
+    return MIstatus::success;
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarDelete constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarDelete::CMICmdCmdVarDelete(void)
+    : m_constStrArgName("name")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-delete";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarDelete::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarDelete::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarDelete destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarDelete::~CMICmdCmdVarDelete(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarDelete::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj::VarObjDelete(rVarObjName);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarDelete::Acknowledge(void)
+{
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarDelete::CreateSelf(void)
+{
+    return new CMICmdCmdVarDelete();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarAssign constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarAssign::CMICmdCmdVarAssign(void)
+    : m_bOk(true)
+    , m_constStrArgName("name")
+    , m_constStrArgExpression("expression")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-assign";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarAssign::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarAssign destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarAssign::~CMICmdCmdVarAssign(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarAssign::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgExpression, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarAssign::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+    CMICMDBASE_GETOPTION(pArgExpression, String, m_constStrArgExpression);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    const CMIUtilString &rExpression(pArgExpression->GetValue());
+
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+    m_varObjName = rVarObjName;
+
+    CMIUtilString strExpression(rExpression.Trim());
+    strExpression = strExpression.Trim('"');
+    lldb::SBValue &rValue(const_cast<lldb::SBValue &>(varObj.GetValue()));
+    m_bOk = rValue.SetValueFromCString(strExpression.c_str());
+    if (m_bOk)
+        varObj.UpdateValue();
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarAssign::Acknowledge(void)
+{
+    if (m_bOk)
+    {
+        // MI print "%s^done,value=\"%s\""
+        CMICmnLLDBDebugSessionInfoVarObj varObj;
+        CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(m_varObjName, varObj);
+        const CMICmnMIValueConst miValueConst(varObj.GetValueFormatted());
+        const CMICmnMIValueResult miValueResult("value", miValueConst);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+        m_miResultRecord = miRecordResult;
+
+        return MIstatus::success;
+    }
+
+    const CMICmnMIValueConst miValueConst("expression could not be evaluated");
+    const CMICmnMIValueResult miValueResult("msg", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarAssign::CreateSelf(void)
+{
+    return new CMICmdCmdVarAssign();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarSetFormat constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarSetFormat::CMICmdCmdVarSetFormat(void)
+    : m_constStrArgName("name")
+    , m_constStrArgFormatSpec("format-spec")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-set-format";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarSetFormat::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarSetFormat destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarSetFormat::~CMICmdCmdVarSetFormat(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarSetFormat::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgFormatSpec, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarSetFormat::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+    CMICMDBASE_GETOPTION(pArgFormatSpec, String, m_constStrArgFormatSpec);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    const CMIUtilString &rExpression(pArgFormatSpec->GetValue());
+
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+    if (!varObj.SetVarFormat(CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString(rExpression)))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_ENUM_INVALID), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str(),
+                                       rExpression.c_str()));
+        return MIstatus::failure;
+    }
+    varObj.UpdateValue();
+
+    m_varObjName = rVarObjName;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarSetFormat::Acknowledge(void)
+{
+    // MI print "%s^done,changelist=[{name=\"%s\",value=\"%s\",in_scope=\"%s\",type_changed=\"false\",has_more=\"0\"}]"
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(m_varObjName, varObj);
+    const CMICmnMIValueConst miValueConst(m_varObjName);
+    const CMICmnMIValueResult miValueResult("name", miValueConst);
+    CMICmnMIValueTuple miValueTuple(miValueResult);
+    const CMICmnMIValueConst miValueConst2(varObj.GetValueFormatted());
+    const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+    miValueTuple.Add(miValueResult2);
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+    const CMICmnMIValueConst miValueConst3(rValue.IsInScope() ? "true" : "false");
+    const CMICmnMIValueResult miValueResult3("in_scope", miValueConst3);
+    miValueTuple.Add(miValueResult3);
+    const CMICmnMIValueConst miValueConst4("false");
+    const CMICmnMIValueResult miValueResult4("type_changed", miValueConst4);
+    miValueTuple.Add(miValueResult4);
+    const CMICmnMIValueConst miValueConst5("0");
+    const CMICmnMIValueResult miValueResult5("type_changed", miValueConst5);
+    miValueTuple.Add(miValueResult5);
+    const CMICmnMIValueList miValueList(miValueTuple);
+    const CMICmnMIValueResult miValueResult6("changelist", miValueList);
+
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult6);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarSetFormat::CreateSelf(void)
+{
+    return new CMICmdCmdVarSetFormat();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarListChildren constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarListChildren::CMICmdCmdVarListChildren(void)
+    : m_bValueValid(false)
+    , m_nChildren(0)
+    , m_constStrArgPrintValues("print-values")
+    , m_constStrArgName("name")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-list-children";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarListChildren::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarListChildren destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarListChildren::~CMICmdCmdVarListChildren(void)
+{
+    m_vecMiValueResult.clear();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarListChildren::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValNumber(m_constStrArgPrintValues, false, false)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarListChildren::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+    m_bValueValid = rValue.IsValid();
+    if (!m_bValueValid)
+        return MIstatus::success;
+
+    m_vecMiValueResult.clear();
+    m_nChildren = rValue.GetNumChildren();
+    for (MIuint i = 0; i < m_nChildren; i++)
+    {
+        lldb::SBValue member = rValue.GetChildAtIndex(i);
+        if (!member.IsValid())
+            continue;
+        const CMICmnLLDBUtilSBValue utilValue(member);
+        const CMIUtilString strExp = utilValue.GetName();
+        const CMIUtilString name(CMIUtilString::Format("%s.%s", rVarObjName.c_str(), strExp.c_str()));
+        const MIuint nChildren = member.GetNumChildren();
+        const CMIUtilString strThreadId(CMIUtilString::Format("%u", member.GetThread().GetIndexID()));
+
+        // Varobj gets added to CMICmnLLDBDebugSessionInfoVarObj static container of varObjs
+        CMICmnLLDBDebugSessionInfoVarObj var(strExp, name, member, rVarObjName);
+
+        // MI print "child={name=\"%s\",exp=\"%s\",numchild=\"%d\",value=\"%s\",type=\"%s\",thread-id=\"%u\",has_more=\"%u\"}"
+        const CMICmnMIValueConst miValueConst(name);
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        CMICmnMIValueTuple miValueTuple(miValueResult);
+        const CMICmnMIValueConst miValueConst2(strExp);
+        const CMICmnMIValueResult miValueResult2("exp", miValueConst2);
+        miValueTuple.Add(miValueResult2);
+        const CMIUtilString strNumChild(CMIUtilString::Format("%d", nChildren));
+        const CMICmnMIValueConst miValueConst3(strNumChild);
+        const CMICmnMIValueResult miValueResult3("numchild", miValueConst3);
+        miValueTuple.Add(miValueResult3);
+        const CMICmnMIValueConst miValueConst5(utilValue.GetTypeNameDisplay());
+        const CMICmnMIValueResult miValueResult5("type", miValueConst5);
+        miValueTuple.Add(miValueResult5);
+        const CMICmnMIValueConst miValueConst6(strThreadId);
+        const CMICmnMIValueResult miValueResult6("thread-id", miValueConst6);
+        miValueTuple.Add(miValueResult6);
+        const CMICmnMIValueConst miValueConst7("0");
+        const CMICmnMIValueResult miValueResult7("has_more", miValueConst7);
+        miValueTuple.Add(miValueResult7);
+        const CMICmnMIValueResult miValueResult8("child", miValueTuple);
+        m_vecMiValueResult.push_back(miValueResult8);
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarListChildren::Acknowledge(void)
+{
+    if (m_bValueValid)
+    {
+        // MI print "%s^done,numchild=\"%u\",children=[]""
+        const CMIUtilString strNumChild(CMIUtilString::Format("%u", m_nChildren));
+        const CMICmnMIValueConst miValueConst(strNumChild);
+        CMICmnMIValueResult miValueResult("numchild", miValueConst);
+
+        VecMIValueResult_t::const_iterator it = m_vecMiValueResult.begin();
+        if (it == m_vecMiValueResult.end())
+        {
+            const CMICmnMIValueConst miValueConst("[]");
+            miValueResult.Add("children", miValueConst);
+        }
+        else
+        {
+            CMICmnMIValueList miValueList(*it);
+            ++it;
+            while (it != m_vecMiValueResult.end())
+            {
+                const CMICmnMIValueResult &rResult(*it);
+                miValueList.Add(rResult);
+
+                // Next
+                ++it;
+            }
+            miValueResult.Add("children", miValueList);
+        }
+
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+        m_miResultRecord = miRecordResult;
+        return MIstatus::success;
+    }
+
+    // MI print "%s^done,numchild=\"0\""
+    const CMICmnMIValueConst miValueConst("0");
+    const CMICmnMIValueResult miValueResult("numchild", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarListChildren::CreateSelf(void)
+{
+    return new CMICmdCmdVarListChildren();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarEvaluateExpression constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarEvaluateExpression::CMICmdCmdVarEvaluateExpression(void)
+    : m_bValueValid(true)
+    , m_constStrArgFormatSpec("-f")
+    , m_constStrArgName("name")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-evaluate-expression";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarEvaluateExpression::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarEvaluateExpression destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarEvaluateExpression::~CMICmdCmdVarEvaluateExpression(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarEvaluateExpression::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(
+        *(new CMICmdArgValOptionShort(m_constStrArgFormatSpec, false, false, CMICmdArgValListBase::eArgValType_String, 1)));
+    bOk = bOk && m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarEvaluateExpression::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+    m_bValueValid = rValue.IsValid();
+    if (!m_bValueValid)
+        return MIstatus::success;
+
+    m_varObjName = rVarObjName;
+    varObj.UpdateValue();
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarEvaluateExpression::Acknowledge(void)
+{
+    if (m_bValueValid)
+    {
+        CMICmnLLDBDebugSessionInfoVarObj varObj;
+        CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(m_varObjName, varObj);
+        const CMICmnMIValueConst miValueConst(varObj.GetValueFormatted());
+        const CMICmnMIValueResult miValueResult("value", miValueConst);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+        m_miResultRecord = miRecordResult;
+        return MIstatus::success;
+    }
+
+    const CMICmnMIValueConst miValueConst("variable invalid");
+    const CMICmnMIValueResult miValueResult("msg", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
+    m_miResultRecord = miRecordResult;
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarEvaluateExpression::CreateSelf(void)
+{
+    return new CMICmdCmdVarEvaluateExpression();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarInfoPathExpression constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarInfoPathExpression::CMICmdCmdVarInfoPathExpression(void)
+    : m_bValueValid(true)
+    , m_constStrArgName("name")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-info-path-expression";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarInfoPathExpression::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarInfoPathExpression destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarInfoPathExpression::~CMICmdCmdVarInfoPathExpression(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarInfoPathExpression::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarInfoPathExpression::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(varObj.GetValue());
+    m_bValueValid = rValue.IsValid();
+    if (!m_bValueValid)
+        return MIstatus::success;
+
+    lldb::SBStream stream;
+    if (!rValue.GetExpressionPath(stream, true))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    const MIchar *pPathExpression = stream.GetData();
+    if (pPathExpression == nullptr)
+    {
+        // Build expression from what we do know
+        m_strPathExpression = varObj.GetNameReal();
+        return MIstatus::success;
+    }
+
+    // Has LLDB returned a var signature of it's own
+    if (pPathExpression[0] != '$')
+    {
+        m_strPathExpression = pPathExpression;
+        return MIstatus::success;
+    }
+
+    // Build expression from what we do know
+    const CMIUtilString &rVarParentName(varObj.GetVarParentName());
+    if (rVarParentName.empty())
+    {
+        m_strPathExpression = varObj.GetNameReal();
+    }
+    else
+    {
+        CMICmnLLDBDebugSessionInfoVarObj varObjParent;
+        if (!CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarParentName, varObjParent))
+        {
+            SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarParentName.c_str()));
+            return MIstatus::failure;
+        }
+        m_strPathExpression = CMIUtilString::Format("%s.%s", varObjParent.GetNameReal().c_str(), varObj.GetNameReal().c_str());
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarInfoPathExpression::Acknowledge(void)
+{
+    if (m_bValueValid)
+    {
+        const CMICmnMIValueConst miValueConst(m_strPathExpression);
+        const CMICmnMIValueResult miValueResult("path_expr", miValueConst);
+        const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+        m_miResultRecord = miRecordResult;
+        return MIstatus::success;
+    }
+
+    const CMICmnMIValueConst miValueConst("variable invalid");
+    const CMICmnMIValueResult miValueResult("msg", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error, miValueResult);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarInfoPathExpression::CreateSelf(void)
+{
+    return new CMICmdCmdVarInfoPathExpression();
+}
+
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarShowAttributes constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarShowAttributes::CMICmdCmdVarShowAttributes(void)
+    : m_constStrArgName("name")
+{
+    // Command factory matches this name with that received from the stdin stream
+    m_strMiCmd = "var-show-attributes";
+
+    // Required by the CMICmdFactory when registering *this command
+    m_pSelfCreatorFn = &CMICmdCmdVarShowAttributes::CreateSelf;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdCmdVarShowAttributes destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdCmdVarShowAttributes::~CMICmdCmdVarShowAttributes(void)
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The parses the command line options
+//          arguments to extract values for each of those arguments.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarShowAttributes::ParseArgs(void)
+{
+    bool bOk = m_setCmdArgs.Add(*(new CMICmdArgValString(m_constStrArgName, true, true)));
+    return (bOk && ParseValidateCmdOptions());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command does work in this function.
+//          The command is likely to communicate with the LLDB SBDebugger in here.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarShowAttributes::Execute(void)
+{
+    CMICMDBASE_GETOPTION(pArgName, String, m_constStrArgName);
+
+    const CMIUtilString &rVarObjName(pArgName->GetValue());
+    CMICmnLLDBDebugSessionInfoVarObj varObj;
+    if (CMICmnLLDBDebugSessionInfoVarObj::VarObjGet(rVarObjName, varObj))
+    {
+        SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_VARIABLE_DOESNOTEXIST), m_cmdData.strMiCmd.c_str(), rVarObjName.c_str()));
+        return MIstatus::failure;
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The invoker requires this function. The command prepares a MI Record Result
+//          for the work carried out in the Execute().
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdVarShowAttributes::Acknowledge(void)
+{
+    // MI output: "%s^done,status=\"editable\"]"
+    const CMICmnMIValueConst miValueConst("editable");
+    const CMICmnMIValueResult miValueResult("status", miValueConst);
+    const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
+    m_miResultRecord = miRecordResult;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdFactory when registering *this command. The factory
+//          calls this function to create an instance of *this command.
+// Type:    Static method.
+// Args:    None.
+// Return:  CMICmdBase * - Pointer to a new command.
+// Throws:  None.
+//--
+CMICmdBase *
+CMICmdCmdVarShowAttributes::CreateSelf(void)
+{
+    return new CMICmdCmdVarShowAttributes();
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdVar.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdVar.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdVar.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdVar.h Mon Nov 17 12:06:21 2014
@@ -8,32 +8,32 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdCmdVar.h
+// File:        MICmdCmdVar.h
 //
-// Overview:	CMICmdCmdVarCreate				interface.
-//				CMICmdCmdVarUpdate				interface.
-//				CMICmdCmdVarDelete				interface.
-//				CMICmdCmdVarAssign				interface.
-//				CMICmdCmdVarSetFormat			interface.
-//				CMICmdCmdVarListChildren		interface.
-//				CMICmdCmdVarEvaluateExpression	interface.
-//				CMICmdCmdVarInfoPathExpression	interface.
-//				CMICmdCmdVarShowAttributes		interface.
+// Overview:    CMICmdCmdVarCreate              interface.
+//              CMICmdCmdVarUpdate              interface.
+//              CMICmdCmdVarDelete              interface.
+//              CMICmdCmdVarAssign              interface.
+//              CMICmdCmdVarSetFormat           interface.
+//              CMICmdCmdVarListChildren        interface.
+//              CMICmdCmdVarEvaluateExpression  interface.
+//              CMICmdCmdVarInfoPathExpression  interface.
+//              CMICmdCmdVarShowAttributes      interface.
 //
-//				To implement new MI commands derive a new command class from the command base 
-//				class. To enable the new command for interpretation add the new command class
-//				to the command factory. The files of relevance are:
-//					MICmdCommands.cpp
-//					MICmdBase.h / .cpp
-//					MICmdCmd.h / .cpp
-//				For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
-//				command class as an example.
+//              To implement new MI commands derive a new command class from the command base
+//              class. To enable the new command for interpretation add the new command class
+//              to the command factory. The files of relevance are:
+//                  MICmdCommands.cpp
+//                  MICmdBase.h / .cpp
+//                  MICmdCmd.h / .cpp
+//              For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
+//              command class as an example.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -48,334 +48,333 @@
 class CMICmnLLDBDebugSessionInfoVarObj;
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-create".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-create".
+// Gotchas: None.
+// Authors: Illya Rudkin 24/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarCreate : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarCreate( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarCreate( void );
-
-// Attribute:
-private:
-	CMIUtilString		m_strVarName;
-	MIuint				m_nChildren;
-	MIuint64			m_nThreadId;
-	CMIUtilString		m_strType;
-	bool				m_bValid;						// True = Variable is valid, false = not valid		
-	CMIUtilString		m_strExpression;
-	CMIUtilString		m_strValue;
-	const CMIUtilString	m_constStrArgThread;			// Not specified in MI spec but Eclipse gives this option
-	const CMIUtilString	m_constStrArgThreadGroup;		// Not specified in MI spec but Eclipse gives this option
-	const CMIUtilString	m_constStrArgFrame;				// Not specified in MI spec but Eclipse gives this option
-	const CMIUtilString	m_constStrArgName;
-	const CMIUtilString	m_constStrArgFrameAddr;
-	const CMIUtilString	m_constStrArgExpression;	
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarCreate(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarCreate(void);
+
+    // Attribute:
+  private:
+    CMIUtilString m_strVarName;
+    MIuint m_nChildren;
+    MIuint64 m_nThreadId;
+    CMIUtilString m_strType;
+    bool m_bValid; // True = Variable is valid, false = not valid
+    CMIUtilString m_strExpression;
+    CMIUtilString m_strValue;
+    const CMIUtilString m_constStrArgThread;      // Not specified in MI spec but Eclipse gives this option
+    const CMIUtilString m_constStrArgThreadGroup; // Not specified in MI spec but Eclipse gives this option
+    const CMIUtilString m_constStrArgFrame;       // Not specified in MI spec but Eclipse gives this option
+    const CMIUtilString m_constStrArgName;
+    const CMIUtilString m_constStrArgFrameAddr;
+    const CMIUtilString m_constStrArgExpression;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-update".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 25/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-update".
+// Gotchas: None.
+// Authors: Illya Rudkin 25/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarUpdate : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarUpdate( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarUpdate( void );
-
-// Methods:
-private:
-	bool	ExamineSBValueForChange( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj, const bool vbIgnoreVarType, bool & vrwbChanged );
-	bool	MIFormResponse( const CMIUtilString & vrStrVarName, const CMIUtilString & vrStrValue, const CMIUtilString & vrStrScope );
-
-// Attribute:
-private:
-	CMIUtilString		m_strValueName;
-	const CMIUtilString	m_constStrArgPrintValues;		// Not handled by *this command
-	const CMIUtilString	m_constStrArgName;
-	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
-	CMICmnMIValueList	m_miValueList;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarUpdate(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarUpdate(void);
+
+    // Methods:
+  private:
+    bool ExamineSBValueForChange(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj, const bool vbIgnoreVarType, bool &vrwbChanged);
+    bool MIFormResponse(const CMIUtilString &vrStrVarName, const CMIUtilString &vrStrValue, const CMIUtilString &vrStrScope);
+
+    // Attribute:
+  private:
+    CMIUtilString m_strValueName;
+    const CMIUtilString m_constStrArgPrintValues; // Not handled by *this command
+    const CMIUtilString m_constStrArgName;
+    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
+    CMICmnMIValueList m_miValueList;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-delete".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 25/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-delete".
+// Gotchas: None.
+// Authors: Illya Rudkin 25/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarDelete : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarDelete( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarDelete( void );
-
-// Attribute:
-private:
-	const CMIUtilString	m_constStrArgName;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarDelete(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarDelete(void);
+
+    // Attribute:
+  private:
+    const CMIUtilString m_constStrArgName;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-assign".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 25/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-assign".
+// Gotchas: None.
+// Authors: Illya Rudkin 25/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarAssign : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarAssign( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarAssign( void );
-
-// Attributes:
-private:
-	bool				m_bOk;						// True = success, false = failure
-	CMIUtilString		m_varObjName;
-	const CMIUtilString	m_constStrArgName;
-	const CMIUtilString	m_constStrArgExpression;	
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarAssign(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarAssign(void);
+
+    // Attributes:
+  private:
+    bool m_bOk; // True = success, false = failure
+    CMIUtilString m_varObjName;
+    const CMIUtilString m_constStrArgName;
+    const CMIUtilString m_constStrArgExpression;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-set-format".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 26/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-set-format".
+// Gotchas: None.
+// Authors: Illya Rudkin 26/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarSetFormat : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarSetFormat( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarSetFormat( void );
-
-// Attributes:
-private:
-	CMIUtilString		m_varObjName;
-	const CMIUtilString	m_constStrArgName;
-	const CMIUtilString	m_constStrArgFormatSpec;	
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarSetFormat(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarSetFormat(void);
+
+    // Attributes:
+  private:
+    CMIUtilString m_varObjName;
+    const CMIUtilString m_constStrArgName;
+    const CMIUtilString m_constStrArgFormatSpec;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-list-children".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 26/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-list-children".
+// Gotchas: None.
+// Authors: Illya Rudkin 26/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarListChildren : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarListChildren( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarListChildren( void );
-
-// Typedefs:
-private:
-	typedef std::vector< CMICmnMIValueResult >	VecMIValueResult_t;
-
-// Attributes:
-private:
-	bool				m_bValueValid;				// True = yes SBValue object is valid, false = not valid
-	VecMIValueResult_t	m_vecMiValueResult;
-	MIuint				m_nChildren;
-	const CMIUtilString	m_constStrArgPrintValues;	// Not handled by *this command
-	const CMIUtilString	m_constStrArgName;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarListChildren(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarListChildren(void);
+
+    // Typedefs:
+  private:
+    typedef std::vector<CMICmnMIValueResult> VecMIValueResult_t;
+
+    // Attributes:
+  private:
+    bool m_bValueValid; // True = yes SBValue object is valid, false = not valid
+    VecMIValueResult_t m_vecMiValueResult;
+    MIuint m_nChildren;
+    const CMIUtilString m_constStrArgPrintValues; // Not handled by *this command
+    const CMIUtilString m_constStrArgName;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-evaluate-expression".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 26/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-evaluate-expression".
+// Gotchas: None.
+// Authors: Illya Rudkin 26/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarEvaluateExpression : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarEvaluateExpression( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarEvaluateExpression( void );
-
-// Attributes:
-private:
-	bool				m_bValueValid;				// True = yes SBValue object is valid, false = not valid
-	CMIUtilString		m_varObjName;
-	const CMIUtilString	m_constStrArgFormatSpec;	// Not handled by *this command
-	const CMIUtilString	m_constStrArgName;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarEvaluateExpression(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarEvaluateExpression(void);
+
+    // Attributes:
+  private:
+    bool m_bValueValid; // True = yes SBValue object is valid, false = not valid
+    CMIUtilString m_varObjName;
+    const CMIUtilString m_constStrArgFormatSpec; // Not handled by *this command
+    const CMIUtilString m_constStrArgName;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-info-path-expression".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 26/03/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-info-path-expression".
+// Gotchas: None.
+// Authors: Illya Rudkin 26/03/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarInfoPathExpression : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarInfoPathExpression( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarInfoPathExpression( void );
-
-// Attributes:
-private:
-	bool				m_bValueValid;			// True = yes SBValue object is valid, false = not valid
-	CMIUtilString		m_strPathExpression;
-	const CMIUtilString	m_constStrArgName;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarInfoPathExpression(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarInfoPathExpression(void);
+
+    // Attributes:
+  private:
+    bool m_bValueValid; // True = yes SBValue object is valid, false = not valid
+    CMIUtilString m_strPathExpression;
+    const CMIUtilString m_constStrArgName;
 };
 
 //++ ============================================================================
-// Details:	MI command class. MI commands derived from the command base class.
-//			*this class implements MI command "var-show-attributes".
-// Gotchas:	None.
-// Authors:	Illya Rudkin 19/05/2014.
-// Changes:	None.
+// Details: MI command class. MI commands derived from the command base class.
+//          *this class implements MI command "var-show-attributes".
+// Gotchas: None.
+// Authors: Illya Rudkin 19/05/2014.
+// Changes: None.
 //--
 class CMICmdCmdVarShowAttributes : public CMICmdBase
 {
-// Statics:
-public:
-	// Required by the CMICmdFactory when registering *this command
-	static CMICmdBase *	CreateSelf( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmdCmdVarShowAttributes( void );
-
-// Overridden:
-public:
-	// From CMICmdInvoker::ICmd
-	virtual bool	Execute( void );
-	virtual bool	Acknowledge( void );
-	virtual bool	ParseArgs( void );
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdCmdVarShowAttributes( void );
-
-// Attributes:
-private:
-	const CMIUtilString	m_constStrArgName;
+    // Statics:
+  public:
+    // Required by the CMICmdFactory when registering *this command
+    static CMICmdBase *CreateSelf(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmdCmdVarShowAttributes(void);
+
+    // Overridden:
+  public:
+    // From CMICmdInvoker::ICmd
+    virtual bool Execute(void);
+    virtual bool Acknowledge(void);
+    virtual bool ParseArgs(void);
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdCmdVarShowAttributes(void);
+
+    // Attributes:
+  private:
+    const CMIUtilString m_constStrArgName;
 };
-

Modified: lldb/trunk/tools/lldb-mi/MICmdCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCommands.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCommands.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCommands.cpp Mon Nov 17 12:06:21 2014
@@ -8,22 +8,22 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdCommands.cpp
+// File:        MICmdCommands.cpp
 //
-// Overview:	MI command are registered with the MI command factory.
+// Overview:    MI command are registered with the MI command factory.
 //
-//				To implement new MI commands derive a new command class from the command base 
-//				class. To enable the new command for interpretation add the new command class
-//				to the command factory. The files of relevance are:
-//					MICmdCommands.cpp
-//					MICmdBase.h / .cpp
-//					MICmdCmd.h / .cpp
+//              To implement new MI commands derive a new command class from the command base
+//              class. To enable the new command for interpretation add the new command class
+//              to the command factory. The files of relevance are:
+//                  MICmdCommands.cpp
+//                  MICmdBase.h / .cpp
+//                  MICmdCmd.h / .cpp
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -49,87 +49,88 @@
 
 namespace MICmnCommands
 {
-	template< typename T >
-	static bool Register( void );
+template <typename T> static bool Register(void);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Command to command factory registration function. 
-// Type:	Template function.
-// Args:	typename T	- A command type class.
-// Return:	bool  - True = yes command is registered, false = command failed to register.
-// Throws:	None.
+// Details: Command to command factory registration function.
+// Type:    Template function.
+// Args:    typename T  - A command type class.
+// Return:  bool  - True = yes command is registered, false = command failed to register.
+// Throws:  None.
 //--
-template< typename T >											
-static bool MICmnCommands::Register( void  )								
-{																	
-	static CMICmdFactory & rCmdFactory = CMICmdFactory::Instance();
-	const CMIUtilString strMiCmd = T().GetMiCmd();				
-	CMICmdFactory::CmdCreatorFnPtr fn = T().GetCmdCreatorFn();	
-	return rCmdFactory.CmdRegister( strMiCmd, fn );				
-}																	
+template <typename T>
+static bool
+MICmnCommands::Register(void)
+{
+    static CMICmdFactory &rCmdFactory = CMICmdFactory::Instance();
+    const CMIUtilString strMiCmd = T().GetMiCmd();
+    CMICmdFactory::CmdCreatorFnPtr fn = T().GetCmdCreatorFn();
+    return rCmdFactory.CmdRegister(strMiCmd, fn);
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Register commands with MI command factory
-// Type:	Function.
-// Args:	None.
-// Return:	bool  - True = yes all commands are registered, 
-//					false = one or more commands failed to register.
-// Throws:	None.
+// Details: Register commands with MI command factory
+// Type:    Function.
+// Args:    None.
+// Return:  bool  - True = yes all commands are registered,
+//                  false = one or more commands failed to register.
+// Throws:  None.
 //--
-bool MICmnCommands::RegisterAll( void )
+bool
+MICmnCommands::RegisterAll(void)
 {
-	bool bOk = MIstatus::success;
+    bool bOk = MIstatus::success;
 
-	bOk &= Register< CMICmdCmdSupportInfoMiCmdQuery >();
-	bOk &= Register< CMICmdCmdBreakAfter >();
-	bOk &= Register< CMICmdCmdBreakCondition >();
-	bOk &= Register< CMICmdCmdBreakDelete >();
-	bOk &= Register< CMICmdCmdBreakDisable >();
-	bOk &= Register< CMICmdCmdBreakEnable >();
-	bOk &= Register< CMICmdCmdBreakInsert >();
-	bOk &= Register< CMICmdCmdDataDisassemble >();
-	bOk &= Register< CMICmdCmdDataEvaluateExpression >();
-	bOk &= Register< CMICmdCmdDataReadMemoryBytes >();
-	bOk &= Register< CMICmdCmdDataReadMemory >();
-	bOk &= Register< CMICmdCmdDataListRegisterNames >();
-	bOk &= Register< CMICmdCmdDataListRegisterValues >();
-	bOk &= Register< CMICmdCmdDataWriteMemory >();
-	bOk &= Register< CMICmdCmdEnablePrettyPrinting >();
-	bOk &= Register< CMICmdCmdEnvironmentCd >();
-	bOk &= Register< CMICmdCmdExecContinue >();
-	bOk &= Register< CMICmdCmdExecInterrupt >();
-	bOk &= Register< CMICmdCmdExecFinish >();
-	bOk &= Register< CMICmdCmdExecNext >();
-	bOk &= Register< CMICmdCmdExecNextInstruction >();
-	bOk &= Register< CMICmdCmdExecRun >();
-	bOk &= Register< CMICmdCmdExecStep >();
-	bOk &= Register< CMICmdCmdExecStepInstruction >();
-	bOk &= Register< CMICmdCmdFileExecAndSymbols >();
-	bOk &= Register< CMICmdCmdGdbExit >();
-	bOk &= Register< CMICmdCmdGdbInfo >();
-	bOk &= Register< CMICmdCmdGdbSet >();
-	bOk &= Register< CMICmdCmdGdbThread >();
-	bOk &= Register< CMICmdCmdInferiorTtySet >();
-	bOk &= Register< CMICmdCmdInterpreterExec >();
-	bOk &= Register< CMICmdCmdListThreadGroups >();
-	bOk &= Register< CMICmdCmdSource >();
-	bOk &= Register< CMICmdCmdStackInfoDepth >();
-	bOk &= Register< CMICmdCmdStackListFrames >();
-	bOk &= Register< CMICmdCmdStackListArguments >();
-	bOk &= Register< CMICmdCmdStackListLocals >();
-	bOk &= Register< CMICmdCmdSupportListFeatures >();
-	bOk &= Register< CMICmdCmdTargetSelect >();
-	bOk &= Register< CMICmdCmdThreadInfo >();
-	bOk &= Register< CMICmdCmdVarAssign >();
-	bOk &= Register< CMICmdCmdVarCreate >();
-	bOk &= Register< CMICmdCmdVarDelete >();
-	bOk &= Register< CMICmdCmdVarEvaluateExpression >();
-	bOk &= Register< CMICmdCmdVarInfoPathExpression >();
-	bOk &= Register< CMICmdCmdVarListChildren >();
-	bOk &= Register< CMICmdCmdVarSetFormat >();
-	bOk &= Register< CMICmdCmdVarShowAttributes >();
-	bOk &= Register< CMICmdCmdVarUpdate >();
+    bOk &= Register<CMICmdCmdSupportInfoMiCmdQuery>();
+    bOk &= Register<CMICmdCmdBreakAfter>();
+    bOk &= Register<CMICmdCmdBreakCondition>();
+    bOk &= Register<CMICmdCmdBreakDelete>();
+    bOk &= Register<CMICmdCmdBreakDisable>();
+    bOk &= Register<CMICmdCmdBreakEnable>();
+    bOk &= Register<CMICmdCmdBreakInsert>();
+    bOk &= Register<CMICmdCmdDataDisassemble>();
+    bOk &= Register<CMICmdCmdDataEvaluateExpression>();
+    bOk &= Register<CMICmdCmdDataReadMemoryBytes>();
+    bOk &= Register<CMICmdCmdDataReadMemory>();
+    bOk &= Register<CMICmdCmdDataListRegisterNames>();
+    bOk &= Register<CMICmdCmdDataListRegisterValues>();
+    bOk &= Register<CMICmdCmdDataWriteMemory>();
+    bOk &= Register<CMICmdCmdEnablePrettyPrinting>();
+    bOk &= Register<CMICmdCmdEnvironmentCd>();
+    bOk &= Register<CMICmdCmdExecContinue>();
+    bOk &= Register<CMICmdCmdExecInterrupt>();
+    bOk &= Register<CMICmdCmdExecFinish>();
+    bOk &= Register<CMICmdCmdExecNext>();
+    bOk &= Register<CMICmdCmdExecNextInstruction>();
+    bOk &= Register<CMICmdCmdExecRun>();
+    bOk &= Register<CMICmdCmdExecStep>();
+    bOk &= Register<CMICmdCmdExecStepInstruction>();
+    bOk &= Register<CMICmdCmdFileExecAndSymbols>();
+    bOk &= Register<CMICmdCmdGdbExit>();
+    bOk &= Register<CMICmdCmdGdbInfo>();
+    bOk &= Register<CMICmdCmdGdbSet>();
+    bOk &= Register<CMICmdCmdGdbThread>();
+    bOk &= Register<CMICmdCmdInferiorTtySet>();
+    bOk &= Register<CMICmdCmdInterpreterExec>();
+    bOk &= Register<CMICmdCmdListThreadGroups>();
+    bOk &= Register<CMICmdCmdSource>();
+    bOk &= Register<CMICmdCmdStackInfoDepth>();
+    bOk &= Register<CMICmdCmdStackListFrames>();
+    bOk &= Register<CMICmdCmdStackListArguments>();
+    bOk &= Register<CMICmdCmdStackListLocals>();
+    bOk &= Register<CMICmdCmdSupportListFeatures>();
+    bOk &= Register<CMICmdCmdTargetSelect>();
+    bOk &= Register<CMICmdCmdThreadInfo>();
+    bOk &= Register<CMICmdCmdVarAssign>();
+    bOk &= Register<CMICmdCmdVarCreate>();
+    bOk &= Register<CMICmdCmdVarDelete>();
+    bOk &= Register<CMICmdCmdVarEvaluateExpression>();
+    bOk &= Register<CMICmdCmdVarInfoPathExpression>();
+    bOk &= Register<CMICmdCmdVarListChildren>();
+    bOk &= Register<CMICmdCmdVarSetFormat>();
+    bOk &= Register<CMICmdCmdVarShowAttributes>();
+    bOk &= Register<CMICmdCmdVarUpdate>();
 
-	return bOk;
+    return bOk;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdCommands.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCommands.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCommands.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCommands.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdCommands.h
+// File:        MICmdCommands.h
 //
-// Overview:	CMICmdCommands instantiated.
+// Overview:    CMICmdCommands instantiated.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,12 +25,11 @@ namespace MICmnCommands
 {
 
 //++ ============================================================================
-// Details:	MI Command are instantiated and registered automatically with the
-//			Command Factory
-// Gotchas:	None.
-// Authors:	Illya Rudkin 18/02/2014.
-// Changes:	None.
+// Details: MI Command are instantiated and registered automatically with the
+//          Command Factory
+// Gotchas: None.
+// Authors: Illya Rudkin 18/02/2014.
+// Changes: None.
 //--
-bool RegisterAll( void );
-
+bool RegisterAll(void);
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdData.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdData.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdData.cpp Mon Nov 17 12:06:21 2014
@@ -8,17 +8,16 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdData.cpp
+// File:        MICmdData.cpp
 //
-// Overview:	SMICmdData implementation.
+// Overview:    SMICmdData implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
 #include "MICmdData.h"
-

Modified: lldb/trunk/tools/lldb-mi/MICmdData.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdData.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdData.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdData.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdData.h
+// File:        MICmdData.h
 //
-// Overview:	SMICmdData interface.
+// Overview:    SMICmdData interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,50 +25,49 @@
 #include "MICmnResources.h"
 
 //++ ============================================================================
-// Details:	MI command metadata. Holds the command's name, MI number and options
-//			as found on stdin. Holds the command's MI output (written to stdout).
-// Gotchas:	None.
-// Authors:	Illya Rudkin 18/02/2014.
-// Changes:	None.
+// Details: MI command metadata. Holds the command's name, MI number and options
+//          as found on stdin. Holds the command's MI output (written to stdout).
+// Gotchas: None.
+// Authors: Illya Rudkin 18/02/2014.
+// Changes: None.
 //--
 struct SMICmdData
 {
-	SMICmdData( void )
-	:	id( 0 )
-	,	bCmdValid( false )
-	,	bCmdExecutedSuccessfully( false )
-	,	bMIOldStyle( false )
-	,	bHasResultRecordExtra( false )
-	{
-	};
-
-	MIuint			id;								// A command's unique ID i.e. GUID
-	CMIUtilString	strMiCmdToken;					// The command's MI token (a number)	
-	CMIUtilString	strMiCmd;						// The command's name 
-	CMIUtilString	strMiCmdOption;					// The command's arguments or options
-	CMIUtilString	strMiCmdAll;					// The text as received from the client
-	CMIUtilString	strMiCmdResultRecord;			// Each command forms 1 response to its input
-	CMIUtilString	strMiCmdResultRecordExtra;		// Hack command produce more response text to help the client because of using LLDB 
-	bool			bCmdValid;						// True = Valid MI format command, false = invalid
-	bool			bCmdExecutedSuccessfully;		// True = Command finished successfully, false = Did not start/did not complete
-	CMIUtilString	strErrorDescription;			// Command failed this is why
-	bool			bMIOldStyle;					// True = format "3thread", false = format "3-thread"
-	bool			bHasResultRecordExtra;			// True = Yes command produced additional MI output to its 1 line response, false = no extra MI output formed
-
-	void Clear( void )
-	{
-		id = 0;
-		strMiCmdToken.clear();		
-		strMiCmd = MIRSRC( IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION );			
-		strMiCmdOption.clear();	
-		strMiCmdAll.clear();		
-		strMiCmdResultRecord.clear();
-		strMiCmdResultRecordExtra.clear();
-		bCmdValid = false;
-		bCmdExecutedSuccessfully = false;
-		strErrorDescription.clear();
-		bMIOldStyle = false;
-		bHasResultRecordExtra = false;
-	}
+    SMICmdData(void)
+        : id(0)
+        , bCmdValid(false)
+        , bCmdExecutedSuccessfully(false)
+        , bMIOldStyle(false)
+        , bHasResultRecordExtra(false){};
+
+    MIuint id;                               // A command's unique ID i.e. GUID
+    CMIUtilString strMiCmdToken;             // The command's MI token (a number)
+    CMIUtilString strMiCmd;                  // The command's name
+    CMIUtilString strMiCmdOption;            // The command's arguments or options
+    CMIUtilString strMiCmdAll;               // The text as received from the client
+    CMIUtilString strMiCmdResultRecord;      // Each command forms 1 response to its input
+    CMIUtilString strMiCmdResultRecordExtra; // Hack command produce more response text to help the client because of using LLDB
+    bool bCmdValid;                          // True = Valid MI format command, false = invalid
+    bool bCmdExecutedSuccessfully;           // True = Command finished successfully, false = Did not start/did not complete
+    CMIUtilString strErrorDescription;       // Command failed this is why
+    bool bMIOldStyle;                        // True = format "3thread", false = format "3-thread"
+    bool
+        bHasResultRecordExtra; // True = Yes command produced additional MI output to its 1 line response, false = no extra MI output formed
+
+    void
+    Clear(void)
+    {
+        id = 0;
+        strMiCmdToken.clear();
+        strMiCmd = MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION);
+        strMiCmdOption.clear();
+        strMiCmdAll.clear();
+        strMiCmdResultRecord.clear();
+        strMiCmdResultRecordExtra.clear();
+        bCmdValid = false;
+        bCmdExecutedSuccessfully = false;
+        strErrorDescription.clear();
+        bMIOldStyle = false;
+        bHasResultRecordExtra = false;
+    }
 };
-

Modified: lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdFactory.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdFactory.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdFactory.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdFactory.cpp
+// File:        MICmdFactory.cpp
 //
-// Overview:	CMICmdFactory implementation.
+// Overview:    CMICmdFactory implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -27,203 +27,211 @@
 #include "MICmdCommands.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdFactory constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmdFactory constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmdFactory::CMICmdFactory( void )
+CMICmdFactory::CMICmdFactory(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdFactory destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmdFactory destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmdFactory::~CMICmdFactory( void )
+CMICmdFactory::~CMICmdFactory(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Command factory.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Initialize resources for *this Command factory.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmdFactory::Initialize( void )
+bool
+CMICmdFactory::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = true;
+    m_bInitialized = true;
 
-	MICmnCommands::RegisterAll();
+    MICmnCommands::RegisterAll();
 
-	return  MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Command Factory.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Release resources for *this Command Factory.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmdFactory::Shutdown( void )
+bool
+CMICmdFactory::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
 
-	m_mapMiCmdToCmdCreatorFn.clear();
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    m_mapMiCmdToCmdCreatorFn.clear();
 
-	return MIstatus::success;
-}	
+    m_bInitialized = false;
+
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Register a command's creator function with the command identitier the MI
-//			command name i.e. 'file-exec-and-symbols'.
-// Type:	Method.
-// Args:	vMiCmd			- (R) Command's name, the MI command.
-//			vCmdCreateFn	- (R) Command's creator function pointer.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Register a command's creator function with the command identitier the MI
+//          command name i.e. 'file-exec-and-symbols'.
+// Type:    Method.
+// Args:    vMiCmd          - (R) Command's name, the MI command.
+//          vCmdCreateFn    - (R) Command's creator function pointer.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmdFactory::CmdRegister( const CMIUtilString & vMiCmd, CmdCreatorFnPtr vCmdCreateFn )
+bool
+CMICmdFactory::CmdRegister(const CMIUtilString &vMiCmd, CmdCreatorFnPtr vCmdCreateFn)
 {
-	if( !IsValid( vMiCmd ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_INVALID_CMD_NAME ), vMiCmd.c_str() ) );
-		return MIstatus::failure;
-	}
-	if( vCmdCreateFn == nullptr )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN ), vMiCmd.c_str() ) );
-		return MIstatus::failure;
-	}
+    if (!IsValid(vMiCmd))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_INVALID_CMD_NAME), vMiCmd.c_str()));
+        return MIstatus::failure;
+    }
+    if (vCmdCreateFn == nullptr)
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN), vMiCmd.c_str()));
+        return MIstatus::failure;
+    }
 
-	if( HaveAlready( vMiCmd ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED ), vMiCmd.c_str() ) );
-		return MIstatus::failure;
-	}
+    if (HaveAlready(vMiCmd))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED), vMiCmd.c_str()));
+        return MIstatus::failure;
+    }
 
-	MapPairMiCmdToCmdCreatorFn_t pr( vMiCmd, vCmdCreateFn );
-	m_mapMiCmdToCmdCreatorFn.insert( pr );
+    MapPairMiCmdToCmdCreatorFn_t pr(vMiCmd, vCmdCreateFn);
+    m_mapMiCmdToCmdCreatorFn.insert(pr);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Check a command is already registered.
-// Type:	Method.
-// Args:	vMiCmd	- (R) Command's name, the MI command.
-// Return:	True - registered.
-//			False - not found.
-// Throws:	None.
+// Details: Check a command is already registered.
+// Type:    Method.
+// Args:    vMiCmd  - (R) Command's name, the MI command.
+// Return:  True - registered.
+//          False - not found.
+// Throws:  None.
 //--
-bool CMICmdFactory::HaveAlready( const CMIUtilString & vMiCmd ) const
+bool
+CMICmdFactory::HaveAlready(const CMIUtilString &vMiCmd) const
 {
-	const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find( vMiCmd );
-	if( it != m_mapMiCmdToCmdCreatorFn.end() )
-		return true;
-	
-	return false;
+    const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find(vMiCmd);
+    if (it != m_mapMiCmdToCmdCreatorFn.end())
+        return true;
+
+    return false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Check a command's name is valid:
-//				- name is not empty
-//				- name does not have spaces
-// Type:	Method.
-// Args:	vMiCmd	- (R) Command's name, the MI command.
-// Return:	True - valid.
-//			False - not valid.
-// Throws:	None.
+// Details: Check a command's name is valid:
+//              - name is not empty
+//              - name does not have spaces
+// Type:    Method.
+// Args:    vMiCmd  - (R) Command's name, the MI command.
+// Return:  True - valid.
+//          False - not valid.
+// Throws:  None.
 //--
-bool CMICmdFactory::IsValid( const CMIUtilString & vMiCmd ) const
+bool
+CMICmdFactory::IsValid(const CMIUtilString &vMiCmd) const
 {
-	bool bValid = true;
+    bool bValid = true;
+
+    if (vMiCmd.empty())
+    {
+        bValid = false;
+        return false;
+    }
 
-	if( vMiCmd.empty() )
-	{
-		bValid = false;
-		return false;
-	}
+    const MIint nPos = vMiCmd.find(" ");
+    if (nPos != (MIint)std::string::npos)
+        bValid = false;
 
-	const MIint nPos = vMiCmd.find( " " );
-	if( nPos != (MIint) std::string::npos )
-		bValid = false;
-	
-	return bValid;
+    return bValid;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Check a command is already registered.
-// Type:	Method.
-// Args:	vMiCmd	- (R) Command's name, the MI command.
-// Return:	True - registered.
-//			False - not found.
-// Throws:	None.
+// Details: Check a command is already registered.
+// Type:    Method.
+// Args:    vMiCmd  - (R) Command's name, the MI command.
+// Return:  True - registered.
+//          False - not found.
+// Throws:  None.
 //--
-bool CMICmdFactory::CmdExist( const CMIUtilString & vMiCmd ) const
+bool
+CMICmdFactory::CmdExist(const CMIUtilString &vMiCmd) const
 {
-	return HaveAlready( vMiCmd );
+    return HaveAlready(vMiCmd);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Create a command given the specified MI command name. The command data object
-//			contains the options for the command.
-// Type:	Method.
-// Args:	vMiCmd		- (R) Command's name, the MI command.
-//			vCmdData	- (RW) Command's metadata status/information/result object.		
-//			vpNewCmd	- (W) New command instance.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Create a command given the specified MI command name. The command data object
+//          contains the options for the command.
+// Type:    Method.
+// Args:    vMiCmd      - (R) Command's name, the MI command.
+//          vCmdData    - (RW) Command's metadata status/information/result object.
+//          vpNewCmd    - (W) New command instance.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmdFactory::CmdCreate( const CMIUtilString & vMiCmd, const SMICmdData & vCmdData, CMICmdBase *& vpNewCmd )
+bool
+CMICmdFactory::CmdCreate(const CMIUtilString &vMiCmd, const SMICmdData &vCmdData, CMICmdBase *&vpNewCmd)
 {
-	bool bOk = MIstatus::success;
+    bool bOk = MIstatus::success;
 
-	vpNewCmd = nullptr;
+    vpNewCmd = nullptr;
 
-	if( !IsValid( vMiCmd ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_INVALID_CMD_NAME ), vMiCmd.c_str() ) );
-		return MIstatus::failure;
-	}
-	if( !HaveAlready( vMiCmd ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED ), vMiCmd.c_str() ) );
-		return MIstatus::failure;
-	}
+    if (!IsValid(vMiCmd))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_INVALID_CMD_NAME), vMiCmd.c_str()));
+        return MIstatus::failure;
+    }
+    if (!HaveAlready(vMiCmd))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED), vMiCmd.c_str()));
+        return MIstatus::failure;
+    }
 
-	const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find( vMiCmd );
-	const CMIUtilString & rMiCmd( (*it).first ); MIunused( rMiCmd );
-	CmdCreatorFnPtr pFn = (*it).second;
-	CMICmdBase * pCmd = (*pFn)();
+    const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find(vMiCmd);
+    const CMIUtilString &rMiCmd((*it).first);
+    MIunused(rMiCmd);
+    CmdCreatorFnPtr pFn = (*it).second;
+    CMICmdBase *pCmd = (*pFn)();
 
-	SMICmdData cmdData( vCmdData );
-	cmdData.id = pCmd->GetGUID();
-	bOk = pCmd->SetCmdData( cmdData );
-	if( bOk )
-		vpNewCmd = pCmd;
+    SMICmdData cmdData(vCmdData);
+    cmdData.id = pCmd->GetGUID();
+    bOk = pCmd->SetCmdData(cmdData);
+    if (bOk)
+        vpNewCmd = pCmd;
 
-	return bOk;
+    return bOk;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdFactory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdFactory.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdFactory.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdFactory.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdFactory.h
+// File:        MICmdFactory.h
 //
-// Overview:	CMICmdFactory interface.
+// Overview:    CMICmdFactory interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -33,67 +33,66 @@ class CMICmdBase;
 struct SMICmdData;
 
 //++ ============================================================================
-// Details:	MI Command Factory. Holds a list of registered MI commands that 
-//			MI application understands to interpret. Creates commands objects.
-//			The Command Factory is carried out in the main thread.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 19/02/2014.
-// Changes:	None.
+// Details: MI Command Factory. Holds a list of registered MI commands that
+//          MI application understands to interpret. Creates commands objects.
+//          The Command Factory is carried out in the main thread.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 19/02/2014.
+// Changes: None.
 //--
-class CMICmdFactory
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmdFactory >
+class CMICmdFactory : public CMICmnBase, public MI::ISingleton<CMICmdFactory>
 {
-	friend class MI::ISingleton< CMICmdFactory >;
+    friend class MI::ISingleton<CMICmdFactory>;
 
-// Typedefs:
-public:
-	typedef CMICmdBase * (*CmdCreatorFnPtr)( void );
-
-// Class:
-public:
-	//++
-	// Description: Command's factory's interface for commands to implement.
-	//--
-	class ICmd
-	{
-	public:
-		virtual const CMIUtilString &	GetMiCmd( void ) const = 0;
-		virtual CmdCreatorFnPtr			GetCmdCreatorFn( void ) const = 0;
-		//virtual CMICmdBase *			CreateSelf( void ) = 0;				// Not possible as require a static creator function in the command class, here for awareness
-
-		/* dtor */ virtual ~ICmd( void ) {};
-	};
-
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	bool	CmdRegister( const CMIUtilString & vMiCmd, CmdCreatorFnPtr vCmdCreateFn );
-	bool	CmdCreate( const CMIUtilString & vMiCmd, const SMICmdData & vCmdData, CMICmdBase *& vpNewCmd );
-	bool	CmdExist( const CMIUtilString & vMiCmd ) const;
-
-// Methods:
-private:
-	/* ctor */	CMICmdFactory( void );
-	/* ctor */	CMICmdFactory( const CMICmdFactory & );
-	void		operator=( const CMICmdFactory & );
-	
-	bool	HaveAlready( const CMIUtilString & vMiCmd ) const;
-	bool	IsValid( const CMIUtilString & vMiCmd ) const;
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdFactory( void );
-
-// Typedefs:
-private:
-	typedef std::map< CMIUtilString, CmdCreatorFnPtr >	MapMiCmdToCmdCreatorFn_t;
-	typedef std::pair< CMIUtilString, CmdCreatorFnPtr >	MapPairMiCmdToCmdCreatorFn_t;
-
-// Attributes:
-private:
-	MapMiCmdToCmdCreatorFn_t	m_mapMiCmdToCmdCreatorFn;
+    // Typedefs:
+  public:
+    typedef CMICmdBase *(*CmdCreatorFnPtr)(void);
+
+    // Class:
+  public:
+    //++
+    // Description: Command's factory's interface for commands to implement.
+    //--
+    class ICmd
+    {
+      public:
+        virtual const CMIUtilString &GetMiCmd(void) const = 0;
+        virtual CmdCreatorFnPtr GetCmdCreatorFn(void) const = 0;
+        // virtual CMICmdBase *         CreateSelf( void ) = 0;             // Not possible as require a static creator
+        // function in the command class, here for awareness
+
+        /* dtor */ virtual ~ICmd(void){};
+    };
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    bool CmdRegister(const CMIUtilString &vMiCmd, CmdCreatorFnPtr vCmdCreateFn);
+    bool CmdCreate(const CMIUtilString &vMiCmd, const SMICmdData &vCmdData, CMICmdBase *&vpNewCmd);
+    bool CmdExist(const CMIUtilString &vMiCmd) const;
+
+    // Methods:
+  private:
+    /* ctor */ CMICmdFactory(void);
+    /* ctor */ CMICmdFactory(const CMICmdFactory &);
+    void operator=(const CMICmdFactory &);
+
+    bool HaveAlready(const CMIUtilString &vMiCmd) const;
+    bool IsValid(const CMIUtilString &vMiCmd) const;
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdFactory(void);
+
+    // Typedefs:
+  private:
+    typedef std::map<CMIUtilString, CmdCreatorFnPtr> MapMiCmdToCmdCreatorFn_t;
+    typedef std::pair<CMIUtilString, CmdCreatorFnPtr> MapPairMiCmdToCmdCreatorFn_t;
+
+    // Attributes:
+  private:
+    MapMiCmdToCmdCreatorFn_t m_mapMiCmdToCmdCreatorFn;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdInterpreter.cpp
+// File:        MICmdInterpreter.cpp
 //
-// Overview:	CMICmdInterpreter implementation.
+// Overview:    CMICmdInterpreter implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,278 +24,286 @@
 #include "MICmdFactory.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdInterpreter constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmdInterpreter constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmdInterpreter::CMICmdInterpreter( void )
-:	m_rCmdFactory( CMICmdFactory::Instance() )
+CMICmdInterpreter::CMICmdInterpreter(void)
+    : m_rCmdFactory(CMICmdFactory::Instance())
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdInterpreter destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmdInterpreter destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmdInterpreter::~CMICmdInterpreter( void )
+CMICmdInterpreter::~CMICmdInterpreter(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Command Interpreter.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize resources for *this Command Interpreter.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmdInterpreter::Initialize( void )
+bool
+CMICmdInterpreter::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = true;
+    m_bInitialized = true;
 
-	return  MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Command Interpreter.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this Command Interpreter.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmdInterpreter::Shutdown( void )
+bool
+CMICmdInterpreter::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	return MIstatus::success;
-}	
+    m_bInitialized = false;
 
-//++ ------------------------------------------------------------------------------------
-// Details:	Establish whether the text data is an MI format type command.
-// Type:	Method.
-// Args:	vTextLine				- (R) Text data to interpret.
-//			vwbYesValid				- (W) True = MI type command, false = not recognised.
-//			vwbCmdNotInCmdFactor	- (W) True = MI command not found in the command factory, false = recognised.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdInterpreter::ValidateIsMi( const CMIUtilString & vTextLine, bool & vwbYesValid, bool & vwbCmdNotInCmdFactor, SMICmdData & rwCmdData )
-{
-	vwbYesValid = false;
-	vwbCmdNotInCmdFactor = false;
-	rwCmdData.Clear();
-
-	if( vTextLine.empty() )
-		return MIstatus::success;
-
-	// MI format is [cmd #]-[command name]<space>[command arg(s)]
-	// i.e. 1-file-exec-and-symbols --thread-group i1 DEVICE_EXECUTABLE
-	//		5-data-evaluate-expression --thread 1 --frame 0 *(argv)
-
-	m_miCmdData.Clear();			
-	m_miCmdData.strMiCmd = vTextLine;
+    return MIstatus::success;
+}
 
-	// The following change m_miCmdData as valid parts are indentified
-	vwbYesValid = (MiHasCmdTokenEndingHypthen( vTextLine ) || MiHasCmdTokenEndingAlpha( vTextLine ));
-	vwbYesValid = vwbYesValid && MiHasCmd( vTextLine );
-	if( vwbYesValid )
-	{
-		vwbCmdNotInCmdFactor = !HasCmdFactoryGotMiCmd( MiGetCmdData() );
-		vwbYesValid = !vwbCmdNotInCmdFactor;
-	}
+//++ ------------------------------------------------------------------------------------
+// Details: Establish whether the text data is an MI format type command.
+// Type:    Method.
+// Args:    vTextLine               - (R) Text data to interpret.
+//          vwbYesValid             - (W) True = MI type command, false = not recognised.
+//          vwbCmdNotInCmdFactor    - (W) True = MI command not found in the command factory, false = recognised.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdInterpreter::ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData)
+{
+    vwbYesValid = false;
+    vwbCmdNotInCmdFactor = false;
+    rwCmdData.Clear();
+
+    if (vTextLine.empty())
+        return MIstatus::success;
+
+    // MI format is [cmd #]-[command name]<space>[command arg(s)]
+    // i.e. 1-file-exec-and-symbols --thread-group i1 DEVICE_EXECUTABLE
+    //      5-data-evaluate-expression --thread 1 --frame 0 *(argv)
+
+    m_miCmdData.Clear();
+    m_miCmdData.strMiCmd = vTextLine;
+
+    // The following change m_miCmdData as valid parts are indentified
+    vwbYesValid = (MiHasCmdTokenEndingHypthen(vTextLine) || MiHasCmdTokenEndingAlpha(vTextLine));
+    vwbYesValid = vwbYesValid && MiHasCmd(vTextLine);
+    if (vwbYesValid)
+    {
+        vwbCmdNotInCmdFactor = !HasCmdFactoryGotMiCmd(MiGetCmdData());
+        vwbYesValid = !vwbCmdNotInCmdFactor;
+    }
 
-	// Update command's meta data valid state
-	m_miCmdData.bCmdValid = vwbYesValid;
+    // Update command's meta data valid state
+    m_miCmdData.bCmdValid = vwbYesValid;
 
-	// Ok to return new updated command information
-	rwCmdData = MiGetCmdData();
+    // Ok to return new updated command information
+    rwCmdData = MiGetCmdData();
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Establish whether the command name entered on the stdin stream is recognised by 
-//			the MI driver.
-// Type:	Method.
-// Args:	vCmd	- (R) Command information structure.
-// Return:	bool  - True = yes command is recognised, false = command not recognised.
-// Throws:	None.
+// Details: Establish whether the command name entered on the stdin stream is recognised by
+//          the MI driver.
+// Type:    Method.
+// Args:    vCmd    - (R) Command information structure.
+// Return:  bool  - True = yes command is recognised, false = command not recognised.
+// Throws:  None.
 //--
-bool CMICmdInterpreter::HasCmdFactoryGotMiCmd( const SMICmdData & vCmd ) const
+bool
+CMICmdInterpreter::HasCmdFactoryGotMiCmd(const SMICmdData &vCmd) const
 {
-	return m_rCmdFactory.CmdExist( vCmd.strMiCmd );
+    return m_rCmdFactory.CmdExist(vCmd.strMiCmd);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Does the command entered match the criteria for a MI command format.
-//			The format to validate against is 'nn-' where there can be 1 to n digits.
-//			I.e. '2-gdb-exit'.
-//			Is the execution token present? The command token is entered into the
-//			command meta data structure whether correct or not for reporting or later
-//			command execution purposes.
-// Type:	Method.
-// Args:	vTextLine	- (R) Text data to interpret.
-// Return:	bool  - True = yes command token present, false = command not recognised.
-// Throws:	None.
-//--
-bool CMICmdInterpreter::MiHasCmdTokenEndingHypthen( const CMIUtilString & vTextLine )
-{
-	// The hythen is mandatory
-	const MIint nPos = vTextLine.find( "-", 0 );
-	if( (nPos == (MIint) std::string::npos) )
-		return false;
+// Details: Does the command entered match the criteria for a MI command format.
+//          The format to validate against is 'nn-' where there can be 1 to n digits.
+//          I.e. '2-gdb-exit'.
+//          Is the execution token present? The command token is entered into the
+//          command meta data structure whether correct or not for reporting or later
+//          command execution purposes.
+// Type:    Method.
+// Args:    vTextLine   - (R) Text data to interpret.
+// Return:  bool  - True = yes command token present, false = command not recognised.
+// Throws:  None.
+//--
+bool
+CMICmdInterpreter::MiHasCmdTokenEndingHypthen(const CMIUtilString &vTextLine)
+{
+    // The hythen is mandatory
+    const MIint nPos = vTextLine.find("-", 0);
+    if ((nPos == (MIint)std::string::npos))
+        return false;
+
+    if (MiHasCmdTokenPresent(vTextLine))
+    {
+        const std::string strNum = vTextLine.substr(0, nPos);
+        if (!CMIUtilString(strNum.c_str()).IsNumber())
+            return false;
 
-	if( MiHasCmdTokenPresent( vTextLine ) )
-	{
-		const std::string strNum = vTextLine.substr( 0, nPos );
-		if( !CMIUtilString( strNum.c_str() ).IsNumber() )
-			return false;
-	
-		m_miCmdData.strMiCmdToken = strNum.c_str();
-	}
+        m_miCmdData.strMiCmdToken = strNum.c_str();
+    }
 
-	m_miCmdData.bMIOldStyle = false;
+    m_miCmdData.bMIOldStyle = false;
 
-	return true;
+    return true;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Does the command entered match the criteria for a MI command format.
-//			The format to validate against is 'nnA' where there can be 1 to n digits.
-//			'A' represents any non numeric token. I.e. '1source .gdbinit'.
-//			Is the execution token present? The command token is entered into the
-//			command meta data structure whether correct or not for reporting or later
-//			command execution purposes.
-// Type:	Method.
-// Args:	vTextLine	- (R) Text data to interpret.
-// Return:	bool  - True = yes command token present, false = command not recognised.
-// Throws:	None.
-//--
-bool CMICmdInterpreter::MiHasCmdTokenEndingAlpha( const CMIUtilString & vTextLine )
-{
-	MIchar cChar = vTextLine[ 0 ]; 
-	MIuint i = 0;
-	while( ::isdigit( cChar ) != 0 )
-	{
-		cChar = vTextLine[ ++i ];
-	}
-	if( ::isalpha( cChar ) == 0 )
-		return false;
-	if( i == 0 )
-		return false;
-	
-	const std::string strNum = vTextLine.substr( 0, i );
-	m_miCmdData.strMiCmdToken = strNum.c_str();
-	m_miCmdData.bMIOldStyle = true;
+// Details: Does the command entered match the criteria for a MI command format.
+//          The format to validate against is 'nnA' where there can be 1 to n digits.
+//          'A' represents any non numeric token. I.e. '1source .gdbinit'.
+//          Is the execution token present? The command token is entered into the
+//          command meta data structure whether correct or not for reporting or later
+//          command execution purposes.
+// Type:    Method.
+// Args:    vTextLine   - (R) Text data to interpret.
+// Return:  bool  - True = yes command token present, false = command not recognised.
+// Throws:  None.
+//--
+bool
+CMICmdInterpreter::MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine)
+{
+    MIchar cChar = vTextLine[0];
+    MIuint i = 0;
+    while (::isdigit(cChar) != 0)
+    {
+        cChar = vTextLine[++i];
+    }
+    if (::isalpha(cChar) == 0)
+        return false;
+    if (i == 0)
+        return false;
+
+    const std::string strNum = vTextLine.substr(0, i);
+    m_miCmdData.strMiCmdToken = strNum.c_str();
+    m_miCmdData.bMIOldStyle = true;
 
-	return true;
+    return true;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Does the command entered match the criteria for a MI command format.
-//			Is the command token present before the hypen? 
-// Type:	Method.
-// Args:	vTextLine - (R) Text data to interpret.
-// Return:	bool  - True = yes command token present, false = token not present.
-// Throws:	None.
+// Details: Does the command entered match the criteria for a MI command format.
+//          Is the command token present before the hypen?
+// Type:    Method.
+// Args:    vTextLine - (R) Text data to interpret.
+// Return:  bool  - True = yes command token present, false = token not present.
+// Throws:  None.
 //--
-bool CMICmdInterpreter::MiHasCmdTokenPresent( const CMIUtilString & vTextLine )
+bool
+CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine)
 {
-	const MIint nPos = vTextLine.find( "-", 0 );
-	return (nPos > 0);
+    const MIint nPos = vTextLine.find("-", 0);
+    return (nPos > 0);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Does the command name entered match the criteria for a MI command format.
-//			Is a recogised command present? The command name is entered into the
-//			command meta data structure whether correct or not for reporting or later
-//			command execution purposes. Command options is present are also put into the
-//			command meta data structure.
-// Type:	Method.
-// Args:	vTextLine	- (R) Command information structure.
-// Return:	bool  - True = yes command name present, false = command not recognised.
-// Throws:	None.
-//--
-bool CMICmdInterpreter::MiHasCmd( const CMIUtilString & vTextLine )
-{
-	MIint nPos = 0;
-	if( m_miCmdData.bMIOldStyle )
-	{
-		char cChar = vTextLine[ 0 ]; 
-		MIuint i = 0;
-		while( ::isdigit( cChar ) != 0 )
-		{
-			cChar = vTextLine[ ++i ];
-		}
-		nPos = --i;
-	}
-	else
-	{
-		nPos = vTextLine.find( "-", 0 );
-	}
+// Details: Does the command name entered match the criteria for a MI command format.
+//          Is a recogised command present? The command name is entered into the
+//          command meta data structure whether correct or not for reporting or later
+//          command execution purposes. Command options is present are also put into the
+//          command meta data structure.
+// Type:    Method.
+// Args:    vTextLine   - (R) Command information structure.
+// Return:  bool  - True = yes command name present, false = command not recognised.
+// Throws:  None.
+//--
+bool
+CMICmdInterpreter::MiHasCmd(const CMIUtilString &vTextLine)
+{
+    MIint nPos = 0;
+    if (m_miCmdData.bMIOldStyle)
+    {
+        char cChar = vTextLine[0];
+        MIuint i = 0;
+        while (::isdigit(cChar) != 0)
+        {
+            cChar = vTextLine[++i];
+        }
+        nPos = --i;
+    }
+    else
+    {
+        nPos = vTextLine.find("-", 0);
+    }
+
+    bool bFoundCmd = false;
+    const MIint nLen = vTextLine.length();
+    const MIint nPos2 = vTextLine.find(" ", nPos);
+    if (nPos2 != (MIint)std::string::npos)
+    {
+        if (nPos2 == nLen)
+            return false;
+        const CMIUtilString cmd = CMIUtilString(vTextLine.substr(nPos + 1, nPos2 - nPos - 1).c_str());
+        if (cmd.empty())
+            return false;
+
+        m_miCmdData.strMiCmd = cmd;
+
+        if (nPos2 < nLen)
+            m_miCmdData.strMiCmdOption = CMIUtilString(vTextLine.substr(nPos2 + 1, nLen - nPos2 - 1).c_str());
+
+        bFoundCmd = true;
+    }
+    else
+    {
+        const CMIUtilString cmd = CMIUtilString(vTextLine.substr(nPos + 1, nLen - nPos - 1).c_str());
+        if (cmd.empty())
+            return false;
+        m_miCmdData.strMiCmd = cmd;
+        bFoundCmd = true;
+    }
 
-	bool bFoundCmd = false;
-	const MIint nLen = vTextLine.length();
-	const MIint nPos2 = vTextLine.find( " ", nPos );
-	if( nPos2 != (MIint) std::string::npos )
-	{
-		if( nPos2 == nLen )
-			return false;
-		const CMIUtilString cmd = CMIUtilString( vTextLine.substr( nPos + 1, nPos2 - nPos - 1 ).c_str() );
-		if( cmd.empty() )
-			return false;
-		
-		m_miCmdData.strMiCmd = cmd;
-		
-		if( nPos2 < nLen )
-			m_miCmdData.strMiCmdOption = CMIUtilString( vTextLine.substr( nPos2 + 1, nLen - nPos2 - 1 ).c_str() );
-		
-		bFoundCmd = true;
-	}
-	else
-	{
-		const CMIUtilString cmd = CMIUtilString( vTextLine.substr( nPos + 1, nLen - nPos - 1 ).c_str() );
-		if( cmd.empty() )
-			return false;
-		m_miCmdData.strMiCmd = cmd;
-		bFoundCmd = true;
-	}
+    if (bFoundCmd)
+        m_miCmdData.strMiCmdAll = vTextLine;
 
-	if( bFoundCmd )
-		m_miCmdData.strMiCmdAll = vTextLine;
-
-	return bFoundCmd;
+    return bFoundCmd;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the just entered new command from stdin. It contains the command
-//			name, number and any options.
-// Type:	Method.
-// Args:	vTextLine	- (R) Command information structure.
-// Return:	SMICmdData & - Command meta data information/result/status.
-// Throws:	None.
+// Details: Retrieve the just entered new command from stdin. It contains the command
+//          name, number and any options.
+// Type:    Method.
+// Args:    vTextLine   - (R) Command information structure.
+// Return:  SMICmdData & - Command meta data information/result/status.
+// Throws:  None.
 //--
-const SMICmdData & CMICmdInterpreter::MiGetCmdData( void ) const
+const SMICmdData &
+CMICmdInterpreter::MiGetCmdData(void) const
 {
-	return m_miCmdData;
+    return m_miCmdData;
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmdInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdInterpreter.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdInterpreter.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdInterpreter.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdInterpreter.h
+// File:        MICmdInterpreter.h
 //
-// Overview:	CMICmdInterpreter interface.
+// Overview:    CMICmdInterpreter interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -30,49 +30,47 @@
 class CMICmdFactory;
 
 //++ ============================================================================
-// Details:	MI command interpreter. It takes text data from the MI driver 
-//			(which got it from Stdin singleton) and validate the text to see if
-//			matches Machine Interface (MI) format and commands defined in the
-//			MI application.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 18/02/2014.
-// Changes:	None.
+// Details: MI command interpreter. It takes text data from the MI driver
+//          (which got it from Stdin singleton) and validate the text to see if
+//          matches Machine Interface (MI) format and commands defined in the
+//          MI application.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 18/02/2014.
+// Changes: None.
 //--
-class CMICmdInterpreter
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmdInterpreter >
+class CMICmdInterpreter : public CMICmnBase, public MI::ISingleton<CMICmdInterpreter>
 {
-	friend MI::ISingleton< CMICmdInterpreter >;
+    friend MI::ISingleton<CMICmdInterpreter>;
 
-// Methods:
-public:
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	bool	ValidateIsMi( const CMIUtilString & vTextLine, bool & vwbYesValid, bool & vwbCmdNotInCmdFactor, SMICmdData & rwCmdData );
-
-// Methods:
-private:
-	/* ctor */	CMICmdInterpreter( void );
-	/* ctor */	CMICmdInterpreter( const CMICmdInterpreter & );
-	void		operator=( const CMICmdInterpreter & );
-	
-	bool				HasCmdFactoryGotMiCmd( const SMICmdData & vCmdData ) const;
-	bool				MiHasCmdTokenEndingHypthen( const CMIUtilString & vTextLine );
-	bool				MiHasCmdTokenEndingAlpha( const CMIUtilString & vTextLine );
-	bool				MiHasCmd( const CMIUtilString & vTextLine );
-	bool				MiHasCmdTokenPresent( const CMIUtilString & vTextLine );
-	const SMICmdData &	MiGetCmdData() const;
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdInterpreter( void );
-
-// Attributes:
-private:
-	SMICmdData		m_miCmdData;	// Filled in on each new line being interpreted
-	CMICmdFactory &	m_rCmdFactory;
+    // Methods:
+  public:
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmdInterpreter(void);
+    /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
+    void operator=(const CMICmdInterpreter &);
+
+    bool HasCmdFactoryGotMiCmd(const SMICmdData &vCmdData) const;
+    bool MiHasCmdTokenEndingHypthen(const CMIUtilString &vTextLine);
+    bool MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine);
+    bool MiHasCmd(const CMIUtilString &vTextLine);
+    bool MiHasCmdTokenPresent(const CMIUtilString &vTextLine);
+    const SMICmdData &MiGetCmdData() const;
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdInterpreter(void);
+
+    // Attributes:
+  private:
+    SMICmdData m_miCmdData; // Filled in on each new line being interpreted
+    CMICmdFactory &m_rCmdFactory;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmdInvoker.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdInvoker.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdInvoker.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdInvoker.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdInvoker.cpp
+// File:        MICmdInvoker.cpp
 //
-// Overview:	CMICmdInvoker implementation.
+// Overview:    CMICmdInvoker implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -28,306 +28,318 @@
 #include "MIDriver.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdInvoker constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdInvoker::CMICmdInvoker( void )
-:	m_rStreamOut( CMICmnStreamStdout::Instance() )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdInvoker destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdInvoker::~CMICmdInvoker( void )
-{
-	Shutdown();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Command Invoker.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdInvoker::Initialize( void )
-{
-	m_clientUsageRefCnt++;
-
-	if( m_bInitialized )
-		return MIstatus::success;
-
-	m_bInitialized = true;
-
-	return  MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdInvoker::Shutdown( void )
-{
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
-
-	CmdDeleteAll();
-
-	m_bInitialized = false;
-
-	return MIstatus::success;
-}	
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Empty the map of invoked commands doing work. Command objects are deleted too.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-void CMICmdInvoker::CmdDeleteAll( void )
-{
-	CMICmdMgr & rMgr = CMICmdMgr::Instance();
-	MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.begin();
-	while( it != m_mapCmdIdToCmd.end() )
-	{
-		const MIuint cmdId( (*it).first ); MIunused( cmdId );
-		CMICmdBase * pCmd = (*it).second;
-		const CMIUtilString & rCmdName( pCmd->GetCmdData().strMiCmd ); MIunused( rCmdName );
-		rMgr.CmdDelete( pCmd->GetCmdData() );
-
-		// Next
-		++it;
-	}
-	m_mapCmdIdToCmd.clear();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Remove from the map of invoked commands doing work a command that has finished
-//			its work. The command object is deleted too.
-// Type:	Method.
-// Args:	vId				- (R) Command object's unique ID.
-//			vbYesDeleteCmd	- (R) True = Delete command object, false = delete via the Command Manager.
-// Return:	None.
-// Throws:	None.
-//--
-bool CMICmdInvoker::CmdDelete( const MIuint vId, const bool vbYesDeleteCmd /*= false*/ )
-{
-	CMICmdMgr & rMgr = CMICmdMgr::Instance();
-	MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.find( vId );
-	if( it != m_mapCmdIdToCmd.end() )
-	{
-		CMICmdBase * pCmd = (*it).second;
-		if( vbYesDeleteCmd )
-		{
-			// Via registered interest command manager callback *this object to delete the command
-			m_mapCmdIdToCmd.erase( it );
-			delete pCmd;
-		}
-		else
-			// Notify other interested object of this command's pending deletion
-			rMgr.CmdDelete( pCmd->GetCmdData() );
-	}
-
-	if( m_mapCmdIdToCmd.empty() )
-		rMgr.CmdUnregisterForDeleteNotification( *this );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Add to the map of invoked commands doing work a command that is about to 
-//			start to do work.
-// Type:	Method.
-// Args:	vCmd	- (R) Command object.
-// Return:	None.
-// Throws:	None.
-//--
-bool CMICmdInvoker::CmdAdd( const CMICmdBase & vCmd )
-{
-	if( m_mapCmdIdToCmd.empty() )
-	{
-		CMICmdMgr & rMgr = CMICmdMgr::Instance();
-		rMgr.CmdRegisterForDeleteNotification( *this );
-	}
-
-	const MIuint & cmdId( vCmd.GetCmdData().id );
-	MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.find( cmdId );
-	if( it != m_mapCmdIdToCmd.end() )
-		return MIstatus::success;
-
-	MapPairCmdIdToCmd_t pr( cmdId, const_cast< CMICmdBase *>( &vCmd ));
-	m_mapCmdIdToCmd.insert( pr );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Having previously had the potential command validated and found valid now
-//			get the command executed.
-//			If the Functionalityity returns MIstatus::failure call GetErrorDescription().
-//			This function is used by the application's main thread.
-// Type:	Method.
-// Args:	vCmd	- (RW) Command object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdInvoker::CmdExecute( CMICmdBase & vCmd )
-{
-	bool bOk = CmdAdd( vCmd );
-
-	if( bOk && !vCmd.ParseArgs() )
-	{
-		// Report command execution failed
-		const SMICmdData cmdData( vCmd.GetCmdData() );
-		CmdStdout( cmdData );
-		CmdCauseAppExit( vCmd );
-		CmdDelete( cmdData.id );
-
-		// Proceed to wait or execute next command
-		return MIstatus::success;
-	}
-	
-	if( bOk && !vCmd.Execute() )
-	{
-		// Report command execution failed
-		const SMICmdData cmdData( vCmd.GetCmdData() );
-		CmdStdout( cmdData );
-		CmdCauseAppExit( vCmd );
-		CmdDelete( cmdData.id );
-
-		// Proceed to wait or execute next command
-		return MIstatus::success;
-	}
-
-	bOk = CmdExecuteFinished( vCmd );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Called when a command has finished its Execution() work either synchronously
-//			because the command executed was the type a non event type or asynchronoulsy
-//			via the command's callback (because of an SB Listener event). Needs to be called
-//			so that *this invoker call do some house keeping and then proceed to call 
-//			the command's Acknowledge() function.
-// Type:	Method.
-// Args:	vCmd	- (R) Command object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdInvoker::CmdExecuteFinished( CMICmdBase & vCmd )
-{
-	// Command finished now get the command to gather it's information and form the MI
-	// Result record
-	if( !vCmd.Acknowledge() )
-	{
-		// Report command acknowledge functionality failed
-		const SMICmdData cmdData( vCmd.GetCmdData() );
-		CmdStdout( cmdData );
-		CmdCauseAppExit( vCmd );
-		CmdDelete( cmdData.id );
-
-		// Proceed to wait or execute next command
-		return MIstatus::success;
-	}
-	
-	// Retrieve the command's latest data/information. Needed for commands of the event type so have 
-	// a record of commands pending finishing execution.
-	const CMIUtilString & rMIResultRecord( vCmd.GetMIResultRecord() );
-	SMICmdData cmdData( vCmd.GetCmdData() );		// Make a copy as the command will be deleted soon
-	cmdData.strMiCmdResultRecord = rMIResultRecord;	// Precautionary copy as the command might forget to do this
-	if( vCmd.HasMIResultRecordExtra() )
-	{
-		cmdData.bHasResultRecordExtra = true;
-		const CMIUtilString & rMIExtra( vCmd.GetMIResultRecordExtra() );
-		cmdData.strMiCmdResultRecordExtra = rMIExtra;	// Precautionary copy as the command might forget to do this
-	}
-	
-	// Send command's MI response to the client
-	bool bOk = CmdStdout( cmdData );
-	
-	// Delete the command object as do not require anymore
-	bOk = bOk && CmdDelete( vCmd.GetCmdData().id );
-		
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	If the MI Driver is not operating via a client i.e. Eclipse check the command
-//			on failure suggests the application exits. A command can be such that a 
-//			failure cannot the allow the application to continue operating.
-// Args:	vCmd	- (R) Command object.
-// Return:	None.
-// Return:	None.
-// Throws:	None.
-//--
-void CMICmdInvoker::CmdCauseAppExit( const CMICmdBase & vCmd ) const
-{
-	if( vCmd.GetExitAppOnCommandFailure() )
-	{
-		CMIDriver & rDriver( CMIDriver::Instance() );
-		if( rDriver.IsDriverDebuggingArgExecutable() )
-		{
-			rDriver.SetExitApplicationFlag( true );
-		}
-	}
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Write to stdout and the Log file the command's MI formatted result.
-// Type:	vCmdData	- (R) A command's information.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Return:	None.
-// Throws:	None.
-//--
-bool CMICmdInvoker::CmdStdout( const SMICmdData & vCmdData ) const
-{
-	bool bOk = m_pLog->WriteLog( vCmdData.strMiCmdAll );
-	const bool bLock = bOk && m_rStreamOut.Lock();
-	bOk = bOk && bLock && m_rStreamOut.WriteMIResponse( vCmdData.strMiCmdResultRecord );
-	if( bOk && vCmdData.bHasResultRecordExtra )
-	{
-		bOk = m_rStreamOut.WriteMIResponse( vCmdData.strMiCmdResultRecordExtra );
-	}
-	bOk = bLock && m_rStreamOut.Unlock();
-	
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Required by the CMICmdMgr::ICmdDeleteCallback. *this object is registered
-//			with the Command Manager to receive callbacks when a command is being deleted.
-//			An object, *this invoker, does not delete a command object itself but calls
-//			the Command Manager to delete a command object. This function is the Invoker's
-//			called. 
-//			The Invoker owns the command objects and so can delete them but must do it 
-//			via the manager so other objects can be notified of the deletion.
-// Type:	Method.
-// Args:	vCmd	- (RW) Command.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmdInvoker constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmdInvoker::Delete( SMICmdData & vCmd )
+CMICmdInvoker::CMICmdInvoker(void)
+    : m_rStreamOut(CMICmnStreamStdout::Instance())
 {
-	CmdDelete( vCmd.id, true );
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdInvoker destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdInvoker::~CMICmdInvoker(void)
+{
+    Shutdown();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Initialize resources for *this Command Invoker.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::Initialize(void)
+{
+    m_clientUsageRefCnt++;
+
+    if (m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = true;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Release resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::Shutdown(void)
+{
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    CmdDeleteAll();
+
+    m_bInitialized = false;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Empty the map of invoked commands doing work. Command objects are deleted too.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+void
+CMICmdInvoker::CmdDeleteAll(void)
+{
+    CMICmdMgr &rMgr = CMICmdMgr::Instance();
+    MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.begin();
+    while (it != m_mapCmdIdToCmd.end())
+    {
+        const MIuint cmdId((*it).first);
+        MIunused(cmdId);
+        CMICmdBase *pCmd = (*it).second;
+        const CMIUtilString &rCmdName(pCmd->GetCmdData().strMiCmd);
+        MIunused(rCmdName);
+        rMgr.CmdDelete(pCmd->GetCmdData());
+
+        // Next
+        ++it;
+    }
+    m_mapCmdIdToCmd.clear();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Remove from the map of invoked commands doing work a command that has finished
+//          its work. The command object is deleted too.
+// Type:    Method.
+// Args:    vId             - (R) Command object's unique ID.
+//          vbYesDeleteCmd  - (R) True = Delete command object, false = delete via the Command Manager.
+// Return:  None.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::CmdDelete(const MIuint vId, const bool vbYesDeleteCmd /*= false*/)
+{
+    CMICmdMgr &rMgr = CMICmdMgr::Instance();
+    MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.find(vId);
+    if (it != m_mapCmdIdToCmd.end())
+    {
+        CMICmdBase *pCmd = (*it).second;
+        if (vbYesDeleteCmd)
+        {
+            // Via registered interest command manager callback *this object to delete the command
+            m_mapCmdIdToCmd.erase(it);
+            delete pCmd;
+        }
+        else
+            // Notify other interested object of this command's pending deletion
+            rMgr.CmdDelete(pCmd->GetCmdData());
+    }
+
+    if (m_mapCmdIdToCmd.empty())
+        rMgr.CmdUnregisterForDeleteNotification(*this);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Add to the map of invoked commands doing work a command that is about to
+//          start to do work.
+// Type:    Method.
+// Args:    vCmd    - (R) Command object.
+// Return:  None.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::CmdAdd(const CMICmdBase &vCmd)
+{
+    if (m_mapCmdIdToCmd.empty())
+    {
+        CMICmdMgr &rMgr = CMICmdMgr::Instance();
+        rMgr.CmdRegisterForDeleteNotification(*this);
+    }
+
+    const MIuint &cmdId(vCmd.GetCmdData().id);
+    MapCmdIdToCmd_t::const_iterator it = m_mapCmdIdToCmd.find(cmdId);
+    if (it != m_mapCmdIdToCmd.end())
+        return MIstatus::success;
+
+    MapPairCmdIdToCmd_t pr(cmdId, const_cast<CMICmdBase *>(&vCmd));
+    m_mapCmdIdToCmd.insert(pr);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Having previously had the potential command validated and found valid now
+//          get the command executed.
+//          If the Functionalityity returns MIstatus::failure call GetErrorDescription().
+//          This function is used by the application's main thread.
+// Type:    Method.
+// Args:    vCmd    - (RW) Command object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::CmdExecute(CMICmdBase &vCmd)
+{
+    bool bOk = CmdAdd(vCmd);
+
+    if (bOk && !vCmd.ParseArgs())
+    {
+        // Report command execution failed
+        const SMICmdData cmdData(vCmd.GetCmdData());
+        CmdStdout(cmdData);
+        CmdCauseAppExit(vCmd);
+        CmdDelete(cmdData.id);
+
+        // Proceed to wait or execute next command
+        return MIstatus::success;
+    }
+
+    if (bOk && !vCmd.Execute())
+    {
+        // Report command execution failed
+        const SMICmdData cmdData(vCmd.GetCmdData());
+        CmdStdout(cmdData);
+        CmdCauseAppExit(vCmd);
+        CmdDelete(cmdData.id);
+
+        // Proceed to wait or execute next command
+        return MIstatus::success;
+    }
+
+    bOk = CmdExecuteFinished(vCmd);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Called when a command has finished its Execution() work either synchronously
+//          because the command executed was the type a non event type or asynchronoulsy
+//          via the command's callback (because of an SB Listener event). Needs to be called
+//          so that *this invoker call do some house keeping and then proceed to call
+//          the command's Acknowledge() function.
+// Type:    Method.
+// Args:    vCmd    - (R) Command object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::CmdExecuteFinished(CMICmdBase &vCmd)
+{
+    // Command finished now get the command to gather it's information and form the MI
+    // Result record
+    if (!vCmd.Acknowledge())
+    {
+        // Report command acknowledge functionality failed
+        const SMICmdData cmdData(vCmd.GetCmdData());
+        CmdStdout(cmdData);
+        CmdCauseAppExit(vCmd);
+        CmdDelete(cmdData.id);
+
+        // Proceed to wait or execute next command
+        return MIstatus::success;
+    }
+
+    // Retrieve the command's latest data/information. Needed for commands of the event type so have
+    // a record of commands pending finishing execution.
+    const CMIUtilString &rMIResultRecord(vCmd.GetMIResultRecord());
+    SMICmdData cmdData(vCmd.GetCmdData());          // Make a copy as the command will be deleted soon
+    cmdData.strMiCmdResultRecord = rMIResultRecord; // Precautionary copy as the command might forget to do this
+    if (vCmd.HasMIResultRecordExtra())
+    {
+        cmdData.bHasResultRecordExtra = true;
+        const CMIUtilString &rMIExtra(vCmd.GetMIResultRecordExtra());
+        cmdData.strMiCmdResultRecordExtra = rMIExtra; // Precautionary copy as the command might forget to do this
+    }
+
+    // Send command's MI response to the client
+    bool bOk = CmdStdout(cmdData);
+
+    // Delete the command object as do not require anymore
+    bOk = bOk && CmdDelete(vCmd.GetCmdData().id);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: If the MI Driver is not operating via a client i.e. Eclipse check the command
+//          on failure suggests the application exits. A command can be such that a
+//          failure cannot the allow the application to continue operating.
+// Args:    vCmd    - (R) Command object.
+// Return:  None.
+// Return:  None.
+// Throws:  None.
+//--
+void
+CMICmdInvoker::CmdCauseAppExit(const CMICmdBase &vCmd) const
+{
+    if (vCmd.GetExitAppOnCommandFailure())
+    {
+        CMIDriver &rDriver(CMIDriver::Instance());
+        if (rDriver.IsDriverDebuggingArgExecutable())
+        {
+            rDriver.SetExitApplicationFlag(true);
+        }
+    }
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Write to stdout and the Log file the command's MI formatted result.
+// Type:    vCmdData    - (R) A command's information.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Return:  None.
+// Throws:  None.
+//--
+bool
+CMICmdInvoker::CmdStdout(const SMICmdData &vCmdData) const
+{
+    bool bOk = m_pLog->WriteLog(vCmdData.strMiCmdAll);
+    const bool bLock = bOk && m_rStreamOut.Lock();
+    bOk = bOk && bLock && m_rStreamOut.WriteMIResponse(vCmdData.strMiCmdResultRecord);
+    if (bOk && vCmdData.bHasResultRecordExtra)
+    {
+        bOk = m_rStreamOut.WriteMIResponse(vCmdData.strMiCmdResultRecordExtra);
+    }
+    bOk = bLock && m_rStreamOut.Unlock();
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Required by the CMICmdMgr::ICmdDeleteCallback. *this object is registered
+//          with the Command Manager to receive callbacks when a command is being deleted.
+//          An object, *this invoker, does not delete a command object itself but calls
+//          the Command Manager to delete a command object. This function is the Invoker's
+//          called.
+//          The Invoker owns the command objects and so can delete them but must do it
+//          via the manager so other objects can be notified of the deletion.
+// Type:    Method.
+// Args:    vCmd    - (RW) Command.
+// Return:  None.
+// Throws:  None.
+//--
+void
+CMICmdInvoker::Delete(SMICmdData &vCmd)
+{
+    CmdDelete(vCmd.id, true);
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdInvoker.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdInvoker.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdInvoker.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdInvoker.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdInvoker.h
+// File:        MICmdInvoker.h
 //
-// Overview:	CMICmdInvoker interface.
+// Overview:    CMICmdInvoker interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -35,84 +35,81 @@ class CMICmdBase;
 class CMICmnStreamStdout;
 
 //++ ============================================================================
-// Details:	MI Command Invoker. The Invoker works on the command pattern design.
-//			There two main jobs; action command Execute() function, followed by
-//			the command's Acknowledge() function. When a command has finished its
-//			execute function it returns to the invoker. The invoker then calls the
-//			command's Acknowledge() function to do more work, form and give
-//			back a MI result. In the meantime the Command Monitor is monitoring
-//			the each command doing their Execute() function work so they do not 
-//			exceed a time limit which if it	exceeds informs the command(s) to
-//			stop work.
-//			The work by the Invoker is carried out in the main thread.
-//			The Invoker takes ownersip of any commands created which means it
-//			is the only object to delete them when a command is finished working.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 19/02/2014.
-// Changes:	None.
+// Details: MI Command Invoker. The Invoker works on the command pattern design.
+//          There two main jobs; action command Execute() function, followed by
+//          the command's Acknowledge() function. When a command has finished its
+//          execute function it returns to the invoker. The invoker then calls the
+//          command's Acknowledge() function to do more work, form and give
+//          back a MI result. In the meantime the Command Monitor is monitoring
+//          the each command doing their Execute() function work so they do not
+//          exceed a time limit which if it exceeds informs the command(s) to
+//          stop work.
+//          The work by the Invoker is carried out in the main thread.
+//          The Invoker takes ownersip of any commands created which means it
+//          is the only object to delete them when a command is finished working.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 19/02/2014.
+// Changes: None.
 //--
-class CMICmdInvoker
-:	public CMICmnBase
-,	public CMICmdMgrSetCmdDeleteCallback::ICallback
-,	public MI::ISingleton< CMICmdInvoker >
+class CMICmdInvoker : public CMICmnBase, public CMICmdMgrSetCmdDeleteCallback::ICallback, public MI::ISingleton<CMICmdInvoker>
 {
-	friend class MI::ISingleton< CMICmdInvoker >;
+    friend class MI::ISingleton<CMICmdInvoker>;
 
-// Class:
-public:
-	//++
-	// Description: Invoker's interface for commands to implement.
-	//--
-	class ICmd
-	{
-	public:
-		virtual bool					Acknowledge( void ) = 0;
-		virtual bool					Execute( void ) = 0;
-		virtual bool					ParseArgs( void ) = 0;
-		virtual bool					SetCmdData( const SMICmdData & vCmdData ) = 0;
-		virtual const SMICmdData &		GetCmdData( void ) const = 0;
-		virtual const CMIUtilString &	GetErrorDescription( void ) const = 0;
-		virtual void					CmdFinishedTellInvoker( void ) const = 0;
-		virtual const CMIUtilString &	GetMIResultRecord( void ) const = 0;
-		virtual const CMIUtilString &	GetMIResultRecordExtra( void ) const = 0;
-		virtual bool					HasMIResultRecordExtra( void ) const = 0;
-
-		/* dtor */ virtual ~ICmd( void ) {};
-	};
-	
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	bool	CmdExecute( CMICmdBase & vCmd );
-	bool	CmdExecuteFinished( CMICmdBase & vCmd );
-
-// Typedefs:
-private:
-	typedef std::map< MIuint, CMICmdBase * >	MapCmdIdToCmd_t;
-	typedef std::pair< MIuint, CMICmdBase * >	MapPairCmdIdToCmd_t;
-
-// Methods:
-private:
-	/* ctor */	CMICmdInvoker( void );
-	/* ctor */	CMICmdInvoker( const CMICmdInvoker & );
-	void		operator=( const CMICmdInvoker & );
-	void		CmdDeleteAll( void );
-	bool		CmdDelete( const MIuint vCmdId, const bool vbYesDeleteCmd = false );
-	bool		CmdAdd( const CMICmdBase & vCmd );
-	bool		CmdStdout( const SMICmdData & vCmdData ) const;
-	void		CmdCauseAppExit( const CMICmdBase & vCmd ) const;
-	
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdInvoker( void );
-	// From CMICmdMgrSetCmdDeleteCallback::ICallback 
-	virtual void Delete( SMICmdData & vCmd );
-
-// Attributes:
-private:
-	MapCmdIdToCmd_t			m_mapCmdIdToCmd;
-	CMICmnStreamStdout &	m_rStreamOut;
+    // Class:
+  public:
+    //++
+    // Description: Invoker's interface for commands to implement.
+    //--
+    class ICmd
+    {
+      public:
+        virtual bool Acknowledge(void) = 0;
+        virtual bool Execute(void) = 0;
+        virtual bool ParseArgs(void) = 0;
+        virtual bool SetCmdData(const SMICmdData &vCmdData) = 0;
+        virtual const SMICmdData &GetCmdData(void) const = 0;
+        virtual const CMIUtilString &GetErrorDescription(void) const = 0;
+        virtual void CmdFinishedTellInvoker(void) const = 0;
+        virtual const CMIUtilString &GetMIResultRecord(void) const = 0;
+        virtual const CMIUtilString &GetMIResultRecordExtra(void) const = 0;
+        virtual bool HasMIResultRecordExtra(void) const = 0;
+
+        /* dtor */ virtual ~ICmd(void){};
+    };
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    bool CmdExecute(CMICmdBase &vCmd);
+    bool CmdExecuteFinished(CMICmdBase &vCmd);
+
+    // Typedefs:
+  private:
+    typedef std::map<MIuint, CMICmdBase *> MapCmdIdToCmd_t;
+    typedef std::pair<MIuint, CMICmdBase *> MapPairCmdIdToCmd_t;
+
+    // Methods:
+  private:
+    /* ctor */ CMICmdInvoker(void);
+    /* ctor */ CMICmdInvoker(const CMICmdInvoker &);
+    void operator=(const CMICmdInvoker &);
+    void CmdDeleteAll(void);
+    bool CmdDelete(const MIuint vCmdId, const bool vbYesDeleteCmd = false);
+    bool CmdAdd(const CMICmdBase &vCmd);
+    bool CmdStdout(const SMICmdData &vCmdData) const;
+    void CmdCauseAppExit(const CMICmdBase &vCmd) const;
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdInvoker(void);
+    // From CMICmdMgrSetCmdDeleteCallback::ICallback
+    virtual void Delete(SMICmdData &vCmd);
+
+    // Attributes:
+  private:
+    MapCmdIdToCmd_t m_mapCmdIdToCmd;
+    CMICmnStreamStdout &m_rStreamOut;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmdMgr.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdMgr.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdMgr.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdMgr.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdMgr.cpp
+// File:        MICmdMgr.cpp
 //
-// Overview:	CMICmdMgr implementation.
+// Overview:    CMICmdMgr implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -31,227 +31,237 @@
 #include "MIUtilSingletonHelper.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmdMgr constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdMgr::CMICmdMgr( void )
-:	m_interpretor( CMICmdInterpreter::Instance() )
-,	m_factory( CMICmdFactory::Instance() )
-,	m_invoker( CMICmdInvoker::Instance() )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmdMgr destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmdMgr::~CMICmdMgr( void )
-{
-	Shutdown();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Command Manager.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::Initialize( void )
-{
-	m_clientUsageRefCnt++;
-
-	if( m_bInitialized )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
- 
-	// Note initialization order is important here as some resources depend on previous
-	MI::ModuleInit< CMICmnLog >      ( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
-	MI::ModuleInit< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-	if( bOk && !m_interpretor.Initialize() )
-	{
-		bOk = false;
-		errMsg = CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_CMDINTERPRETER ), m_interpretor.GetErrorDescription().c_str() );
-	}
-	if( bOk && !m_factory.Initialize() )
-	{
-		bOk = false;
-		errMsg = CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_CMDFACTORY ), m_factory.GetErrorDescription().c_str() );
-	}
-	if( bOk && !m_invoker.Initialize() )
-	{
-		bOk = false;
-		errMsg = CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_CMDINVOKER ), m_invoker.GetErrorDescription().c_str() );
-	}
-	m_bInitialized = bOk;
-
-	if( !bOk )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_CMDMGR ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-		return MIstatus::failure;
-	}
-
-	return  MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Command Manager.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::Shutdown( void )
-{
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
-
-	m_bInitialized = false;
-
-	ClrErrorDescription();
-
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-
-	// Tidy up
-	m_setCmdDeleteCallback.clear();
-
-	// Note shutdown order is important here 
-	if( !m_invoker.Shutdown() )
-	{
-		bOk = false;
-		errMsg += CMIUtilString::Format( MIRSRC( IDS_MI_SHTDWN_ERR_CMDINVOKER ), m_invoker.GetErrorDescription().c_str() );
-	}
-	if( !m_factory.Shutdown() )
-	{
-		bOk = false;
-		if( !errMsg.empty() ) errMsg += ", ";
-		errMsg += CMIUtilString::Format( MIRSRC( IDS_MI_SHTDWN_ERR_CMDFACTORY ), m_factory.GetErrorDescription().c_str() );
-	}
-	if( !m_interpretor.Shutdown() )
-	{
-		bOk = false;
-		if( !errMsg.empty() ) errMsg += ", ";
-		errMsg += CMIUtilString::Format( MIRSRC( IDS_MI_SHTDWN_ERR_CMDINTERPRETER ), m_interpretor.GetErrorDescription().c_str() );
-	}
-	MI::ModuleShutdown< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLog >( IDS_MI_INIT_ERR_LOG            , bOk, errMsg );
-
-	if( !bOk )
-	{
-		SetErrorDescriptionn( MIRSRC( IDS_MI_SHUTDOWN_ERR ), errMsg.c_str() );
-	}
-
-	return MIstatus::success;
-}	
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Establish whether the text data is an MI format type command.
-// Type:	Method.
-// Args:	vTextLine				- (R) Text data to interpret.
-//			vwbYesValid				- (W) True = MI type command, false = not recognised.
-//			vwbCmdNotInCmdFactor	- (W) True = MI command not found in the command factor, false = recognised.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::CmdInterpret( const CMIUtilString & vTextLine, bool & vwbYesValid, bool & vwbCmdNotInCmdFactor, SMICmdData & rwCmdData )
-{
-	return m_interpretor.ValidateIsMi( vTextLine, vwbYesValid, vwbCmdNotInCmdFactor, rwCmdData );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Having previously had the potential command validated and found valid now
-//			get the command executed.
-//			If the Functionalityity returns MIstatus::failure call GetErrorDescription().
-//			This function is used by the application's main thread.
-// Type:	Method.
-// Args:	vCmdData	- (RW) Command meta data.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::CmdExecute( const SMICmdData & vCmdData )
-{
-	bool bOk = MIstatus::success;
-	
-	// Pass the command's meta data structure to the command 
-	// so it can update it if required. (Need to copy it out of the
-	// command before the command is deleted)
-	CMICmdBase * pCmd = nullptr;
-	bOk = m_factory.CmdCreate( vCmdData.strMiCmd, vCmdData, pCmd );
-	if( !bOk )
-	{
-		const CMIUtilString errMsg( CMIUtilString::Format( MIRSRC( IDS_CMDMGR_ERR_CMD_FAILED_CREATE ), m_factory.GetErrorDescription().c_str() ) );
-		SetErrorDescription( errMsg );
-		return MIstatus::failure;
-	}
-
-	bOk = m_invoker.CmdExecute( *pCmd );
-	if( !bOk )
-	{
-		const CMIUtilString errMsg( CMIUtilString::Format( MIRSRC( IDS_CMDMGR_ERR_CMD_INVOKER ), m_invoker.GetErrorDescription().c_str() ) );
-		SetErrorDescription( errMsg );
-		return MIstatus::failure;
-	}
-			
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Iterate all interested clients and tell them a command is being deleted.
-// Type:	Method.
-// Args:	vCmdData	- (RW) The command to be deleted. 
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::CmdDelete( SMICmdData vCmdData )
-{
-	// Note vCmdData is a copy! The command holding its copy will be deleted soon
-	// we still need to iterate callback clients after a command object is deleted
-
-	m_setCmdDeleteCallback.Delete( vCmdData );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Register an object to be called when a command object is deleted.
-// Type:	Method.
-// Args:	vObject	- (R) A new interested client.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmdMgr::CmdRegisterForDeleteNotification( CMICmdMgrSetCmdDeleteCallback::ICallback & vObject )
-{
-	return m_setCmdDeleteCallback.Register( vObject );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Unregister an object from being called when a command object is deleted.
-// Type:	Method.
-// Args:	vObject	- (R) The was interested client.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: CMICmdMgr constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-bool CMICmdMgr::CmdUnregisterForDeleteNotification( CMICmdMgrSetCmdDeleteCallback::ICallback & vObject )
+CMICmdMgr::CMICmdMgr(void)
+    : m_interpretor(CMICmdInterpreter::Instance())
+    , m_factory(CMICmdFactory::Instance())
+    , m_invoker(CMICmdInvoker::Instance())
 {
-	return m_setCmdDeleteCallback.Unregister( vObject );
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmdMgr destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmdMgr::~CMICmdMgr(void)
+{
+    Shutdown();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Initialize resources for *this Command Manager.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::Initialize(void)
+{
+    m_clientUsageRefCnt++;
+
+    if (m_bInitialized)
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Note initialization order is important here as some resources depend on previous
+    MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+    MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    if (bOk && !m_interpretor.Initialize())
+    {
+        bOk = false;
+        errMsg = CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_CMDINTERPRETER), m_interpretor.GetErrorDescription().c_str());
+    }
+    if (bOk && !m_factory.Initialize())
+    {
+        bOk = false;
+        errMsg = CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_CMDFACTORY), m_factory.GetErrorDescription().c_str());
+    }
+    if (bOk && !m_invoker.Initialize())
+    {
+        bOk = false;
+        errMsg = CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_CMDINVOKER), m_invoker.GetErrorDescription().c_str());
+    }
+    m_bInitialized = bOk;
+
+    if (!bOk)
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_CMDMGR), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+        return MIstatus::failure;
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Release resources for *this Command Manager.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::Shutdown(void)
+{
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = false;
+
+    ClrErrorDescription();
+
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Tidy up
+    m_setCmdDeleteCallback.clear();
+
+    // Note shutdown order is important here
+    if (!m_invoker.Shutdown())
+    {
+        bOk = false;
+        errMsg += CMIUtilString::Format(MIRSRC(IDS_MI_SHTDWN_ERR_CMDINVOKER), m_invoker.GetErrorDescription().c_str());
+    }
+    if (!m_factory.Shutdown())
+    {
+        bOk = false;
+        if (!errMsg.empty())
+            errMsg += ", ";
+        errMsg += CMIUtilString::Format(MIRSRC(IDS_MI_SHTDWN_ERR_CMDFACTORY), m_factory.GetErrorDescription().c_str());
+    }
+    if (!m_interpretor.Shutdown())
+    {
+        bOk = false;
+        if (!errMsg.empty())
+            errMsg += ", ";
+        errMsg += CMIUtilString::Format(MIRSRC(IDS_MI_SHTDWN_ERR_CMDINTERPRETER), m_interpretor.GetErrorDescription().c_str());
+    }
+    MI::ModuleShutdown<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+
+    if (!bOk)
+    {
+        SetErrorDescriptionn(MIRSRC(IDS_MI_SHUTDOWN_ERR), errMsg.c_str());
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Establish whether the text data is an MI format type command.
+// Type:    Method.
+// Args:    vTextLine               - (R) Text data to interpret.
+//          vwbYesValid             - (W) True = MI type command, false = not recognised.
+//          vwbCmdNotInCmdFactor    - (W) True = MI command not found in the command factor, false = recognised.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::CmdInterpret(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData)
+{
+    return m_interpretor.ValidateIsMi(vTextLine, vwbYesValid, vwbCmdNotInCmdFactor, rwCmdData);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Having previously had the potential command validated and found valid now
+//          get the command executed.
+//          If the Functionalityity returns MIstatus::failure call GetErrorDescription().
+//          This function is used by the application's main thread.
+// Type:    Method.
+// Args:    vCmdData    - (RW) Command meta data.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::CmdExecute(const SMICmdData &vCmdData)
+{
+    bool bOk = MIstatus::success;
+
+    // Pass the command's meta data structure to the command
+    // so it can update it if required. (Need to copy it out of the
+    // command before the command is deleted)
+    CMICmdBase *pCmd = nullptr;
+    bOk = m_factory.CmdCreate(vCmdData.strMiCmd, vCmdData, pCmd);
+    if (!bOk)
+    {
+        const CMIUtilString errMsg(
+            CMIUtilString::Format(MIRSRC(IDS_CMDMGR_ERR_CMD_FAILED_CREATE), m_factory.GetErrorDescription().c_str()));
+        SetErrorDescription(errMsg);
+        return MIstatus::failure;
+    }
+
+    bOk = m_invoker.CmdExecute(*pCmd);
+    if (!bOk)
+    {
+        const CMIUtilString errMsg(CMIUtilString::Format(MIRSRC(IDS_CMDMGR_ERR_CMD_INVOKER), m_invoker.GetErrorDescription().c_str()));
+        SetErrorDescription(errMsg);
+        return MIstatus::failure;
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Iterate all interested clients and tell them a command is being deleted.
+// Type:    Method.
+// Args:    vCmdData    - (RW) The command to be deleted.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::CmdDelete(SMICmdData vCmdData)
+{
+    // Note vCmdData is a copy! The command holding its copy will be deleted soon
+    // we still need to iterate callback clients after a command object is deleted
+
+    m_setCmdDeleteCallback.Delete(vCmdData);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Register an object to be called when a command object is deleted.
+// Type:    Method.
+// Args:    vObject - (R) A new interested client.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::CmdRegisterForDeleteNotification(CMICmdMgrSetCmdDeleteCallback::ICallback &vObject)
+{
+    return m_setCmdDeleteCallback.Register(vObject);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Unregister an object from being called when a command object is deleted.
+// Type:    Method.
+// Args:    vObject - (R) The was interested client.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdMgr::CmdUnregisterForDeleteNotification(CMICmdMgrSetCmdDeleteCallback::ICallback &vObject)
+{
+    return m_setCmdDeleteCallback.Unregister(vObject);
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdMgr.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdMgr.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdMgr.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdMgr.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdMgr.h
+// File:        MICmdMgr.h
 //
-// Overview:	CMICmdMgr interface.
+// Overview:    CMICmdMgr interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -33,51 +33,49 @@
 // Declarations:
 class CMICmdInterpreter;
 class CMICmdFactory;
-class CMICmdInvoker;	
+class CMICmdInvoker;
 class CMICmdBase;
 
 //++ ============================================================================
-// Details:	MI command manager. Oversees command operations, controls command
-//			production and the running of commands. 
-//			Command Invoker, Command Factory and Command Monitor while independant
-//			units are overseen/managed by *this manager.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 19/02/2014.
-// Changes:	None.
+// Details: MI command manager. Oversees command operations, controls command
+//          production and the running of commands.
+//          Command Invoker, Command Factory and Command Monitor while independant
+//          units are overseen/managed by *this manager.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 19/02/2014.
+// Changes: None.
 //--
-class CMICmdMgr 
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmdMgr >
+class CMICmdMgr : public CMICmnBase, public MI::ISingleton<CMICmdMgr>
 {
-	friend class MI::ISingleton< CMICmdMgr >;
+    friend class MI::ISingleton<CMICmdMgr>;
 
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	
-	bool	CmdInterpret( const CMIUtilString & vTextLine, bool & vwbYesValid, bool & vwbCmdNotInCmdFactor, SMICmdData & rwCmdData );
-	bool	CmdExecute( const SMICmdData & vCmdData );
-	bool	CmdDelete( SMICmdData vCmdData );
-	bool	CmdRegisterForDeleteNotification( CMICmdMgrSetCmdDeleteCallback::ICallback & vObject );
-	bool	CmdUnregisterForDeleteNotification( CMICmdMgrSetCmdDeleteCallback::ICallback & vObject );
-
-// Methods:
-private:
-	/* ctor */	CMICmdMgr( void );
-	/* ctor */	CMICmdMgr( const CMICmdMgr & );
-	void		operator=( const CMICmdMgr & );
-	
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmdMgr( void );
-
-// Attributes:
-private:
-	CMICmdInterpreter &							m_interpretor;
-	CMICmdFactory &								m_factory;
-	CMICmdInvoker &								m_invoker;
-	CMICmdMgrSetCmdDeleteCallback::CSetClients	m_setCmdDeleteCallback;
-};
\ No newline at end of file
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+
+    bool CmdInterpret(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
+    bool CmdExecute(const SMICmdData &vCmdData);
+    bool CmdDelete(SMICmdData vCmdData);
+    bool CmdRegisterForDeleteNotification(CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
+    bool CmdUnregisterForDeleteNotification(CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmdMgr(void);
+    /* ctor */ CMICmdMgr(const CMICmdMgr &);
+    void operator=(const CMICmdMgr &);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmdMgr(void);
+
+    // Attributes:
+  private:
+    CMICmdInterpreter &m_interpretor;
+    CMICmdFactory &m_factory;
+    CMICmdInvoker &m_invoker;
+    CMICmdMgrSetCmdDeleteCallback::CSetClients m_setCmdDeleteCallback;
+};

Modified: lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdMgrSetCmdDeleteCallback.cpp
+// File:        MICmdMgrSetCmdDeleteCallback.cpp
 //
-// Overview:	CSetClients implementation.
+// Overview:    CSetClients implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -26,85 +26,88 @@ namespace CMICmdMgrSetCmdDeleteCallback
 {
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CSetClients constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CSetClients constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CSetClients::CSetClients( void )
-:	m_bClientUnregistered( false )
+CSetClients::CSetClients(void)
+    : m_bClientUnregistered(false)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CSetClients destructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CSetClients destructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CSetClients::~CSetClients( void )
+CSetClients::~CSetClients(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Register an object to be called when a command object is deleted.
-// Type:	Method.
-// Args:	vObject	- (R) A new interested client.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Register an object to be called when a command object is deleted.
+// Type:    Method.
+// Args:    vObject - (R) A new interested client.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CSetClients::Register( ICallback & vObject )
+bool
+CSetClients::Register(ICallback &vObject)
 {
-	insert( &vObject );
+    insert(&vObject);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Unregister an object from being called when a command object is deleted.
-// Type:	Method.
-// Args:	vObject	- (R) The was interested client.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Unregister an object from being called when a command object is deleted.
+// Type:    Method.
+// Args:    vObject - (R) The was interested client.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CSetClients::Unregister( ICallback & vObject )
+bool
+CSetClients::Unregister(ICallback &vObject)
 {
-	m_bClientUnregistered = true;
-	erase( &vObject );
+    m_bClientUnregistered = true;
+    erase(&vObject);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Iterate all interested clients and tell them a command is being deleted.
-// Type:	Method.
-// Args:	vCmd	- (RW) The command to be deleted.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-void CSetClients::Delete( SMICmdData & vCmd )
-{
-	m_bClientUnregistered = false;	// Reset
-	iterator it = begin();
-	while( it != end() )
-	{
-		ICallback * pObj = *it;
-		pObj->Delete( vCmd );
-
-		if( m_bClientUnregistered )
-		{
-			m_bClientUnregistered = false;	// Reset
-			it = begin();
-		}
-		else
-			// Next
-			++it;
-	}
+// Details: Iterate all interested clients and tell them a command is being deleted.
+// Type:    Method.
+// Args:    vCmd    - (RW) The command to be deleted.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+void
+CSetClients::Delete(SMICmdData &vCmd)
+{
+    m_bClientUnregistered = false; // Reset
+    iterator it = begin();
+    while (it != end())
+    {
+        ICallback *pObj = *it;
+        pObj->Delete(vCmd);
+
+        if (m_bClientUnregistered)
+        {
+            m_bClientUnregistered = false; // Reset
+            it = begin();
+        }
+        else
+            // Next
+            ++it;
+    }
 }
 
 } // namespace CMICmdMgrSetCmdDeleteCallback

Modified: lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h Mon Nov 17 12:06:21 2014
@@ -8,16 +8,16 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmdMgrSetCmdDeleteCallback.h
+// File:        MICmdMgrSetCmdDeleteCallback.h
 //
-// Overview:	ICallback	interface.
-//				CSetClients interface.
+// Overview:    ICallback   interface.
+//              CSetClients interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -35,54 +35,52 @@ namespace CMICmdMgrSetCmdDeleteCallback
 {
 
 //++ ============================================================================
-// Details:	MI Command Manager interface for client call back.
-//			Objects that want to be notified of a command being deleted
-//			inherit this interface and register interest in command object
-//			deletion. An object deleting a command must not do it itself but call 
-//			the Command Manager CmdDelete() function to delete a command object.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 21/02/2014.
-// Changes:	None.
+// Details: MI Command Manager interface for client call back.
+//          Objects that want to be notified of a command being deleted
+//          inherit this interface and register interest in command object
+//          deletion. An object deleting a command must not do it itself but call
+//          the Command Manager CmdDelete() function to delete a command object.
+// Gotchas: None.
+// Authors: Illya Rudkin 21/02/2014.
+// Changes: None.
 //--
 class ICallback
 {
-public:
-	virtual void Delete( SMICmdData & vCmd ) = 0;
+  public:
+    virtual void Delete(SMICmdData &vCmd) = 0;
 
-	/* dtor */ virtual ~ICallback( void ) {};
+    /* dtor */ virtual ~ICallback(void){};
 };
 
 //++ ============================================================================
-// Details:	MI Command Manager container for clients registered interest in command
-//			objects being deleted. Objects register an interest so when a command
-//			is to be deleted that object wanting the delete calls the Command
-//			Manager to delete the command object. In so do all other registered
-//			objects get called to about the deletion including the object wanting
-//			to do the delete in the first place. 
-// Gotchas:	None.
-// Authors:	Illya Rudkin 21/02/2014.
-// Changes:	None.
+// Details: MI Command Manager container for clients registered interest in command
+//          objects being deleted. Objects register an interest so when a command
+//          is to be deleted that object wanting the delete calls the Command
+//          Manager to delete the command object. In so do all other registered
+//          objects get called to about the deletion including the object wanting
+//          to do the delete in the first place.
+// Gotchas: None.
+// Authors: Illya Rudkin 21/02/2014.
+// Changes: None.
 //--
-class CSetClients
-:	public std::set< class ICallback * >
-,	public CMICmnBase
+class CSetClients : public std::set<class ICallback *>, public CMICmnBase
 {
-// Methods:
-public:
-	/* ctor */	CSetClients( void );
-	
-	bool	Register( class ICallback & vObject );
-	bool	Unregister( class ICallback & vObject );
-	void	Delete( SMICmdData & vCmdData );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CSetClients( void );
-
-// Attributes:
-private:
-	bool	m_bClientUnregistered;	// True = yes while deleting a client unregistered, false = no client unregistered during deletion
+    // Methods:
+  public:
+    /* ctor */ CSetClients(void);
+
+    bool Register(class ICallback &vObject);
+    bool Unregister(class ICallback &vObject);
+    void Delete(SMICmdData &vCmdData);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CSetClients(void);
+
+    // Attributes:
+  private:
+    bool m_bClientUnregistered; // True = yes while deleting a client unregistered, false = no client unregistered during deletion
 };
 
 } // namespace CMICmdMgrSetCmdDeleteCallback

Modified: lldb/trunk/tools/lldb-mi/MICmnBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnBase.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnBase.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnBase.cpp Mon Nov 17 12:06:21 2014
@@ -8,19 +8,19 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnBase.cpp
+// File:        MICmnBase.cpp
 //
-// Overview:	CMICmnBase implementation.
+// Overview:    CMICmnBase implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third party headers
-#include <stdarg.h>		// va_list, va_start, var_end
+#include <stdarg.h> // va_list, va_start, var_end
 
 // In-house headers:
 #include "MICmnBase.h"
@@ -28,117 +28,123 @@
 #include "MICmnStreamStderr.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnBase constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnBase constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnBase::CMICmnBase( void )
-:	m_strMILastErrorDescription( CMIUtilString() )
-,	m_bInitialized( false )
-,	m_pLog( &CMICmnLog::Instance() )
-,	m_clientUsageRefCnt( 0 )
+CMICmnBase::CMICmnBase(void)
+    : m_strMILastErrorDescription(CMIUtilString())
+    , m_bInitialized(false)
+    , m_pLog(&CMICmnLog::Instance())
+    , m_clientUsageRefCnt(0)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnBase destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnBase destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnBase::~CMICmnBase( void )
+CMICmnBase::~CMICmnBase(void)
 {
-	m_pLog = NULL;
+    m_pLog = NULL;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve whether *this object has an error description set.
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = Yes already defined, false = empty discription.
-// Throws:	None.
+// Details: Retrieve whether *this object has an error description set.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = Yes already defined, false = empty discription.
+// Throws:  None.
 //--
-bool CMICmnBase::HaveErrorDescription( void ) const
+bool
+CMICmnBase::HaveErrorDescription(void) const
 {
-	return m_strMILastErrorDescription.empty();
+    return m_strMILastErrorDescription.empty();
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve MI's last error condition.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString & - Text description.
-// Throws:	None.
+// Details: Retrieve MI's last error condition.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - Text description.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnBase::GetErrorDescription( void ) const
+const CMIUtilString &
+CMICmnBase::GetErrorDescription(void) const
 {
-	return m_strMILastErrorDescription;
+    return m_strMILastErrorDescription;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Set MI's error condition description. This may be accessed by clients and
-//			seen by users.  Message is available to the client using the server and sent
-//			to the Logger.
-// Type:	Method.
-// Args:	vrTxt	- (R) Text description.
-// Return:	None.
-// Throws:	None.
+// Details: Set MI's error condition description. This may be accessed by clients and
+//          seen by users.  Message is available to the client using the server and sent
+//          to the Logger.
+// Type:    Method.
+// Args:    vrTxt   - (R) Text description.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnBase::SetErrorDescription( const CMIUtilString & vrTxt ) const
+void
+CMICmnBase::SetErrorDescription(const CMIUtilString &vrTxt) const
 {
-	m_strMILastErrorDescription = vrTxt;
-	if( !vrTxt.empty() )
-	{
-		const CMIUtilString txt( CMIUtilString::Format( "Error: %s", vrTxt.c_str() ) );
-		CMICmnStreamStderr::Instance().Write( txt );
-	}
+    m_strMILastErrorDescription = vrTxt;
+    if (!vrTxt.empty())
+    {
+        const CMIUtilString txt(CMIUtilString::Format("Error: %s", vrTxt.c_str()));
+        CMICmnStreamStderr::Instance().Write(txt);
+    }
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set MI's error condition description. This may be accessed by clients and
-//			seen by users.  Message is available to the client using the server and sent
-//			to the Logger.
-// Type:	Method.
-// Args:	vrTxt	- (R) Text description.
-// Return:	None.
-// Throws:	None.
+// Details: Set MI's error condition description. This may be accessed by clients and
+//          seen by users.  Message is available to the client using the server and sent
+//          to the Logger.
+// Type:    Method.
+// Args:    vrTxt   - (R) Text description.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnBase::SetErrorDescriptionNoLog( const CMIUtilString & vrTxt ) const
+void
+CMICmnBase::SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const
 {
-	m_strMILastErrorDescription = vrTxt;
+    m_strMILastErrorDescription = vrTxt;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Clear MI's error condition description.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: Clear MI's error condition description.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnBase::ClrErrorDescription( void ) const
+void
+CMICmnBase::ClrErrorDescription(void) const
 {
-	m_strMILastErrorDescription.clear();
+    m_strMILastErrorDescription.clear();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set MI's error condition description. This may be accessed by clients and
-//			seen by users. Message is available to the client using the server and sent
-//			to the Logger.
-// Type:	Method.
-// Args:	vFormat	- (R) Format string.
-//			...		- (R) Variable number of CMIUtilString type objects.
-// Return:	None.
-// Throws:	None.
+// Details: Set MI's error condition description. This may be accessed by clients and
+//          seen by users. Message is available to the client using the server and sent
+//          to the Logger.
+// Type:    Method.
+// Args:    vFormat - (R) Format string.
+//          ...     - (R) Variable number of CMIUtilString type objects.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnBase::SetErrorDescriptionn( const CMIUtilString vFormat, ... ) const
+void
+CMICmnBase::SetErrorDescriptionn(const CMIUtilString vFormat, ...) const
 {
-	va_list args;
-	va_start( args, vFormat );
-	CMIUtilString strResult = CMIUtilString::FormatValist( vFormat, args );
-	va_end( args );
+    va_list args;
+    va_start(args, vFormat);
+    CMIUtilString strResult = CMIUtilString::FormatValist(vFormat, args);
+    va_end(args);
 
-	SetErrorDescription( strResult );
+    SetErrorDescription(strResult);
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnBase.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnBase.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnBase.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnBase.h Mon Nov 17 12:06:21 2014
@@ -8,53 +8,53 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnBase.h
+// File:        MICmnBase.h
 //
-// Overview:	CMICmnBase interface.
+// Overview:    CMICmnBase interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
 
 // In-house headers:
-#include "MIDataTypes.h"  
+#include "MIDataTypes.h"
 #include "MIUtilString.h"
 
 // Declarations:
 class CMICmnLog;
 
 //++ ============================================================================
-// Details:	MI common code implementation base class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 28/01/2014.
-// Changes:	None.
+// Details: MI common code implementation base class.
+// Gotchas: None.
+// Authors: Illya Rudkin 28/01/2014.
+// Changes: None.
 //--
 class CMICmnBase
 {
-// Methods:
-public:
-	/* ctor */	CMICmnBase( void );
-	
-	bool					HaveErrorDescription( void ) const;
-	const CMIUtilString &	GetErrorDescription( void ) const;
-	void					SetErrorDescription( const CMIUtilString & vrTxt ) const;
-	void					SetErrorDescriptionn( const CMIUtilString vFormat, ... ) const;
-	void					SetErrorDescriptionNoLog( const CMIUtilString & vrTxt ) const;
-	void					ClrErrorDescription( void ) const;
-
-// Overrideable:
-public:
-	/* dtor */ virtual ~CMICmnBase( void );
-
-// Attributes:
-protected:
-	mutable CMIUtilString	m_strMILastErrorDescription;
-	bool					m_bInitialized;					// True = yes successfully initialized, false = no yet or failed
-	CMICmnLog *				m_pLog;							// Allow all derived classes to use the logger
-	MIint					m_clientUsageRefCnt;			// Count of client using *this object so not shutdown() object to early
-};
\ No newline at end of file
+    // Methods:
+  public:
+    /* ctor */ CMICmnBase(void);
+
+    bool HaveErrorDescription(void) const;
+    const CMIUtilString &GetErrorDescription(void) const;
+    void SetErrorDescription(const CMIUtilString &vrTxt) const;
+    void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
+    void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
+    void ClrErrorDescription(void) const;
+
+    // Overrideable:
+  public:
+    /* dtor */ virtual ~CMICmnBase(void);
+
+    // Attributes:
+  protected:
+    mutable CMIUtilString m_strMILastErrorDescription;
+    bool m_bInitialized;       // True = yes successfully initialized, false = no yet or failed
+    CMICmnLog *m_pLog;         // Allow all derived classes to use the logger
+    MIint m_clientUsageRefCnt; // Count of client using *this object so not shutdown() object to early
+};

Modified: lldb/trunk/tools/lldb-mi/MICmnConfig.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnConfig.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnConfig.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnConfig.h Mon Nov 17 12:06:21 2014
@@ -8,22 +8,22 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnConfig.h
+// File:        MICmnConfig.h
 //
-// Overview:	Common defines to guide feature inclusion at compile time.
+// Overview:    Common defines to guide feature inclusion at compile time.
 //
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 #pragma once
 
 // 1 = Yes compile MI Driver version, 0 = compile original LLDB driver code only.
 // 0 was mainly just for testing purposes and so may be removed at a later time.
-#define MICONFIG_COMPILE_MIDRIVER_VERSION 1	
+#define MICONFIG_COMPILE_MIDRIVER_VERSION 1
 
 // 1 = Show debug process attach modal dialog, 0 = do not show
 // For windows only ATM, other OS's code is an infinite loop which a debugger must change a value to continue
@@ -47,4 +47,4 @@
 #define MICONFIG_GIVE_WARNING_CMD_ARGS_NOT_HANDLED 1
 
 // 1 = Enable MI Driver in MI mode to create a local debug session, 0 = Report "Not implemented"
-#define MICONFIG_ENABLE_MI_DRIVER_MI_MODE_CMDLINE_ARG_EXECUTABLE_DEBUG_SESSION 0
\ No newline at end of file
+#define MICONFIG_ENABLE_MI_DRIVER_MI_MODE_CMDLINE_ARG_EXECUTABLE_DEBUG_SESSION 0

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.cpp Mon Nov 17 12:06:21 2014
@@ -8,82 +8,83 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBBroadcaster.cpp
+// File:        MICmnLLDBBroadcaster.cpp
 //
-// Overview:	CMICmnLLDBBroadcaster implementation.
+// Overview:    CMICmnLLDBBroadcaster implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
 #include "MICmnLLDBBroadcaster.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBBroadcaster constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBBroadcaster constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBBroadcaster::CMICmnLLDBBroadcaster( void )
-:	lldb::SBBroadcaster( "MI driver" )
+CMICmnLLDBBroadcaster::CMICmnLLDBBroadcaster(void)
+    : lldb::SBBroadcaster("MI driver")
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBBroadcaster destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBBroadcaster destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBBroadcaster::~CMICmnLLDBBroadcaster( void )
+CMICmnLLDBBroadcaster::~CMICmnLLDBBroadcaster(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this broardcaster object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Initialize resources for *this broardcaster object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBBroadcaster::Initialize( void )
+bool
+CMICmnLLDBBroadcaster::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = MIstatus::success;
-	
-	return m_bInitialized;
+    m_bInitialized = MIstatus::success;
+
+    return m_bInitialized;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this broardcaster object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Release resources for *this broardcaster object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBBroadcaster::Shutdown( void )
+bool
+CMICmnLLDBBroadcaster::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	return MIstatus::success;
-}	
+    m_bInitialized = false;
 
+    return MIstatus::success;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBBroadcaster.h
+// File:        MICmnLLDBBroadcaster.h
 //
-// Overview:	CMICmnLLDBBroadcaster interface.
+// Overview:    CMICmnLLDBBroadcaster interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -27,35 +27,32 @@
 #include "MIUtilSingletonBase.h"
 
 //++ ============================================================================
-// Details:	MI derived class from LLDB SBBroardcaster API.
+// Details: MI derived class from LLDB SBBroardcaster API.
 //
-//			*** This class (files) is a place holder until we know we need it or
-//			*** not
+//          *** This class (files) is a place holder until we know we need it or
+//          *** not
 //
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 28/02/2014.
-// Changes:	None.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 28/02/2014.
+// Changes: None.
 //--
-class CMICmnLLDBBroadcaster
-:	public CMICmnBase
-,	public lldb::SBBroadcaster
-,	public MI::ISingleton< CMICmnLLDBBroadcaster >
+class CMICmnLLDBBroadcaster : public CMICmnBase, public lldb::SBBroadcaster, public MI::ISingleton<CMICmnLLDBBroadcaster>
 {
-	friend MI::ISingleton< CMICmnLLDBBroadcaster >;
+    friend MI::ISingleton<CMICmnLLDBBroadcaster>;
 
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-// Methods:
-private:
-	/* ctor */	CMICmnLLDBBroadcaster( void );
-	/* ctor */	CMICmnLLDBBroadcaster( const CMICmnLLDBBroadcaster & );
-	void		operator=( const CMICmnLLDBBroadcaster & );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLLDBBroadcaster( void );
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    // Methods:
+  private:
+    /* ctor */ CMICmnLLDBBroadcaster(void);
+    /* ctor */ CMICmnLLDBBroadcaster(const CMICmnLLDBBroadcaster &);
+    void operator=(const CMICmnLLDBBroadcaster &);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLLDBBroadcaster(void);
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp Mon Nov 17 12:06:21 2014
@@ -8,24 +8,24 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugSessionInfo.cpp
+// File:        MICmnLLDBDebugSessionInfo.cpp
 //
-// Overview:	CMICmnLLDBDebugSessionInfo implementation.
+// Overview:    CMICmnLLDBDebugSessionInfo implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third party headers:
 #include <lldb/API/SBThread.h>
 #ifdef _WIN32
-	#include <io.h>			// For the ::_access()
+#include <io.h> // For the ::_access()
 #else
-	#include <unistd.h>		// For the ::access()
-#endif // _WIN32
+#include <unistd.h> // For the ::access()
+#endif              // _WIN32
 #include <lldb/API/SBBreakpointLocation.h>
 
 // In-house headers:
@@ -40,1273 +40,1328 @@
 #include "MICmnLLDBUtilSBValue.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfo constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmnLLDBDebugSessionInfo::CMICmnLLDBDebugSessionInfo( void )
-:	m_rLldbDebugger( CMICmnLLDBDebugger::Instance().GetTheDebugger() )
-,	m_rLlldbListener( CMICmnLLDBDebugger::Instance().GetTheListener() )
-,	m_nBrkPointCntMax( INT32_MAX )
-,	m_currentSelectedThread( LLDB_INVALID_THREAD_ID )
-,	m_constStrSharedDataKeyWkDir( "Working Directory" )
-,	m_constStrSharedDataSolibPath( "Solib Path" )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfo destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmnLLDBDebugSessionInfo::~CMICmnLLDBDebugSessionInfo( void )
-{
-	Shutdown();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::Initialize( void )
-{
-	m_clientUsageRefCnt++;
-
-	if( m_bInitialized )
-		return MIstatus::success;
-
-	m_currentSelectedThread = LLDB_INVALID_THREAD_ID;
-	CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero();
-
-	m_bInitialized = MIstatus::success;
-	
-	return m_bInitialized;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::Shutdown( void )
-{
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-	
-	// Tidy up
-	bOk = SharedDataDestroy();
-	if( !bOk )
-	{
-		errMsg = CMIUtilString::Format( MIRSRC( IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE ) );
-		errMsg += "\n";
-	}
-	m_vecActiveThreadId.clear();
-	CMICmnLLDBDebugSessionInfoVarObj::VarObjClear();
-
-	m_bInitialized = false;
-
-	return MIstatus::success;
-}	
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Command instances can create and share data between other instances of commands.
-//			Data can also be assigned by a command and retrieved by LLDB event handler.
-//			This function takes down those resources build up over the use of the commands.
-//			This function should be called when the creation and running of command has 
-//			stopped i.e. application shutdown.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::SharedDataDestroy( void )
-{
-	m_mapIdToSessionData.Clear();
-	m_vecVarObj.clear();
-	m_mapBrkPtIdToBrkPtInfo.clear();
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Record information about a LLDB break point so that is can be recalled in other
-//			commands or LLDB event handling functions.
-// Type:	Method.
-// Args:	vBrkPtId		- (R) LLDB break point ID.
-//			vrBrkPtInfo		- (R) Break point information object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfo( const MIuint vnBrkPtId, const SBrkPtInfo & vrBrkPtInfo )
-{
-	MapPairBrkPtIdToBrkPtInfo_t pr( vnBrkPtId, vrBrkPtInfo );
-	m_mapBrkPtIdToBrkPtInfo.insert( pr );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve information about a LLDB break point previous recorded either by
-//			commands or LLDB event handling functions.
-// Type:	Method.
-// Args:	vBrkPtId		- (R) LLDB break point ID.
-//			vrwBrkPtInfo		- (W) Break point information object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoGet( const MIuint vnBrkPtId, SBrkPtInfo & vrwBrkPtInfo ) const
-{
-	const MapBrkPtIdToBrkPtInfo_t::const_iterator it = m_mapBrkPtIdToBrkPtInfo.find( vnBrkPtId );
-	if( it != m_mapBrkPtIdToBrkPtInfo.end() )
-	{
-		vrwBrkPtInfo = (*it).second;
-		return MIstatus::success;
-	}
-
-	return MIstatus::failure;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Delete information about a specific LLDB break point object. This function 
-//			should be called when a LLDB break point is deleted.
-// Type:	Method.
-// Args:	vBrkPtId		- (R) LLDB break point ID.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoDelete( const MIuint vnBrkPtId )
-{
-	const MapBrkPtIdToBrkPtInfo_t::const_iterator it = m_mapBrkPtIdToBrkPtInfo.find( vnBrkPtId );
-	if( it != m_mapBrkPtIdToBrkPtInfo.end() )
-	{
-		m_mapBrkPtIdToBrkPtInfo.erase( it );
-		return MIstatus::success;
-	}
-
-	return MIstatus::failure;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the specified thread's frame information.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vThreadIdx		- (R) Thread index.
-//			vwrThreadFrames	- (W) Frame data.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetThreadFrames( const SMICmdData & vCmdData, const MIuint vThreadIdx, CMIUtilString & vwrThreadFrames ) 
-{
-	lldb::SBThread thread = m_lldbProcess.GetThreadByIndexID( vThreadIdx );
-	const uint32_t nFrames = thread.GetNumFrames();
-	if( nFrames == 0 )
-	{
-		// MI print "frame={}"
-		CMICmnMIValueTuple miValueTuple;
-		CMICmnMIValueResult miValueResult( "frame", miValueTuple );
-		vwrThreadFrames = miValueResult.GetString();
-		return MIstatus::success;
-	}
-
-	// MI print "frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"}, ..."
-	CMIUtilString strListCommaSeperated;
-	for( MIuint nLevel = 0; nLevel < nFrames; nLevel++ )
-	{
-		lldb::SBFrame frame = thread.GetFrameAtIndex( nLevel );
-		lldb::addr_t pc = 0;
-		CMIUtilString fnName;
-		CMIUtilString fileName;
-		CMIUtilString path; 
-		MIuint nLine = 0;
-		if( !GetFrameInfo( frame, pc, fnName, fileName, path, nLine ) )
-			return MIstatus::failure;
-
-		// Function args
-		CMICmnMIValueList miValueList( true );
-		const MIuint maskVarTypes = 0x1000;
-		if( !MIResponseFormVariableInfo( frame, maskVarTypes, miValueList ) )
-			return MIstatus::failure;
-
-		const MIchar * pUnknown = "??";
-		if( fnName != pUnknown )
-		{
-			std::replace( fnName.begin(), fnName.end(), ')', ' ' );
-			std::replace( fnName.begin(), fnName.end(), '(', ' ' );
-			std::replace( fnName.begin(), fnName.end(), '\'', ' ' );
-		}
-
-		CMICmnMIValueTuple miValueTuple;
-		const CMIUtilString strLevel( CMIUtilString::Format( "%d", nLevel ) );
-		const CMICmnMIValueConst miValueConst( strLevel );
-		const CMICmnMIValueResult miValueResult( "level", miValueConst );
-		miValueTuple.Add( miValueResult );
-		if( !MIResponseFormFrameInfo2( pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple ) )
-			return MIstatus::failure;
-
-		const CMICmnMIValueResult miValueResult2( "frame", miValueTuple );
-		if( nLevel != 0 )
-			strListCommaSeperated += ",";
-		strListCommaSeperated += miValueResult2.GetString();
-	}
+// Details: CMICmnLLDBDebugSessionInfo constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmnLLDBDebugSessionInfo::CMICmnLLDBDebugSessionInfo(void)
+    : m_rLldbDebugger(CMICmnLLDBDebugger::Instance().GetTheDebugger())
+    , m_rLlldbListener(CMICmnLLDBDebugger::Instance().GetTheListener())
+    , m_nBrkPointCntMax(INT32_MAX)
+    , m_currentSelectedThread(LLDB_INVALID_THREAD_ID)
+    , m_constStrSharedDataKeyWkDir("Working Directory")
+    , m_constStrSharedDataSolibPath("Solib Path")
+{
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmnLLDBDebugSessionInfo destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmnLLDBDebugSessionInfo::~CMICmnLLDBDebugSessionInfo(void)
+{
+    Shutdown();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Initialize resources for *this object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::Initialize(void)
+{
+    m_clientUsageRefCnt++;
+
+    if (m_bInitialized)
+        return MIstatus::success;
+
+    m_currentSelectedThread = LLDB_INVALID_THREAD_ID;
+    CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero();
+
+    m_bInitialized = MIstatus::success;
+
+    return m_bInitialized;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Release resources for *this object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::Shutdown(void)
+{
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
 
-	vwrThreadFrames = strListCommaSeperated;
+    // Tidy up
+    bOk = SharedDataDestroy();
+    if (!bOk)
+    {
+        errMsg = CMIUtilString::Format(MIRSRC(IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE));
+        errMsg += "\n";
+    }
+    m_vecActiveThreadId.clear();
+    CMICmnLLDBDebugSessionInfoVarObj::VarObjClear();
 
-	return MIstatus::success;
+    m_bInitialized = false;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Command instances can create and share data between other instances of commands.
+//          Data can also be assigned by a command and retrieved by LLDB event handler.
+//          This function takes down those resources build up over the use of the commands.
+//          This function should be called when the creation and running of command has
+//          stopped i.e. application shutdown.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::SharedDataDestroy(void)
+{
+    m_mapIdToSessionData.Clear();
+    m_vecVarObj.clear();
+    m_mapBrkPtIdToBrkPtInfo.clear();
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Record information about a LLDB break point so that is can be recalled in other
+//          commands or LLDB event handling functions.
+// Type:    Method.
+// Args:    vBrkPtId        - (R) LLDB break point ID.
+//          vrBrkPtInfo     - (R) Break point information object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::RecordBrkPtInfo(const MIuint vnBrkPtId, const SBrkPtInfo &vrBrkPtInfo)
+{
+    MapPairBrkPtIdToBrkPtInfo_t pr(vnBrkPtId, vrBrkPtInfo);
+    m_mapBrkPtIdToBrkPtInfo.insert(pr);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve information about a LLDB break point previous recorded either by
+//          commands or LLDB event handling functions.
+// Type:    Method.
+// Args:    vBrkPtId        - (R) LLDB break point ID.
+//          vrwBrkPtInfo    - (W) Break point information object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoGet(const MIuint vnBrkPtId, SBrkPtInfo &vrwBrkPtInfo) const
+{
+    const MapBrkPtIdToBrkPtInfo_t::const_iterator it = m_mapBrkPtIdToBrkPtInfo.find(vnBrkPtId);
+    if (it != m_mapBrkPtIdToBrkPtInfo.end())
+    {
+        vrwBrkPtInfo = (*it).second;
+        return MIstatus::success;
+    }
+
+    return MIstatus::failure;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Delete information about a specific LLDB break point object. This function
+//          should be called when a LLDB break point is deleted.
+// Type:    Method.
+// Args:    vBrkPtId        - (R) LLDB break point ID.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoDelete(const MIuint vnBrkPtId)
+{
+    const MapBrkPtIdToBrkPtInfo_t::const_iterator it = m_mapBrkPtIdToBrkPtInfo.find(vnBrkPtId);
+    if (it != m_mapBrkPtIdToBrkPtInfo.end())
+    {
+        m_mapBrkPtIdToBrkPtInfo.erase(it);
+        return MIstatus::success;
+    }
+
+    return MIstatus::failure;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve the specified thread's frame information.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vThreadIdx      - (R) Thread index.
+//          vwrThreadFrames - (W) Frame data.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetThreadFrames(const SMICmdData &vCmdData, const MIuint vThreadIdx, CMIUtilString &vwrThreadFrames)
+{
+    lldb::SBThread thread = m_lldbProcess.GetThreadByIndexID(vThreadIdx);
+    const uint32_t nFrames = thread.GetNumFrames();
+    if (nFrames == 0)
+    {
+        // MI print "frame={}"
+        CMICmnMIValueTuple miValueTuple;
+        CMICmnMIValueResult miValueResult("frame", miValueTuple);
+        vwrThreadFrames = miValueResult.GetString();
+        return MIstatus::success;
+    }
+
+    // MI print
+    // "frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},
+    // ..."
+    CMIUtilString strListCommaSeperated;
+    for (MIuint nLevel = 0; nLevel < nFrames; nLevel++)
+    {
+        lldb::SBFrame frame = thread.GetFrameAtIndex(nLevel);
+        lldb::addr_t pc = 0;
+        CMIUtilString fnName;
+        CMIUtilString fileName;
+        CMIUtilString path;
+        MIuint nLine = 0;
+        if (!GetFrameInfo(frame, pc, fnName, fileName, path, nLine))
+            return MIstatus::failure;
+
+        // Function args
+        CMICmnMIValueList miValueList(true);
+        const MIuint maskVarTypes = 0x1000;
+        if (!MIResponseFormVariableInfo(frame, maskVarTypes, miValueList))
+            return MIstatus::failure;
+
+        const MIchar *pUnknown = "??";
+        if (fnName != pUnknown)
+        {
+            std::replace(fnName.begin(), fnName.end(), ')', ' ');
+            std::replace(fnName.begin(), fnName.end(), '(', ' ');
+            std::replace(fnName.begin(), fnName.end(), '\'', ' ');
+        }
+
+        CMICmnMIValueTuple miValueTuple;
+        const CMIUtilString strLevel(CMIUtilString::Format("%d", nLevel));
+        const CMICmnMIValueConst miValueConst(strLevel);
+        const CMICmnMIValueResult miValueResult("level", miValueConst);
+        miValueTuple.Add(miValueResult);
+        if (!MIResponseFormFrameInfo2(pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple))
+            return MIstatus::failure;
+
+        const CMICmnMIValueResult miValueResult2("frame", miValueTuple);
+        if (nLevel != 0)
+            strListCommaSeperated += ",";
+        strListCommaSeperated += miValueResult2.GetString();
+    }
+
+    vwrThreadFrames = strListCommaSeperated;
+
+    return MIstatus::success;
 }
 
 // Todo: Refactor maybe to so only one function with this name, but not just yet
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the specified thread's frame information.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vThreadIdx		- (R) Thread index.
-//			vwrThreadFrames	- (W) Frame data.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetThreadFrames2( const SMICmdData & vCmdData, const MIuint vThreadIdx, CMIUtilString & vwrThreadFrames ) 
-{
-	lldb::SBThread thread = m_lldbProcess.GetThreadByIndexID( vThreadIdx );
-	const uint32_t nFrames = thread.GetNumFrames();
-	if( nFrames == 0 )
-	{
-		// MI print "frame={}"
-		CMICmnMIValueTuple miValueTuple;
-		CMICmnMIValueResult miValueResult( "frame", miValueTuple );
-		vwrThreadFrames = miValueResult.GetString();
-		return MIstatus::success;
-	}
-
-	// MI print "frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"}, ..."
-	CMIUtilString strListCommaSeperated;
-	for( MIuint nLevel = 0; nLevel < nFrames; nLevel++ )
-	{
-		lldb::SBFrame frame = thread.GetFrameAtIndex( nLevel );
-		lldb::addr_t pc = 0;
-		CMIUtilString fnName;
-		CMIUtilString fileName;
-		CMIUtilString path; 
-		MIuint nLine = 0;
-		if( !GetFrameInfo( frame, pc, fnName, fileName, path, nLine ) )
-			return MIstatus::failure;
-
-		// Function args
-		CMICmnMIValueList miValueList( true );
-		const MIuint maskVarTypes = 0x1000;
-		if( !MIResponseFormVariableInfo2( frame, maskVarTypes, miValueList ) )
-			return MIstatus::failure;
-
-		const MIchar * pUnknown = "??";
-		if( fnName != pUnknown )
-		{
-			std::replace( fnName.begin(), fnName.end(), ')', ' ' );
-			std::replace( fnName.begin(), fnName.end(), '(', ' ' );
-			std::replace( fnName.begin(), fnName.end(), '\'', ' ' );
-		}
-
-		CMICmnMIValueTuple miValueTuple;
-		const CMIUtilString strLevel( CMIUtilString::Format( "%d", nLevel ) );
-		const CMICmnMIValueConst miValueConst( strLevel );
-		const CMICmnMIValueResult miValueResult( "level", miValueConst );
-		miValueTuple.Add( miValueResult );
-		if( !MIResponseFormFrameInfo2( pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple ) )
-			return MIstatus::failure;
-
-		const CMICmnMIValueResult miValueResult2( "frame", miValueTuple );
-		if( nLevel != 0 )
-			strListCommaSeperated += ",";
-		strListCommaSeperated += miValueResult2.GetString();
-	}
-
-	vwrThreadFrames = strListCommaSeperated;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Return the resolved file's path for the given file.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vPath			- (R) Original path.
-//			vwrResolvedPath	- (W) Resolved path.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::ResolvePath( const SMICmdData & vCmdData, const CMIUtilString & vPath, CMIUtilString & vwrResolvedPath )
-{
-	// ToDo: Verify this code as it does not work as vPath is always empty
-
-	CMIUtilString strResolvedPath;
-	if( !SharedDataRetrieve< CMIUtilString >( m_constStrSharedDataKeyWkDir, strResolvedPath ) )
-	{
-		vwrResolvedPath = "";
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_SHARED_DATA_NOT_FOUND ), vCmdData.strMiCmd.c_str(), m_constStrSharedDataKeyWkDir.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	vwrResolvedPath = vPath;
-
-	return ResolvePath( strResolvedPath, vwrResolvedPath );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Return the resolved file's path for the given file.
-// Type:	Method.
-// Args:	vstrUnknown		- (R)	String assigned to path when resolved path is empty.
-//			vwrResolvedPath	- (RW)	The original path overwritten with resolved path.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::ResolvePath( const CMIUtilString & vstrUnknown, CMIUtilString & vwrResolvedPath )
-{
-	if( vwrResolvedPath.size() < 1 )
-	{
-		vwrResolvedPath = vstrUnknown;
-		return MIstatus::success;
-	}
-
-	bool bOk = MIstatus::success;
-
-	CMIUtilString::VecString_t vecPathFolders;
-	const MIuint nSplits = vwrResolvedPath.Split( "/", vecPathFolders ); MIunused( nSplits );
-	MIuint nFoldersBack = 1; // 1 is just the file (last element of vector)
-	while( bOk && (vecPathFolders.size() >= nFoldersBack) )
-	{
-		CMIUtilString strTestPath;
-		MIuint nFoldersToAdd = nFoldersBack;
-		while( nFoldersToAdd > 0 )
-		{
-			strTestPath += "/";
-			strTestPath += vecPathFolders[ vecPathFolders.size() - nFoldersToAdd ];
-			nFoldersToAdd--;
-		}
-		bool bYesAccessible = false;
-		bOk = AccessPath( strTestPath, bYesAccessible );
-		if( bYesAccessible )
-		{
-			vwrResolvedPath = strTestPath;
-			return MIstatus::success;
-		}
-		else
-			nFoldersBack++;
-	}
-	
-	// No files exist in the union of working directory and debuginfo path
+// Details: Retrieve the specified thread's frame information.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vThreadIdx      - (R) Thread index.
+//          vwrThreadFrames - (W) Frame data.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetThreadFrames2(const SMICmdData &vCmdData, const MIuint vThreadIdx, CMIUtilString &vwrThreadFrames)
+{
+    lldb::SBThread thread = m_lldbProcess.GetThreadByIndexID(vThreadIdx);
+    const uint32_t nFrames = thread.GetNumFrames();
+    if (nFrames == 0)
+    {
+        // MI print "frame={}"
+        CMICmnMIValueTuple miValueTuple;
+        CMICmnMIValueResult miValueResult("frame", miValueTuple);
+        vwrThreadFrames = miValueResult.GetString();
+        return MIstatus::success;
+    }
+
+    // MI print
+    // "frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},frame={level=\"%d\",addr=\"0x%08llx\",func=\"%s\",args=[%s],file=\"%s\",fullname=\"%s\",line=\"%d\"},
+    // ..."
+    CMIUtilString strListCommaSeperated;
+    for (MIuint nLevel = 0; nLevel < nFrames; nLevel++)
+    {
+        lldb::SBFrame frame = thread.GetFrameAtIndex(nLevel);
+        lldb::addr_t pc = 0;
+        CMIUtilString fnName;
+        CMIUtilString fileName;
+        CMIUtilString path;
+        MIuint nLine = 0;
+        if (!GetFrameInfo(frame, pc, fnName, fileName, path, nLine))
+            return MIstatus::failure;
+
+        // Function args
+        CMICmnMIValueList miValueList(true);
+        const MIuint maskVarTypes = 0x1000;
+        if (!MIResponseFormVariableInfo2(frame, maskVarTypes, miValueList))
+            return MIstatus::failure;
+
+        const MIchar *pUnknown = "??";
+        if (fnName != pUnknown)
+        {
+            std::replace(fnName.begin(), fnName.end(), ')', ' ');
+            std::replace(fnName.begin(), fnName.end(), '(', ' ');
+            std::replace(fnName.begin(), fnName.end(), '\'', ' ');
+        }
+
+        CMICmnMIValueTuple miValueTuple;
+        const CMIUtilString strLevel(CMIUtilString::Format("%d", nLevel));
+        const CMICmnMIValueConst miValueConst(strLevel);
+        const CMICmnMIValueResult miValueResult("level", miValueConst);
+        miValueTuple.Add(miValueResult);
+        if (!MIResponseFormFrameInfo2(pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple))
+            return MIstatus::failure;
+
+        const CMICmnMIValueResult miValueResult2("frame", miValueTuple);
+        if (nLevel != 0)
+            strListCommaSeperated += ",";
+        strListCommaSeperated += miValueResult2.GetString();
+    }
+
+    vwrThreadFrames = strListCommaSeperated;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Return the resolved file's path for the given file.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vPath           - (R) Original path.
+//          vwrResolvedPath - (W) Resolved path.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::ResolvePath(const SMICmdData &vCmdData, const CMIUtilString &vPath, CMIUtilString &vwrResolvedPath)
+{
+    // ToDo: Verify this code as it does not work as vPath is always empty
+
+    CMIUtilString strResolvedPath;
+    if (!SharedDataRetrieve<CMIUtilString>(m_constStrSharedDataKeyWkDir, strResolvedPath))
+    {
+        vwrResolvedPath = "";
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SHARED_DATA_NOT_FOUND), vCmdData.strMiCmd.c_str(),
+                                                  m_constStrSharedDataKeyWkDir.c_str()));
+        return MIstatus::failure;
+    }
+
+    vwrResolvedPath = vPath;
+
+    return ResolvePath(strResolvedPath, vwrResolvedPath);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Return the resolved file's path for the given file.
+// Type:    Method.
+// Args:    vstrUnknown     - (R)   String assigned to path when resolved path is empty.
+//          vwrResolvedPath - (RW)  The original path overwritten with resolved path.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::ResolvePath(const CMIUtilString &vstrUnknown, CMIUtilString &vwrResolvedPath)
+{
+    if (vwrResolvedPath.size() < 1)
+    {
+        vwrResolvedPath = vstrUnknown;
+        return MIstatus::success;
+    }
+
+    bool bOk = MIstatus::success;
+
+    CMIUtilString::VecString_t vecPathFolders;
+    const MIuint nSplits = vwrResolvedPath.Split("/", vecPathFolders);
+    MIunused(nSplits);
+    MIuint nFoldersBack = 1; // 1 is just the file (last element of vector)
+    while (bOk && (vecPathFolders.size() >= nFoldersBack))
+    {
+        CMIUtilString strTestPath;
+        MIuint nFoldersToAdd = nFoldersBack;
+        while (nFoldersToAdd > 0)
+        {
+            strTestPath += "/";
+            strTestPath += vecPathFolders[vecPathFolders.size() - nFoldersToAdd];
+            nFoldersToAdd--;
+        }
+        bool bYesAccessible = false;
+        bOk = AccessPath(strTestPath, bYesAccessible);
+        if (bYesAccessible)
+        {
+            vwrResolvedPath = strTestPath;
+            return MIstatus::success;
+        }
+        else
+            nFoldersBack++;
+    }
+
+    // No files exist in the union of working directory and debuginfo path
     // Simply use the debuginfo path and let the IDE handle it.
-    
-	return bOk;
+
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine the given file path exists or not.
-// Type:	Method.
-// Args:	vPath				- (R) File name path.
-//			vwbYesAccessible	- (W) True - file exists, false = does not exist.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Determine the given file path exists or not.
+// Type:    Method.
+// Args:    vPath               - (R) File name path.
+//          vwbYesAccessible    - (W) True - file exists, false = does not exist.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugSessionInfo::AccessPath( const CMIUtilString & vPath, bool & vwbYesAccessible )
+bool
+CMICmnLLDBDebugSessionInfo::AccessPath(const CMIUtilString &vPath, bool &vwbYesAccessible)
 {
 #ifdef _WIN32
-	vwbYesAccessible = (::_access( vPath.c_str(), 0 ) == 0);
+    vwbYesAccessible = (::_access(vPath.c_str(), 0) == 0);
 #else
-	vwbYesAccessible = (::access( vPath.c_str(), 0 ) == 0);
+    vwbYesAccessible = (::access(vPath.c_str(), 0) == 0);
 #endif // _WIN32
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vrThread		- (R) LLDB thread object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple )
-{
-	lldb::SBThread & rThread = const_cast< lldb::SBThread & >( vrThread );
-	
-	CMIUtilString strFrames;
-	if( !GetThreadFrames( vCmdData, rThread.GetIndexID(), strFrames ) )
-		return MIstatus::failure;
-
-	const bool bSuspended = rThread.IsSuspended();
-	const lldb::StopReason eReason = rThread.GetStopReason();
-	const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
-	const CMIUtilString strState( (bSuspended || bValidReason) ? "stopped" : "running" );
-	
-	// Add "id"
-	const CMIUtilString strId( CMIUtilString::Format( "%d", rThread.GetIndexID() ) );
-	const CMICmnMIValueConst miValueConst1( strId );
-	const CMICmnMIValueResult miValueResult1( "id", miValueConst1 );
-	if( !vwrMIValueTuple.Add( miValueResult1 ) )
-		return MIstatus::failure;
-
-	// Add "target-id"
-	const MIchar * pThreadName = rThread.GetName();
-	const MIuint len = (pThreadName != nullptr) ? CMIUtilString( pThreadName ).length() : 0;
-	const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) && CMIUtilString::IsAllValidAlphaAndNumeric( *pThreadName ) );	// 32 is arbitary number 
-	const MIchar * pThrdFmt = bHaveName ? "%s" : "Thread %d";	
-	CMIUtilString strThread;
-	if( bHaveName )
-		strThread = CMIUtilString::Format( pThrdFmt, pThreadName );
-	else
-		strThread = CMIUtilString::Format( pThrdFmt, rThread.GetIndexID() );
-	const CMICmnMIValueConst miValueConst2( strThread );
-	const CMICmnMIValueResult miValueResult2( "target-id", miValueConst2 );
-	if( !vwrMIValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-
-	// Add "frame"
-	const CMICmnMIValueConst miValueConst3( strFrames, true );
-	if( !vwrMIValueTuple.Add( miValueConst3, false ) )
-		return MIstatus::failure;
-
-	// Add "state"
-	const CMICmnMIValueConst miValueConst4( strState );
-	const CMICmnMIValueResult miValueResult4( "state", miValueConst4 );
-	if( !vwrMIValueTuple.Add( miValueResult4 ) )
-		return MIstatus::failure;
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vrThread        - (R) LLDB thread object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo(const SMICmdData &vCmdData, const lldb::SBThread &vrThread,
+                                                     CMICmnMIValueTuple &vwrMIValueTuple)
+{
+    lldb::SBThread &rThread = const_cast<lldb::SBThread &>(vrThread);
+
+    CMIUtilString strFrames;
+    if (!GetThreadFrames(vCmdData, rThread.GetIndexID(), strFrames))
+        return MIstatus::failure;
+
+    const bool bSuspended = rThread.IsSuspended();
+    const lldb::StopReason eReason = rThread.GetStopReason();
+    const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
+    const CMIUtilString strState((bSuspended || bValidReason) ? "stopped" : "running");
+
+    // Add "id"
+    const CMIUtilString strId(CMIUtilString::Format("%d", rThread.GetIndexID()));
+    const CMICmnMIValueConst miValueConst1(strId);
+    const CMICmnMIValueResult miValueResult1("id", miValueConst1);
+    if (!vwrMIValueTuple.Add(miValueResult1))
+        return MIstatus::failure;
+
+    // Add "target-id"
+    const MIchar *pThreadName = rThread.GetName();
+    const MIuint len = (pThreadName != nullptr) ? CMIUtilString(pThreadName).length() : 0;
+    const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) &&
+                            CMIUtilString::IsAllValidAlphaAndNumeric(*pThreadName)); // 32 is arbitary number
+    const MIchar *pThrdFmt = bHaveName ? "%s" : "Thread %d";
+    CMIUtilString strThread;
+    if (bHaveName)
+        strThread = CMIUtilString::Format(pThrdFmt, pThreadName);
+    else
+        strThread = CMIUtilString::Format(pThrdFmt, rThread.GetIndexID());
+    const CMICmnMIValueConst miValueConst2(strThread);
+    const CMICmnMIValueResult miValueResult2("target-id", miValueConst2);
+    if (!vwrMIValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+
+    // Add "frame"
+    const CMICmnMIValueConst miValueConst3(strFrames, true);
+    if (!vwrMIValueTuple.Add(miValueConst3, false))
+        return MIstatus::failure;
+
+    // Add "state"
+    const CMICmnMIValueConst miValueConst4(strState);
+    const CMICmnMIValueResult miValueResult4("state", miValueConst4);
+    if (!vwrMIValueTuple.Add(miValueResult4))
+        return MIstatus::failure;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 // Todo: Refactor maybe to so only one function with this name, but not just yet
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vrThread		- (R) LLDB thread object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo3( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple )
-{
-	lldb::SBThread & rThread = const_cast< lldb::SBThread & >( vrThread );
-	
-	CMIUtilString strFrames;
-	if( !GetThreadFrames2( vCmdData, rThread.GetIndexID(), strFrames ) )
-		return MIstatus::failure;
-
-	const bool bSuspended = rThread.IsSuspended();
-	const lldb::StopReason eReason = rThread.GetStopReason();
-	const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
-	const CMIUtilString strState( (bSuspended || bValidReason) ? "stopped" : "running" );
-	
-	// Add "id"
-	const CMIUtilString strId( CMIUtilString::Format( "%d", rThread.GetIndexID() ) );
-	const CMICmnMIValueConst miValueConst1( strId );
-	const CMICmnMIValueResult miValueResult1( "id", miValueConst1 );
-	if( !vwrMIValueTuple.Add( miValueResult1 ) )
-		return MIstatus::failure;
-
-	// Add "target-id"
-	const MIchar * pThreadName = rThread.GetName();
-	const MIuint len = (pThreadName != nullptr) ? CMIUtilString( pThreadName ).length() : 0;
-	const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) && CMIUtilString::IsAllValidAlphaAndNumeric( *pThreadName ) );	// 32 is arbitary number 
-	const MIchar * pThrdFmt = bHaveName ? "%s" : "Thread %d";	
-	CMIUtilString strThread;
-	if( bHaveName )
-		strThread = CMIUtilString::Format( pThrdFmt, pThreadName );
-	else
-		strThread = CMIUtilString::Format( pThrdFmt, rThread.GetIndexID() );
-	const CMICmnMIValueConst miValueConst2( strThread );
-	const CMICmnMIValueResult miValueResult2( "target-id", miValueConst2 );
-	if( !vwrMIValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-
-	// Add "frame"
-	const CMICmnMIValueConst miValueConst3( strFrames, true );
-	if( !vwrMIValueTuple.Add( miValueConst3, false ) )
-		return MIstatus::failure;
-
-	// Add "state"
-	const CMICmnMIValueConst miValueConst4( strState );
-	const CMICmnMIValueResult miValueResult4( "state", miValueConst4 );
-	if( !vwrMIValueTuple.Add( miValueResult4 ) )
-		return MIstatus::failure;
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vrThread        - (R) LLDB thread object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo3(const SMICmdData &vCmdData, const lldb::SBThread &vrThread,
+                                                      CMICmnMIValueTuple &vwrMIValueTuple)
+{
+    lldb::SBThread &rThread = const_cast<lldb::SBThread &>(vrThread);
+
+    CMIUtilString strFrames;
+    if (!GetThreadFrames2(vCmdData, rThread.GetIndexID(), strFrames))
+        return MIstatus::failure;
+
+    const bool bSuspended = rThread.IsSuspended();
+    const lldb::StopReason eReason = rThread.GetStopReason();
+    const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
+    const CMIUtilString strState((bSuspended || bValidReason) ? "stopped" : "running");
+
+    // Add "id"
+    const CMIUtilString strId(CMIUtilString::Format("%d", rThread.GetIndexID()));
+    const CMICmnMIValueConst miValueConst1(strId);
+    const CMICmnMIValueResult miValueResult1("id", miValueConst1);
+    if (!vwrMIValueTuple.Add(miValueResult1))
+        return MIstatus::failure;
+
+    // Add "target-id"
+    const MIchar *pThreadName = rThread.GetName();
+    const MIuint len = (pThreadName != nullptr) ? CMIUtilString(pThreadName).length() : 0;
+    const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) &&
+                            CMIUtilString::IsAllValidAlphaAndNumeric(*pThreadName)); // 32 is arbitary number
+    const MIchar *pThrdFmt = bHaveName ? "%s" : "Thread %d";
+    CMIUtilString strThread;
+    if (bHaveName)
+        strThread = CMIUtilString::Format(pThrdFmt, pThreadName);
+    else
+        strThread = CMIUtilString::Format(pThrdFmt, rThread.GetIndexID());
+    const CMICmnMIValueConst miValueConst2(strThread);
+    const CMICmnMIValueResult miValueResult2("target-id", miValueConst2);
+    if (!vwrMIValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+
+    // Add "frame"
+    const CMICmnMIValueConst miValueConst3(strFrames, true);
+    if (!vwrMIValueTuple.Add(miValueConst3, false))
+        return MIstatus::failure;
+
+    // Add "state"
+    const CMICmnMIValueConst miValueConst4(strState);
+    const CMICmnMIValueResult miValueResult4("state", miValueConst4);
+    if (!vwrMIValueTuple.Add(miValueResult4))
+        return MIstatus::failure;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 // Todo: Refactor maybe to so only one function with this name, but not just yet
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vCmdData		- (R) A command's information.
-//			vrThread		- (R) LLDB thread object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo2( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple )
-{
-	lldb::SBThread & rThread = const_cast< lldb::SBThread & >( vrThread );
-	
-	const bool bSuspended = rThread.IsSuspended();
-	const lldb::StopReason eReason = rThread.GetStopReason();
-	const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
-	const CMIUtilString strState( (bSuspended || bValidReason) ? "stopped" : "running" );
-	
-	// Add "id"
-	const CMIUtilString strId( CMIUtilString::Format( "%d", rThread.GetIndexID() ) );
-	const CMICmnMIValueConst miValueConst1( strId );
-	const CMICmnMIValueResult miValueResult1( "id", miValueConst1 );
-	if( !vwrMIValueTuple.Add( miValueResult1 ) )
-		return MIstatus::failure;
-
-	// Add "target-id"
-	const MIchar * pThreadName = rThread.GetName();
-	const MIuint len = (pThreadName != nullptr) ? CMIUtilString( pThreadName ).length() : 0;
-	const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) && CMIUtilString::IsAllValidAlphaAndNumeric( *pThreadName ) );	// 32 is arbitary number 
-	const MIchar * pThrdFmt = bHaveName ? "%s" : "Thread %d";	
-	CMIUtilString strThread;
-	if( bHaveName )
-		strThread = CMIUtilString::Format( pThrdFmt, pThreadName );
-	else
-		strThread = CMIUtilString::Format( pThrdFmt, rThread.GetIndexID() );
-	const CMICmnMIValueConst miValueConst2( strThread );
-	const CMICmnMIValueResult miValueResult2( "target-id", miValueConst2 );
-	if( !vwrMIValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-
-	// Add "state"
-	const CMICmnMIValueConst miValueConst4( strState );
-	const CMICmnMIValueResult miValueResult4( "state", miValueConst4 );
-	if( !vwrMIValueTuple.Add( miValueResult4 ) )
-		return MIstatus::failure;
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vCmdData        - (R) A command's information.
+//          vrThread        - (R) LLDB thread object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo2(const SMICmdData &vCmdData, const lldb::SBThread &vrThread,
+                                                      CMICmnMIValueTuple &vwrMIValueTuple)
+{
+    lldb::SBThread &rThread = const_cast<lldb::SBThread &>(vrThread);
+
+    const bool bSuspended = rThread.IsSuspended();
+    const lldb::StopReason eReason = rThread.GetStopReason();
+    const bool bValidReason = !((eReason == lldb::eStopReasonNone) || (eReason == lldb::eStopReasonInvalid));
+    const CMIUtilString strState((bSuspended || bValidReason) ? "stopped" : "running");
+
+    // Add "id"
+    const CMIUtilString strId(CMIUtilString::Format("%d", rThread.GetIndexID()));
+    const CMICmnMIValueConst miValueConst1(strId);
+    const CMICmnMIValueResult miValueResult1("id", miValueConst1);
+    if (!vwrMIValueTuple.Add(miValueResult1))
+        return MIstatus::failure;
+
+    // Add "target-id"
+    const MIchar *pThreadName = rThread.GetName();
+    const MIuint len = (pThreadName != nullptr) ? CMIUtilString(pThreadName).length() : 0;
+    const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) &&
+                            CMIUtilString::IsAllValidAlphaAndNumeric(*pThreadName)); // 32 is arbitary number
+    const MIchar *pThrdFmt = bHaveName ? "%s" : "Thread %d";
+    CMIUtilString strThread;
+    if (bHaveName)
+        strThread = CMIUtilString::Format(pThrdFmt, pThreadName);
+    else
+        strThread = CMIUtilString::Format(pThrdFmt, rThread.GetIndexID());
+    const CMICmnMIValueConst miValueConst2(strThread);
+    const CMICmnMIValueResult miValueResult2("target-id", miValueConst2);
+    if (!vwrMIValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+
+    // Add "state"
+    const CMICmnMIValueConst miValueConst4(strState);
+    const CMICmnMIValueResult miValueResult4("state", miValueConst4);
+    if (!vwrMIValueTuple.Add(miValueResult4))
+        return MIstatus::failure;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 // Todo: Refactor maybe to so only one function with this name, but not just yet
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrFrame			- (R)	LLDB thread object.
-//			vMaskVarTypes	- (R)	0x1000 = arguments, 
-//									0x0100 = locals,
-//									0x0010 = statics,
-//									0x0001 = in scope only.
-//			vwrMIValueList	- (W)	MI value list object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo2( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList )
-{
-	bool bOk = MIstatus::success;
-	lldb::SBFrame & rFrame = const_cast< lldb::SBFrame & >( vrFrame );
-	
-	const bool bArg = (vMaskVarTypes & 0x1000);
-	const bool bLocals = (vMaskVarTypes & 0x0100);
-	const bool bStatics = (vMaskVarTypes & 0x0010);
-	const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
-	lldb::SBValueList listArg = rFrame.GetVariables( bArg, bLocals, bStatics, bInScopeOnly );
-	const MIuint nArgs = listArg.GetSize();
-	for( MIuint i = 0; bOk && (i < nArgs); i++ )
-	{
-		lldb::SBValue value = listArg.GetValueAtIndex( i );
-		const CMICmnLLDBUtilSBValue utilValue( value );
-		const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		CMICmnMIValueTuple miValueTuple( miValueResult );
-		const CMICmnMIValueConst miValueConst2( utilValue.GetValue() );
-		const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-		miValueTuple.Add( miValueResult2 );
-		bOk = vwrMiValueList.Add( miValueTuple );
-	}
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrFrame			- (R)	LLDB thread object.
-//			vMaskVarTypes	- (R)	0x1000 = arguments, 
-//									0x0100 = locals,
-//									0x0010 = statics,
-//									0x0001 = in scope only.
-//			vwrMIValueList	- (W)	MI value list object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList )
-{
-	bool bOk = MIstatus::success;
-	lldb::SBFrame & rFrame = const_cast< lldb::SBFrame & >( vrFrame );
-	
-	const bool bArg = (vMaskVarTypes & 0x1000);
-	const bool bLocals = (vMaskVarTypes & 0x0100);
-	const bool bStatics = (vMaskVarTypes & 0x0010);
-	const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
-	const MIuint nMaxRecusiveDepth = 10;
-	MIuint nCurrentRecursiveDepth = 0;
-	lldb::SBValueList listArg = rFrame.GetVariables( bArg, bLocals, bStatics, bInScopeOnly );
-	const MIuint nArgs = listArg.GetSize();
-	for( MIuint i = 0; bOk && (i < nArgs); i++ )
-	{
-		lldb::SBValue value = listArg.GetValueAtIndex( i );
-		bOk = GetVariableInfo( nMaxRecusiveDepth, value, false, vwrMiValueList, nCurrentRecursiveDepth );
-	}
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrFrame         - (R)   LLDB thread object.
+//          vMaskVarTypes   - (R)   0x1000 = arguments,
+//                                  0x0100 = locals,
+//                                  0x0010 = statics,
+//                                  0x0001 = in scope only.
+//          vwrMIValueList  - (W)   MI value list object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo2(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes,
+                                                        CMICmnMIValueList &vwrMiValueList)
+{
+    bool bOk = MIstatus::success;
+    lldb::SBFrame &rFrame = const_cast<lldb::SBFrame &>(vrFrame);
+
+    const bool bArg = (vMaskVarTypes & 0x1000);
+    const bool bLocals = (vMaskVarTypes & 0x0100);
+    const bool bStatics = (vMaskVarTypes & 0x0010);
+    const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
+    lldb::SBValueList listArg = rFrame.GetVariables(bArg, bLocals, bStatics, bInScopeOnly);
+    const MIuint nArgs = listArg.GetSize();
+    for (MIuint i = 0; bOk && (i < nArgs); i++)
+    {
+        lldb::SBValue value = listArg.GetValueAtIndex(i);
+        const CMICmnLLDBUtilSBValue utilValue(value);
+        const CMICmnMIValueConst miValueConst(utilValue.GetName());
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        CMICmnMIValueTuple miValueTuple(miValueResult);
+        const CMICmnMIValueConst miValueConst2(utilValue.GetValue());
+        const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+        miValueTuple.Add(miValueResult2);
+        bOk = vwrMiValueList.Add(miValueTuple);
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrFrame         - (R)   LLDB thread object.
+//          vMaskVarTypes   - (R)   0x1000 = arguments,
+//                                  0x0100 = locals,
+//                                  0x0010 = statics,
+//                                  0x0001 = in scope only.
+//          vwrMIValueList  - (W)   MI value list object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes,
+                                                       CMICmnMIValueList &vwrMiValueList)
+{
+    bool bOk = MIstatus::success;
+    lldb::SBFrame &rFrame = const_cast<lldb::SBFrame &>(vrFrame);
+
+    const bool bArg = (vMaskVarTypes & 0x1000);
+    const bool bLocals = (vMaskVarTypes & 0x0100);
+    const bool bStatics = (vMaskVarTypes & 0x0010);
+    const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
+    const MIuint nMaxRecusiveDepth = 10;
+    MIuint nCurrentRecursiveDepth = 0;
+    lldb::SBValueList listArg = rFrame.GetVariables(bArg, bLocals, bStatics, bInScopeOnly);
+    const MIuint nArgs = listArg.GetSize();
+    for (MIuint i = 0; bOk && (i < nArgs); i++)
+    {
+        lldb::SBValue value = listArg.GetValueAtIndex(i);
+        bOk = GetVariableInfo(nMaxRecusiveDepth, value, false, vwrMiValueList, nCurrentRecursiveDepth);
+    }
 
-	return bOk;
+    return bOk;
 }
 
 // *** Do not refactor this function to be one function with same name as it can break more than
 // *** than one stack type command
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrFrame			- (R)	LLDB thread object.
-//			vMaskVarTypes	- (R)	0x1000 = arguments, 
-//									0x0100 = locals,
-//									0x0010 = statics,
-//									0x0001 = in scope only.
-//			vwrMIValueList	- (W)	MI value list object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo3( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList )
-{
-	bool bOk = MIstatus::success;
-	lldb::SBFrame & rFrame = const_cast< lldb::SBFrame & >( vrFrame );
-	
-	const bool bArg = (vMaskVarTypes & 0x1000);
-	const bool bLocals = (vMaskVarTypes & 0x0100);
-	const bool bStatics = (vMaskVarTypes & 0x0010);
-	const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
-	const MIuint nMaxRecusiveDepth = 10;
-	MIuint nCurrentRecursiveDepth = 0;
-	lldb::SBValueList listArg = rFrame.GetVariables( bArg, bLocals, bStatics, bInScopeOnly );
-	const MIuint nArgs = listArg.GetSize();
-	for( MIuint i = 0; bOk && (i < nArgs); i++ )
-	{
-		lldb::SBValue value = listArg.GetValueAtIndex( i );
-		bOk = GetVariableInfo2( nMaxRecusiveDepth, value, false, vwrMiValueList, nCurrentRecursiveDepth );
-	}
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrFrame         - (R)   LLDB thread object.
+//          vMaskVarTypes   - (R)   0x1000 = arguments,
+//                                  0x0100 = locals,
+//                                  0x0010 = statics,
+//                                  0x0001 = in scope only.
+//          vwrMIValueList  - (W)   MI value list object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo3(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes,
+                                                        CMICmnMIValueList &vwrMiValueList)
+{
+    bool bOk = MIstatus::success;
+    lldb::SBFrame &rFrame = const_cast<lldb::SBFrame &>(vrFrame);
+
+    const bool bArg = (vMaskVarTypes & 0x1000);
+    const bool bLocals = (vMaskVarTypes & 0x0100);
+    const bool bStatics = (vMaskVarTypes & 0x0010);
+    const bool bInScopeOnly = (vMaskVarTypes & 0x0001);
+    const MIuint nMaxRecusiveDepth = 10;
+    MIuint nCurrentRecursiveDepth = 0;
+    lldb::SBValueList listArg = rFrame.GetVariables(bArg, bLocals, bStatics, bInScopeOnly);
+    const MIuint nArgs = listArg.GetSize();
+    for (MIuint i = 0; bOk && (i < nArgs); i++)
+    {
+        lldb::SBValue value = listArg.GetValueAtIndex(i);
+        bOk = GetVariableInfo2(nMaxRecusiveDepth, value, false, vwrMiValueList, nCurrentRecursiveDepth);
+    }
 
-	return bOk;
+    return bOk;
 }
 
 // *** Do not refactor this function to be one function with same name as it can break more than
 // *** than one stack type command
 //++ ------------------------------------------------------------------------------------
-// Details:	Extract the value's name and value or recurse into child value object.
-// Type:	Method.
-// Args:	vnMaxDepth		- (R)  The max recursive depth for this function.
-//			vrValue			- (R)  LLDB value object.
-//			vbIsChildValue	- (R)  True = Value object is a child of a higher Value object, 
-//							-      False =  Value object not a child. 
-//			vwrMIValueList	- (W)  MI value list object.
-//			vnDepth			- (RW) The current recursive depth of this function.
-//			// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetVariableInfo( const MIuint vnMaxDepth, const lldb::SBValue & vrValue, const bool vbIsChildValue, CMICmnMIValueList & vwrMiValueList, MIuint & vrwnDepth )
-{
-	// *** Update GetVariableInfo2() with any code changes here *** 
-
-	// Check recursive depth
-	if( vrwnDepth >= vnMaxDepth )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-	const CMICmnLLDBUtilSBValue utilValue( vrValue, true );
-	CMICmnMIValueTuple miValueTuple;
-	const MIchar * pName = rValue.GetName(); MIunused( pName );
-	const bool bIsPointerType = rValue.GetType().IsPointerType();
-	const MIuint nChildren = rValue.GetNumChildren();
-	if( nChildren == 0 )
-	{
-		if( vbIsChildValue )
-		{
-			if( utilValue.IsCharType() )
-			{
-				// For char types and try to form text string
-				const CMICmnMIValueConst miValueConst( utilValue.GetValue().c_str(), true );
-				miValueTuple.Add( miValueConst, true );
-			}
-			else
-			{
-				// For composite types
-				const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%s = %s", utilValue.GetName().c_str(), utilValue.GetValue().c_str() ), true );
-				miValueTuple.Add( miValueConst, true );
-			}
-			return vwrMiValueList.Add( CMICmnMIValueConst( miValueTuple.ExtractContentNoBrackets(), true ) );
-		}
-		else
-		{
-			// Basic types
-			const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-			const CMICmnMIValueResult miValueResult( "name", miValueConst );
-			miValueTuple.Add( miValueResult );
-			const CMICmnMIValueConst miValueConst2( utilValue.GetValue() );
-			const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-			miValueTuple.Add( miValueResult2 );
-			return vwrMiValueList.Add( miValueTuple );
-		}
-	}
-	else if( bIsPointerType && utilValue.IsChildCharType() )
-	{
-		// Append string text to the parent value information
-		const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		miValueTuple.Add( miValueResult );
-
-		const CMIUtilString & rText( utilValue.GetChildValueCString() );
-		if( rText.empty() )
-		{
-			const CMICmnMIValueConst miValueConst( utilValue.GetValue() );
-			const CMICmnMIValueResult miValueResult( "value", miValueConst );
-			miValueTuple.Add( miValueResult );
-		}
-		else
-		{
-			if( utilValue.IsValueUnknown() )
-			{
-				const CMICmnMIValueConst miValueConst( rText );
-				const CMICmnMIValueResult miValueResult( "value", miValueConst );
-				miValueTuple.Add( miValueResult );
-			}
-			else
-			{
-				// Note code that has const in will not show the text suffix to the string pointer
-				// i.e. const char * pMyStr = "blah"; ==> "0x00007000"" <-- Eclipse shows this
-				// but        char * pMyStr = "blah"; ==> "0x00007000" "blah"" <-- Eclipse shows this
-				const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%s %s", utilValue.GetValue().c_str(), rText.c_str() ) );
-				const CMICmnMIValueResult miValueResult( "value", miValueConst );
-				miValueTuple.Add( miValueResult );
-			}
-		}
-		return vwrMiValueList.Add( miValueTuple );
-	}
-	else if( bIsPointerType )
-	{
-		if( vbIsChildValue )
-		{
-			// For composite types
-			const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%s = %s", utilValue.GetName().c_str(), utilValue.GetValue().c_str() ), true );
-			miValueTuple.Add( miValueConst, true );
-			return vwrMiValueList.Add( CMICmnMIValueConst( miValueTuple.ExtractContentNoBrackets(), true ) );
-		}
-		else
-		{
-			// Basic types
-			const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-			const CMICmnMIValueResult miValueResult( "name", miValueConst );
-			miValueTuple.Add( miValueResult );
-			const CMICmnMIValueConst miValueConst2( utilValue.GetValue() );
-			const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-			miValueTuple.Add( miValueResult2 );
-			return vwrMiValueList.Add( miValueTuple );
-		}
-	}
-	else
-	{
-		// Build parent child composite types
-		CMICmnMIValueList miValueList( true );
-		for( MIuint i = 0; bOk && (i < nChildren); i++ )
-		{
-			lldb::SBValue member = rValue.GetChildAtIndex( i );
-			bOk	= GetVariableInfo( vnMaxDepth, member, true, miValueList, ++vrwnDepth );
-		}	
-		const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		miValueTuple.Add( miValueResult );
-		const CMICmnMIValueConst miValueConst2( CMIUtilString::Format( "{%s}", miValueList.ExtractContentNoBrackets().c_str() ) );
-		const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-		miValueTuple.Add( miValueResult2 );
-		return vwrMiValueList.Add( miValueTuple );
-	}
+// Details: Extract the value's name and value or recurse into child value object.
+// Type:    Method.
+// Args:    vnMaxDepth      - (R)  The max recursive depth for this function.
+//          vrValue         - (R)  LLDB value object.
+//          vbIsChildValue  - (R)  True = Value object is a child of a higher Value object,
+//                          -      False =  Value object not a child.
+//          vwrMIValueList  - (W)  MI value list object.
+//          vnDepth         - (RW) The current recursive depth of this function.
+//          // Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetVariableInfo(const MIuint vnMaxDepth, const lldb::SBValue &vrValue, const bool vbIsChildValue,
+                                            CMICmnMIValueList &vwrMiValueList, MIuint &vrwnDepth)
+{
+    // *** Update GetVariableInfo2() with any code changes here ***
+
+    // Check recursive depth
+    if (vrwnDepth >= vnMaxDepth)
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+    const CMICmnLLDBUtilSBValue utilValue(vrValue, true);
+    CMICmnMIValueTuple miValueTuple;
+    const MIchar *pName = rValue.GetName();
+    MIunused(pName);
+    const bool bIsPointerType = rValue.GetType().IsPointerType();
+    const MIuint nChildren = rValue.GetNumChildren();
+    if (nChildren == 0)
+    {
+        if (vbIsChildValue)
+        {
+            if (utilValue.IsCharType())
+            {
+                // For char types and try to form text string
+                const CMICmnMIValueConst miValueConst(utilValue.GetValue().c_str(), true);
+                miValueTuple.Add(miValueConst, true);
+            }
+            else
+            {
+                // For composite types
+                const CMICmnMIValueConst miValueConst(
+                    CMIUtilString::Format("%s = %s", utilValue.GetName().c_str(), utilValue.GetValue().c_str()), true);
+                miValueTuple.Add(miValueConst, true);
+            }
+            return vwrMiValueList.Add(CMICmnMIValueConst(miValueTuple.ExtractContentNoBrackets(), true));
+        }
+        else
+        {
+            // Basic types
+            const CMICmnMIValueConst miValueConst(utilValue.GetName());
+            const CMICmnMIValueResult miValueResult("name", miValueConst);
+            miValueTuple.Add(miValueResult);
+            const CMICmnMIValueConst miValueConst2(utilValue.GetValue());
+            const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+            miValueTuple.Add(miValueResult2);
+            return vwrMiValueList.Add(miValueTuple);
+        }
+    }
+    else if (bIsPointerType && utilValue.IsChildCharType())
+    {
+        // Append string text to the parent value information
+        const CMICmnMIValueConst miValueConst(utilValue.GetName());
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        miValueTuple.Add(miValueResult);
+
+        const CMIUtilString &rText(utilValue.GetChildValueCString());
+        if (rText.empty())
+        {
+            const CMICmnMIValueConst miValueConst(utilValue.GetValue());
+            const CMICmnMIValueResult miValueResult("value", miValueConst);
+            miValueTuple.Add(miValueResult);
+        }
+        else
+        {
+            if (utilValue.IsValueUnknown())
+            {
+                const CMICmnMIValueConst miValueConst(rText);
+                const CMICmnMIValueResult miValueResult("value", miValueConst);
+                miValueTuple.Add(miValueResult);
+            }
+            else
+            {
+                // Note code that has const in will not show the text suffix to the string pointer
+                // i.e. const char * pMyStr = "blah"; ==> "0x00007000"" <-- Eclipse shows this
+                // but        char * pMyStr = "blah"; ==> "0x00007000" "blah"" <-- Eclipse shows this
+                const CMICmnMIValueConst miValueConst(CMIUtilString::Format("%s %s", utilValue.GetValue().c_str(), rText.c_str()));
+                const CMICmnMIValueResult miValueResult("value", miValueConst);
+                miValueTuple.Add(miValueResult);
+            }
+        }
+        return vwrMiValueList.Add(miValueTuple);
+    }
+    else if (bIsPointerType)
+    {
+        if (vbIsChildValue)
+        {
+            // For composite types
+            const CMICmnMIValueConst miValueConst(
+                CMIUtilString::Format("%s = %s", utilValue.GetName().c_str(), utilValue.GetValue().c_str()), true);
+            miValueTuple.Add(miValueConst, true);
+            return vwrMiValueList.Add(CMICmnMIValueConst(miValueTuple.ExtractContentNoBrackets(), true));
+        }
+        else
+        {
+            // Basic types
+            const CMICmnMIValueConst miValueConst(utilValue.GetName());
+            const CMICmnMIValueResult miValueResult("name", miValueConst);
+            miValueTuple.Add(miValueResult);
+            const CMICmnMIValueConst miValueConst2(utilValue.GetValue());
+            const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+            miValueTuple.Add(miValueResult2);
+            return vwrMiValueList.Add(miValueTuple);
+        }
+    }
+    else
+    {
+        // Build parent child composite types
+        CMICmnMIValueList miValueList(true);
+        for (MIuint i = 0; bOk && (i < nChildren); i++)
+        {
+            lldb::SBValue member = rValue.GetChildAtIndex(i);
+            bOk = GetVariableInfo(vnMaxDepth, member, true, miValueList, ++vrwnDepth);
+        }
+        const CMICmnMIValueConst miValueConst(utilValue.GetName());
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        miValueTuple.Add(miValueResult);
+        const CMICmnMIValueConst miValueConst2(CMIUtilString::Format("{%s}", miValueList.ExtractContentNoBrackets().c_str()));
+        const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+        miValueTuple.Add(miValueResult2);
+        return vwrMiValueList.Add(miValueTuple);
+    }
 }
 
 // *** Do not refactor this function to be one function with same name as it can break more than
 // *** than one stack type command
 //++ ------------------------------------------------------------------------------------
-// Details:	Extract the value's name and value or recurse into child value object.
-// Type:	Method.
-// Args:	vnMaxDepth		- (R)  The max recursive depth for this function.
-//			vrValue			- (R)  LLDB value object.
-//			vbIsChildValue	- (R)  True = Value object is a child of a higher Value object, 
-//							-      False =  Value object not a child. 
-//			vwrMIValueList	- (W)  MI value list object.
-//			vnDepth			- (RW) The current recursive depth of this function.
-//			// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetVariableInfo2( const MIuint vnMaxDepth, const lldb::SBValue & vrValue, const bool vbIsChildValue, CMICmnMIValueList & vwrMiValueList, MIuint & vrwnDepth )
-{
-	// *** Update GetVariableInfo() with any code changes here *** 
-		
-	// Check recursive depth
-	if( vrwnDepth >= vnMaxDepth )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-	const CMICmnLLDBUtilSBValue utilValue( vrValue, true );
-	CMICmnMIValueTuple miValueTuple;
-	const MIchar * pName = rValue.GetName(); MIunused( pName );
-	const MIuint nChildren = rValue.GetNumChildren();
-	if( nChildren == 0 )
-	{
-		if( vbIsChildValue && utilValue.IsCharType() )
-		{
-			// For char types and try to form text string
-			const CMICmnMIValueConst miValueConst( utilValue.GetValue().c_str(), true );
-			miValueTuple.Add( miValueConst, true );
-			return vwrMiValueList.Add( CMICmnMIValueConst( miValueTuple.ExtractContentNoBrackets(), true ) );
-		}
-		else
-		{
-			// Basic types
-			const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-			const CMICmnMIValueResult miValueResult( "name", miValueConst );
-			miValueTuple.Add( miValueResult );
-			const CMICmnMIValueConst miValueConst2( utilValue.GetValue() );
-			const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-			miValueTuple.Add( miValueResult2 );
-			return vwrMiValueList.Add( miValueTuple );
-		}
-	}
-	else if( utilValue.IsChildCharType() )
-	{
-		// Append string text to the parent value information
-		const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		miValueTuple.Add( miValueResult );
-
-		const CMIUtilString & rText( utilValue.GetChildValueCString() );
-		if( rText.empty() )
-		{
-			const CMICmnMIValueConst miValueConst( utilValue.GetValue() );
-			const CMICmnMIValueResult miValueResult( "value", miValueConst );
-			miValueTuple.Add( miValueResult );
-		}
-		else
-		{
-			if( utilValue.IsValueUnknown() )
-			{
-				const CMICmnMIValueConst miValueConst( rText );
-				const CMICmnMIValueResult miValueResult( "value", miValueConst );
-				miValueTuple.Add( miValueResult );
-			}
-			else
-			{
-				// Note code that has const in will not show the text suffix to the string pointer
-				// i.e. const char * pMyStr = "blah"; ==> "0x00007000"" <-- Eclipse shows this
-				// but        char * pMyStr = "blah"; ==> "0x00007000" "blah"" <-- Eclipse shows this
-				const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%s %s", utilValue.GetValue().c_str(), rText.c_str() ) );
-				const CMICmnMIValueResult miValueResult( "value", miValueConst );
-				miValueTuple.Add( miValueResult );
-			}		
-		}
-		return vwrMiValueList.Add( miValueTuple );
-	}
-	else
-	{
-		// Build parent child composite types
-		CMICmnMIValueList miValueList( true );
-		for( MIuint i = 0; bOk && (i < nChildren); i++ )
-		{
-			lldb::SBValue member = rValue.GetChildAtIndex( i );
-			bOk	= GetVariableInfo( vnMaxDepth, member, true, miValueList, ++vrwnDepth );
-		}	
-		const CMICmnMIValueConst miValueConst( utilValue.GetName() );
-		const CMICmnMIValueResult miValueResult( "name", miValueConst );
-		miValueTuple.Add( miValueResult );
-		const CMICmnMIValueConst miValueConst2( CMIUtilString::Format( "{%s}", miValueList.ExtractContentNoBrackets().c_str() ) );
-		const CMICmnMIValueResult miValueResult2( "value", miValueConst2 );
-		miValueTuple.Add( miValueResult2 );
-		return vwrMiValueList.Add( miValueTuple );
-	}
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrThread		- (R) LLDB thread object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo( const lldb::SBThread & vrThread, const MIuint vnLevel, CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	lldb::SBThread & rThread = const_cast< lldb::SBThread & >( vrThread );
-	
-	lldb::SBFrame frame = rThread.GetFrameAtIndex( vnLevel );
-	lldb::addr_t pc = 0;
-	CMIUtilString fnName;
-	CMIUtilString fileName;
-	CMIUtilString path; 
-	MIuint nLine = 0;
-	if( !GetFrameInfo( frame, pc, fnName, fileName, path, nLine ) )
-		return MIstatus::failure;
-	
-	// MI print "{level=\"0\",addr=\"0x%08llx\",func=\"%s\",file=\"%s\",fullname=\"%s\",line=\"%d\"}"
-	const CMIUtilString strLevel( CMIUtilString::Format( "%d", vnLevel ) );
-	const CMICmnMIValueConst miValueConst( strLevel );
-	const CMICmnMIValueResult miValueResult( "level", miValueConst );
-	CMICmnMIValueTuple miValueTuple( miValueResult );
-	if( !MIResponseFormFrameInfo( pc, fnName, fileName, path, nLine, miValueTuple ) )
-		return MIstatus::failure;
-
-	vwrMiValueTuple = miValueTuple;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the frame information from LLDB frame object.
-// Type:	Method.
-// Args:	vrFrame			- (R) LLDB thread object.
-//			vPc				- (W) Address number.
-//			vFnName			- (W) Function name.
-//			vFileName		- (W) File name text.
-//			vPath			- (W) Full file name and path text.
-//			vnLine			- (W) File line number.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetFrameInfo( const lldb::SBFrame & vrFrame, lldb::addr_t & vwPc, CMIUtilString & vwFnName, CMIUtilString & vwFileName, CMIUtilString & vwPath, MIuint & vwnLine )
-{
-	lldb::SBFrame & rFrame = const_cast< lldb::SBFrame & >( vrFrame );
-
-	static char pBuffer[ MAX_PATH ];
-	const MIuint nBytes = rFrame.GetLineEntry().GetFileSpec().GetPath( &pBuffer[ 0 ], sizeof( pBuffer ) ); MIunused( nBytes );
-	CMIUtilString strResolvedPath( &pBuffer[ 0 ] );
-	const MIchar * pUnkwn = "??";
-	if( !ResolvePath( pUnkwn, strResolvedPath ) )
-		return MIstatus::failure;
-	vwPath = strResolvedPath;
-
-	vwPc = rFrame.GetPC();
-	
-	const MIchar * pFnName = rFrame.GetFunctionName();
-	vwFnName = (pFnName != nullptr) ? pFnName : pUnkwn;
-	
-	const MIchar * pFileName = rFrame.GetLineEntry().GetFileSpec().GetFilename();
-	vwFileName = (pFileName != nullptr) ? pFileName : pUnkwn;
-	
-	vwnLine = rFrame.GetLineEntry().GetLine();
-	
-	return MIstatus::success;
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vPc				- (R) Address number.
-//			vFnName			- (R) Function name.
-//			vFileName		- (R) File name text.
-//			vPath			- (R) Full file name and path text.
-//			vnLine			- (R) File line number.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo( const lldb::addr_t vPc, const CMIUtilString & vFnName, const CMIUtilString & vFileName, const CMIUtilString & vPath, const MIuint vnLine, CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	const CMIUtilString strAddr( CMIUtilString::Format( "0x%08llx", vPc ) );
-	const CMICmnMIValueConst miValueConst2( strAddr );
-	const CMICmnMIValueResult miValueResult2( "addr", miValueConst2 );
-	if( !vwrMiValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst3( vFnName );
-	const CMICmnMIValueResult miValueResult3( "func", miValueConst3 );
-	if( !vwrMiValueTuple.Add( miValueResult3 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst5( vFileName );
-	const CMICmnMIValueResult miValueResult5( "file", miValueConst5 );
-	if( !vwrMiValueTuple.Add( miValueResult5 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst6( vPath );
-	const CMICmnMIValueResult miValueResult6( "fullname", miValueConst6 );
-	if( !vwrMiValueTuple.Add( miValueResult6 ) )
-		return MIstatus::failure;
-	const CMIUtilString strLine( CMIUtilString::Format( "%d", vnLine ) );
-	const CMICmnMIValueConst miValueConst7( strLine );
-	const CMICmnMIValueResult miValueResult7( "line", miValueConst7 );
-	if( !vwrMiValueTuple.Add( miValueResult7 ) )
-		return MIstatus::failure;
+// Details: Extract the value's name and value or recurse into child value object.
+// Type:    Method.
+// Args:    vnMaxDepth      - (R)  The max recursive depth for this function.
+//          vrValue         - (R)  LLDB value object.
+//          vbIsChildValue  - (R)  True = Value object is a child of a higher Value object,
+//                          -      False =  Value object not a child.
+//          vwrMIValueList  - (W)  MI value list object.
+//          vnDepth         - (RW) The current recursive depth of this function.
+//          // Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetVariableInfo2(const MIuint vnMaxDepth, const lldb::SBValue &vrValue, const bool vbIsChildValue,
+                                             CMICmnMIValueList &vwrMiValueList, MIuint &vrwnDepth)
+{
+    // *** Update GetVariableInfo() with any code changes here ***
+
+    // Check recursive depth
+    if (vrwnDepth >= vnMaxDepth)
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+    const CMICmnLLDBUtilSBValue utilValue(vrValue, true);
+    CMICmnMIValueTuple miValueTuple;
+    const MIchar *pName = rValue.GetName();
+    MIunused(pName);
+    const MIuint nChildren = rValue.GetNumChildren();
+    if (nChildren == 0)
+    {
+        if (vbIsChildValue && utilValue.IsCharType())
+        {
+            // For char types and try to form text string
+            const CMICmnMIValueConst miValueConst(utilValue.GetValue().c_str(), true);
+            miValueTuple.Add(miValueConst, true);
+            return vwrMiValueList.Add(CMICmnMIValueConst(miValueTuple.ExtractContentNoBrackets(), true));
+        }
+        else
+        {
+            // Basic types
+            const CMICmnMIValueConst miValueConst(utilValue.GetName());
+            const CMICmnMIValueResult miValueResult("name", miValueConst);
+            miValueTuple.Add(miValueResult);
+            const CMICmnMIValueConst miValueConst2(utilValue.GetValue());
+            const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+            miValueTuple.Add(miValueResult2);
+            return vwrMiValueList.Add(miValueTuple);
+        }
+    }
+    else if (utilValue.IsChildCharType())
+    {
+        // Append string text to the parent value information
+        const CMICmnMIValueConst miValueConst(utilValue.GetName());
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        miValueTuple.Add(miValueResult);
+
+        const CMIUtilString &rText(utilValue.GetChildValueCString());
+        if (rText.empty())
+        {
+            const CMICmnMIValueConst miValueConst(utilValue.GetValue());
+            const CMICmnMIValueResult miValueResult("value", miValueConst);
+            miValueTuple.Add(miValueResult);
+        }
+        else
+        {
+            if (utilValue.IsValueUnknown())
+            {
+                const CMICmnMIValueConst miValueConst(rText);
+                const CMICmnMIValueResult miValueResult("value", miValueConst);
+                miValueTuple.Add(miValueResult);
+            }
+            else
+            {
+                // Note code that has const in will not show the text suffix to the string pointer
+                // i.e. const char * pMyStr = "blah"; ==> "0x00007000"" <-- Eclipse shows this
+                // but        char * pMyStr = "blah"; ==> "0x00007000" "blah"" <-- Eclipse shows this
+                const CMICmnMIValueConst miValueConst(CMIUtilString::Format("%s %s", utilValue.GetValue().c_str(), rText.c_str()));
+                const CMICmnMIValueResult miValueResult("value", miValueConst);
+                miValueTuple.Add(miValueResult);
+            }
+        }
+        return vwrMiValueList.Add(miValueTuple);
+    }
+    else
+    {
+        // Build parent child composite types
+        CMICmnMIValueList miValueList(true);
+        for (MIuint i = 0; bOk && (i < nChildren); i++)
+        {
+            lldb::SBValue member = rValue.GetChildAtIndex(i);
+            bOk = GetVariableInfo(vnMaxDepth, member, true, miValueList, ++vrwnDepth);
+        }
+        const CMICmnMIValueConst miValueConst(utilValue.GetName());
+        const CMICmnMIValueResult miValueResult("name", miValueConst);
+        miValueTuple.Add(miValueResult);
+        const CMICmnMIValueConst miValueConst2(CMIUtilString::Format("{%s}", miValueList.ExtractContentNoBrackets().c_str()));
+        const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+        miValueTuple.Add(miValueResult2);
+        return vwrMiValueList.Add(miValueTuple);
+    }
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrThread        - (R) LLDB thread object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo(const lldb::SBThread &vrThread, const MIuint vnLevel,
+                                                    CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    lldb::SBThread &rThread = const_cast<lldb::SBThread &>(vrThread);
+
+    lldb::SBFrame frame = rThread.GetFrameAtIndex(vnLevel);
+    lldb::addr_t pc = 0;
+    CMIUtilString fnName;
+    CMIUtilString fileName;
+    CMIUtilString path;
+    MIuint nLine = 0;
+    if (!GetFrameInfo(frame, pc, fnName, fileName, path, nLine))
+        return MIstatus::failure;
+
+    // MI print "{level=\"0\",addr=\"0x%08llx\",func=\"%s\",file=\"%s\",fullname=\"%s\",line=\"%d\"}"
+    const CMIUtilString strLevel(CMIUtilString::Format("%d", vnLevel));
+    const CMICmnMIValueConst miValueConst(strLevel);
+    const CMICmnMIValueResult miValueResult("level", miValueConst);
+    CMICmnMIValueTuple miValueTuple(miValueResult);
+    if (!MIResponseFormFrameInfo(pc, fnName, fileName, path, nLine, miValueTuple))
+        return MIstatus::failure;
+
+    vwrMiValueTuple = miValueTuple;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve the frame information from LLDB frame object.
+// Type:    Method.
+// Args:    vrFrame         - (R) LLDB thread object.
+//          vPc             - (W) Address number.
+//          vFnName         - (W) Function name.
+//          vFileName       - (W) File name text.
+//          vPath           - (W) Full file name and path text.
+//          vnLine          - (W) File line number.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetFrameInfo(const lldb::SBFrame &vrFrame, lldb::addr_t &vwPc, CMIUtilString &vwFnName,
+                                         CMIUtilString &vwFileName, CMIUtilString &vwPath, MIuint &vwnLine)
+{
+    lldb::SBFrame &rFrame = const_cast<lldb::SBFrame &>(vrFrame);
+
+    static char pBuffer[MAX_PATH];
+    const MIuint nBytes = rFrame.GetLineEntry().GetFileSpec().GetPath(&pBuffer[0], sizeof(pBuffer));
+    MIunused(nBytes);
+    CMIUtilString strResolvedPath(&pBuffer[0]);
+    const MIchar *pUnkwn = "??";
+    if (!ResolvePath(pUnkwn, strResolvedPath))
+        return MIstatus::failure;
+    vwPath = strResolvedPath;
+
+    vwPc = rFrame.GetPC();
+
+    const MIchar *pFnName = rFrame.GetFunctionName();
+    vwFnName = (pFnName != nullptr) ? pFnName : pUnkwn;
+
+    const MIchar *pFileName = rFrame.GetLineEntry().GetFileSpec().GetFilename();
+    vwFileName = (pFileName != nullptr) ? pFileName : pUnkwn;
+
+    vwnLine = rFrame.GetLineEntry().GetLine();
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vPc             - (R) Address number.
+//          vFnName         - (R) Function name.
+//          vFileName       - (R) File name text.
+//          vPath           - (R) Full file name and path text.
+//          vnLine          - (R) File line number.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo(const lldb::addr_t vPc, const CMIUtilString &vFnName, const CMIUtilString &vFileName,
+                                                    const CMIUtilString &vPath, const MIuint vnLine, CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    const CMIUtilString strAddr(CMIUtilString::Format("0x%08llx", vPc));
+    const CMICmnMIValueConst miValueConst2(strAddr);
+    const CMICmnMIValueResult miValueResult2("addr", miValueConst2);
+    if (!vwrMiValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst3(vFnName);
+    const CMICmnMIValueResult miValueResult3("func", miValueConst3);
+    if (!vwrMiValueTuple.Add(miValueResult3))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst5(vFileName);
+    const CMICmnMIValueResult miValueResult5("file", miValueConst5);
+    if (!vwrMiValueTuple.Add(miValueResult5))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst6(vPath);
+    const CMICmnMIValueResult miValueResult6("fullname", miValueConst6);
+    if (!vwrMiValueTuple.Add(miValueResult6))
+        return MIstatus::failure;
+    const CMIUtilString strLine(CMIUtilString::Format("%d", vnLine));
+    const CMICmnMIValueConst miValueConst7(strLine);
+    const CMICmnMIValueResult miValueResult7("line", miValueConst7);
+    if (!vwrMiValueTuple.Add(miValueResult7))
+        return MIstatus::failure;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 // Todo: Refactor maybe to so only one function with this name, but not just yet
 //++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vPc				- (R) Address number.
-//			vArgInfo		- (R) Args information in MI response form.
-//			vFnName			- (R) Function name.
-//			vFileName		- (R) File name text.
-//			vPath			- (R) Full file name and path text.
-//			vnLine			- (R) File line number.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo2( const lldb::addr_t vPc, const CMIUtilString & vArgInfo, const CMIUtilString & vFnName, const CMIUtilString & vFileName, const CMIUtilString & vPath, const MIuint vnLine, CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	const CMIUtilString strAddr( CMIUtilString::Format( "0x%08llx", vPc ) );
-	const CMICmnMIValueConst miValueConst2( strAddr );
-	const CMICmnMIValueResult miValueResult2( "addr", miValueConst2 );
-	if( !vwrMiValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst3( vFnName );
-	const CMICmnMIValueResult miValueResult3( "func", miValueConst3 );
-	if( !vwrMiValueTuple.Add( miValueResult3 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst4( vArgInfo, true );
-	const CMICmnMIValueResult miValueResult4( "args", miValueConst4 );
-	if( !vwrMiValueTuple.Add( miValueResult4 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst5( vFileName );
-	const CMICmnMIValueResult miValueResult5( "file", miValueConst5 );
-	if( !vwrMiValueTuple.Add( miValueResult5 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst6( vPath );
-	const CMICmnMIValueResult miValueResult6( "fullname", miValueConst6 );
-	if( !vwrMiValueTuple.Add( miValueResult6 ) )
-		return MIstatus::failure;
-	const CMIUtilString strLine( CMIUtilString::Format( "%d", vnLine ) );
-	const CMICmnMIValueConst miValueConst7( strLine );
-	const CMICmnMIValueResult miValueResult7( "line", miValueConst7 );
-	if( !vwrMiValueTuple.Add( miValueResult7 ) )
-		return MIstatus::failure;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrBrkPtInfo		- (R) Break point information object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtFrameInfo( const SBrkPtInfo & vrBrkPtInfo, CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	const CMIUtilString strAddr( CMIUtilString::Format( "0x%08llx", vrBrkPtInfo.m_pc ) );
-	const CMICmnMIValueConst miValueConst2( strAddr );
-	const CMICmnMIValueResult miValueResult2( "addr", miValueConst2 );
-	if( !vwrMiValueTuple.Add( miValueResult2 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst3( vrBrkPtInfo.m_fnName );
-	const CMICmnMIValueResult miValueResult3( "func", miValueConst3 );
-	if( !vwrMiValueTuple.Add( miValueResult3 ) )
-		return MIstatus::failure;
-	const CMICmnMIValueConst miValueConst5( vrBrkPtInfo.m_fileName );
-	const CMICmnMIValueResult miValueResult5( "file", miValueConst5 );
-	if( !vwrMiValueTuple.Add( miValueResult5 ) )
-		return MIstatus::failure;
-	const CMIUtilString strN5 = CMIUtilString::Format( "%s/%s", vrBrkPtInfo.m_path.c_str(), vrBrkPtInfo.m_fileName.c_str() );
-	const CMICmnMIValueConst miValueConst6( strN5 );
-	const CMICmnMIValueResult miValueResult6( "fullname", miValueConst6 );
-	if( !vwrMiValueTuple.Add( miValueResult6 ) )
-		return MIstatus::failure;
-	const CMIUtilString strLine( CMIUtilString::Format( "%d", vrBrkPtInfo.m_nLine ) );
-	const CMICmnMIValueConst miValueConst7( strLine );
-	const CMICmnMIValueResult miValueResult7( "line", miValueConst7 );
-	if( !vwrMiValueTuple.Add( miValueResult7 ) )
-		return MIstatus::failure;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form MI partial response by appending more MI value type objects to the 
-//			tuple type object past in.
-// Type:	Method.
-// Args:	vrBrkPtInfo		- (R) Break point information object.
-//			vwrMIValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo( const SBrkPtInfo & vrBrkPtInfo, CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	// MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\", func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
-	
-	// "number="
-	const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%d", vrBrkPtInfo.m_id ) );
-	const CMICmnMIValueResult miValueResult( "number", miValueConst );
-	CMICmnMIValueTuple miValueTuple( miValueResult );
-	// "type="
-	const CMICmnMIValueConst miValueConst2( vrBrkPtInfo.m_strType );
-	const CMICmnMIValueResult miValueResult2( "type", miValueConst2 );
-	bool bOk = miValueTuple.Add( miValueResult2 );
-	// "disp="
-	const CMICmnMIValueConst miValueConst3( vrBrkPtInfo.m_bDisp ? "del" : "keep" );
-	const CMICmnMIValueResult miValueResult3( "disp", miValueConst3 );
-	bOk = bOk && miValueTuple.Add( miValueResult3 );
-	// "enabled="
-	const CMICmnMIValueConst miValueConst4( vrBrkPtInfo.m_bEnabled ? "y" : "n" );
-	const CMICmnMIValueResult miValueResult4( "enabled", miValueConst4 );
-	bOk = bOk && miValueTuple.Add( miValueResult4 );
-	// "addr="
-	// "func="
-	// "file="
-	// "fullname="
-	// "line="
-	bOk = bOk && MIResponseFormBrkPtFrameInfo( vrBrkPtInfo, miValueTuple );
-	// "pending="
-	if( vrBrkPtInfo.m_bPending )
-	{
-		const CMICmnMIValueConst miValueConst( vrBrkPtInfo.m_strOrigLoc );
-		const CMICmnMIValueList miValueList( miValueConst );
-		const CMICmnMIValueResult miValueResult( "pending", miValueList );
-		bOk = bOk && miValueTuple.Add( miValueResult );
-	}
-	if( vrBrkPtInfo.m_bHaveArgOptionThreadGrp )
-	{
-		const CMICmnMIValueConst miValueConst( vrBrkPtInfo.m_strOptThrdGrp );
-		const CMICmnMIValueList miValueList( miValueConst );
-		const CMICmnMIValueResult miValueResult( "thread-groups", miValueList );
-		bOk = bOk && miValueTuple.Add( miValueResult );
-	}
-	// "times="
-	const CMICmnMIValueConst miValueConstB( CMIUtilString::Format( "%d", vrBrkPtInfo.m_nTimes ) );
-	const CMICmnMIValueResult miValueResultB( "times", miValueConstB );
-	bOk = bOk && miValueTuple.Add( miValueResultB );
-	// "thread="
-	if( vrBrkPtInfo.m_bBrkPtThreadId )
-	{
-		const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%d", vrBrkPtInfo.m_nBrkPtThreadId ) );
-		const CMICmnMIValueResult miValueResult( "thread", miValueConst );
-		bOk = bOk && miValueTuple.Add( miValueResult );
-	}
-	// "cond="
-	if( vrBrkPtInfo.m_bCondition )
-	{
-		const CMICmnMIValueConst miValueConst( vrBrkPtInfo.m_strCondition );
-		const CMICmnMIValueResult miValueResult( "cond", miValueConst );
-		bOk = bOk && miValueTuple.Add( miValueResult );
-	}
-	// "ignore="
-	if( vrBrkPtInfo.m_nIgnore != 0 )
-	{
-		const CMICmnMIValueConst miValueConst( CMIUtilString::Format( "%d", vrBrkPtInfo.m_nIgnore ) );
-		const CMICmnMIValueResult miValueResult( "ignore", miValueConst );
-		bOk = bOk && miValueTuple.Add( miValueResult );
-	}
-	// "original-location="
-	const CMICmnMIValueConst miValueConstC( vrBrkPtInfo.m_strOrigLoc );
-	const CMICmnMIValueResult miValueResultC( "original-location", miValueConstC );
-	bOk = bOk && miValueTuple.Add( miValueResultC );
-
-	vwrMiValueTuple = miValueTuple;
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve breakpoint information and write into the given breakpoint information
-//			object. Note not all possible information is retrieved and so the information
-//			object may need to be filled in with more information after calling this 
-//			function. Mainly breakpoint location information of information that is 
-//			unlikely to change.
-// Type:	Method.
-// Args:	vBrkPt		- (R) LLDB break point object.
-//			vrBrkPtInfo	- (W) Break point information object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugSessionInfo::GetBrkPtInfo( const lldb::SBBreakpoint & vBrkPt, SBrkPtInfo & vrwBrkPtInfo ) const
-{
-	lldb::SBBreakpoint & rBrkPt = const_cast< lldb::SBBreakpoint & >( vBrkPt );
-	lldb::SBBreakpointLocation brkPtLoc = rBrkPt.GetLocationAtIndex( 0 );
-	lldb::SBAddress brkPtAddr = brkPtLoc.GetAddress();
-	lldb::SBSymbolContext symbolCntxt = brkPtAddr.GetSymbolContext( lldb::eSymbolContextEverything );
-	const MIchar * pUnkwn = "??";
-	lldb::SBModule rModule = symbolCntxt.GetModule();
-	const MIchar * pModule = rModule.IsValid() ? rModule.GetFileSpec().GetFilename() : pUnkwn; MIunused( pModule );
-	const MIchar * pFile = pUnkwn;
-	const MIchar * pFn = pUnkwn;
-	const MIchar * pFilePath = pUnkwn;
-	size_t nLine = 0;
-	const size_t nAddr = brkPtAddr.GetLoadAddress( m_lldbTarget );
-
-	lldb::SBCompileUnit rCmplUnit = symbolCntxt.GetCompileUnit();
-	if( rCmplUnit.IsValid() )
-	{
-		lldb::SBFileSpec rFileSpec = rCmplUnit.GetFileSpec();
-		pFile = rFileSpec.GetFilename();
-		pFilePath = rFileSpec.GetDirectory();
-		lldb::SBFunction rFn = symbolCntxt.GetFunction();
-		if( rFn.IsValid() )
-			pFn = rFn.GetName();
-		lldb::SBLineEntry rLnEntry = symbolCntxt.GetLineEntry();
-		if( rLnEntry.GetLine() > 0 )
-			nLine = rLnEntry.GetLine();
-	}
-
-	vrwBrkPtInfo.m_id = vBrkPt.GetID();				
-	vrwBrkPtInfo.m_strType = "breakpoint";			
-	vrwBrkPtInfo.m_pc = nAddr;						
-	vrwBrkPtInfo.m_fnName = pFn;					
-	vrwBrkPtInfo.m_fileName = pFile;				
-	vrwBrkPtInfo.m_path = pFilePath;				
-	vrwBrkPtInfo.m_nLine = nLine;					
-	vrwBrkPtInfo.m_nTimes = vBrkPt.GetHitCount();	
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vPc             - (R) Address number.
+//          vArgInfo        - (R) Args information in MI response form.
+//          vFnName         - (R) Function name.
+//          vFileName       - (R) File name text.
+//          vPath           - (R) Full file name and path text.
+//          vnLine          - (R) File line number.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo2(const lldb::addr_t vPc, const CMIUtilString &vArgInfo, const CMIUtilString &vFnName,
+                                                     const CMIUtilString &vFileName, const CMIUtilString &vPath, const MIuint vnLine,
+                                                     CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    const CMIUtilString strAddr(CMIUtilString::Format("0x%08llx", vPc));
+    const CMICmnMIValueConst miValueConst2(strAddr);
+    const CMICmnMIValueResult miValueResult2("addr", miValueConst2);
+    if (!vwrMiValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst3(vFnName);
+    const CMICmnMIValueResult miValueResult3("func", miValueConst3);
+    if (!vwrMiValueTuple.Add(miValueResult3))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst4(vArgInfo, true);
+    const CMICmnMIValueResult miValueResult4("args", miValueConst4);
+    if (!vwrMiValueTuple.Add(miValueResult4))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst5(vFileName);
+    const CMICmnMIValueResult miValueResult5("file", miValueConst5);
+    if (!vwrMiValueTuple.Add(miValueResult5))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst6(vPath);
+    const CMICmnMIValueResult miValueResult6("fullname", miValueConst6);
+    if (!vwrMiValueTuple.Add(miValueResult6))
+        return MIstatus::failure;
+    const CMIUtilString strLine(CMIUtilString::Format("%d", vnLine));
+    const CMICmnMIValueConst miValueConst7(strLine);
+    const CMICmnMIValueResult miValueResult7("line", miValueConst7);
+    if (!vwrMiValueTuple.Add(miValueResult7))
+        return MIstatus::failure;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrBrkPtInfo     - (R) Break point information object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtFrameInfo(const SBrkPtInfo &vrBrkPtInfo, CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    const CMIUtilString strAddr(CMIUtilString::Format("0x%08llx", vrBrkPtInfo.m_pc));
+    const CMICmnMIValueConst miValueConst2(strAddr);
+    const CMICmnMIValueResult miValueResult2("addr", miValueConst2);
+    if (!vwrMiValueTuple.Add(miValueResult2))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst3(vrBrkPtInfo.m_fnName);
+    const CMICmnMIValueResult miValueResult3("func", miValueConst3);
+    if (!vwrMiValueTuple.Add(miValueResult3))
+        return MIstatus::failure;
+    const CMICmnMIValueConst miValueConst5(vrBrkPtInfo.m_fileName);
+    const CMICmnMIValueResult miValueResult5("file", miValueConst5);
+    if (!vwrMiValueTuple.Add(miValueResult5))
+        return MIstatus::failure;
+    const CMIUtilString strN5 = CMIUtilString::Format("%s/%s", vrBrkPtInfo.m_path.c_str(), vrBrkPtInfo.m_fileName.c_str());
+    const CMICmnMIValueConst miValueConst6(strN5);
+    const CMICmnMIValueResult miValueResult6("fullname", miValueConst6);
+    if (!vwrMiValueTuple.Add(miValueResult6))
+        return MIstatus::failure;
+    const CMIUtilString strLine(CMIUtilString::Format("%d", vrBrkPtInfo.m_nLine));
+    const CMICmnMIValueConst miValueConst7(strLine);
+    const CMICmnMIValueResult miValueResult7("line", miValueConst7);
+    if (!vwrMiValueTuple.Add(miValueResult7))
+        return MIstatus::failure;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form MI partial response by appending more MI value type objects to the
+//          tuple type object past in.
+// Type:    Method.
+// Args:    vrBrkPtInfo     - (R) Break point information object.
+//          vwrMIValueTuple - (W) MI value tuple object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo(const SBrkPtInfo &vrBrkPtInfo, CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",
+    // func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+
+    // "number="
+    const CMICmnMIValueConst miValueConst(CMIUtilString::Format("%d", vrBrkPtInfo.m_id));
+    const CMICmnMIValueResult miValueResult("number", miValueConst);
+    CMICmnMIValueTuple miValueTuple(miValueResult);
+    // "type="
+    const CMICmnMIValueConst miValueConst2(vrBrkPtInfo.m_strType);
+    const CMICmnMIValueResult miValueResult2("type", miValueConst2);
+    bool bOk = miValueTuple.Add(miValueResult2);
+    // "disp="
+    const CMICmnMIValueConst miValueConst3(vrBrkPtInfo.m_bDisp ? "del" : "keep");
+    const CMICmnMIValueResult miValueResult3("disp", miValueConst3);
+    bOk = bOk && miValueTuple.Add(miValueResult3);
+    // "enabled="
+    const CMICmnMIValueConst miValueConst4(vrBrkPtInfo.m_bEnabled ? "y" : "n");
+    const CMICmnMIValueResult miValueResult4("enabled", miValueConst4);
+    bOk = bOk && miValueTuple.Add(miValueResult4);
+    // "addr="
+    // "func="
+    // "file="
+    // "fullname="
+    // "line="
+    bOk = bOk && MIResponseFormBrkPtFrameInfo(vrBrkPtInfo, miValueTuple);
+    // "pending="
+    if (vrBrkPtInfo.m_bPending)
+    {
+        const CMICmnMIValueConst miValueConst(vrBrkPtInfo.m_strOrigLoc);
+        const CMICmnMIValueList miValueList(miValueConst);
+        const CMICmnMIValueResult miValueResult("pending", miValueList);
+        bOk = bOk && miValueTuple.Add(miValueResult);
+    }
+    if (vrBrkPtInfo.m_bHaveArgOptionThreadGrp)
+    {
+        const CMICmnMIValueConst miValueConst(vrBrkPtInfo.m_strOptThrdGrp);
+        const CMICmnMIValueList miValueList(miValueConst);
+        const CMICmnMIValueResult miValueResult("thread-groups", miValueList);
+        bOk = bOk && miValueTuple.Add(miValueResult);
+    }
+    // "times="
+    const CMICmnMIValueConst miValueConstB(CMIUtilString::Format("%d", vrBrkPtInfo.m_nTimes));
+    const CMICmnMIValueResult miValueResultB("times", miValueConstB);
+    bOk = bOk && miValueTuple.Add(miValueResultB);
+    // "thread="
+    if (vrBrkPtInfo.m_bBrkPtThreadId)
+    {
+        const CMICmnMIValueConst miValueConst(CMIUtilString::Format("%d", vrBrkPtInfo.m_nBrkPtThreadId));
+        const CMICmnMIValueResult miValueResult("thread", miValueConst);
+        bOk = bOk && miValueTuple.Add(miValueResult);
+    }
+    // "cond="
+    if (vrBrkPtInfo.m_bCondition)
+    {
+        const CMICmnMIValueConst miValueConst(vrBrkPtInfo.m_strCondition);
+        const CMICmnMIValueResult miValueResult("cond", miValueConst);
+        bOk = bOk && miValueTuple.Add(miValueResult);
+    }
+    // "ignore="
+    if (vrBrkPtInfo.m_nIgnore != 0)
+    {
+        const CMICmnMIValueConst miValueConst(CMIUtilString::Format("%d", vrBrkPtInfo.m_nIgnore));
+        const CMICmnMIValueResult miValueResult("ignore", miValueConst);
+        bOk = bOk && miValueTuple.Add(miValueResult);
+    }
+    // "original-location="
+    const CMICmnMIValueConst miValueConstC(vrBrkPtInfo.m_strOrigLoc);
+    const CMICmnMIValueResult miValueResultC("original-location", miValueConstC);
+    bOk = bOk && miValueTuple.Add(miValueResultC);
+
+    vwrMiValueTuple = miValueTuple;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve breakpoint information and write into the given breakpoint information
+//          object. Note not all possible information is retrieved and so the information
+//          object may need to be filled in with more information after calling this
+//          function. Mainly breakpoint location information of information that is
+//          unlikely to change.
+// Type:    Method.
+// Args:    vBrkPt      - (R) LLDB break point object.
+//          vrBrkPtInfo - (W) Break point information object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugSessionInfo::GetBrkPtInfo(const lldb::SBBreakpoint &vBrkPt, SBrkPtInfo &vrwBrkPtInfo) const
+{
+    lldb::SBBreakpoint &rBrkPt = const_cast<lldb::SBBreakpoint &>(vBrkPt);
+    lldb::SBBreakpointLocation brkPtLoc = rBrkPt.GetLocationAtIndex(0);
+    lldb::SBAddress brkPtAddr = brkPtLoc.GetAddress();
+    lldb::SBSymbolContext symbolCntxt = brkPtAddr.GetSymbolContext(lldb::eSymbolContextEverything);
+    const MIchar *pUnkwn = "??";
+    lldb::SBModule rModule = symbolCntxt.GetModule();
+    const MIchar *pModule = rModule.IsValid() ? rModule.GetFileSpec().GetFilename() : pUnkwn;
+    MIunused(pModule);
+    const MIchar *pFile = pUnkwn;
+    const MIchar *pFn = pUnkwn;
+    const MIchar *pFilePath = pUnkwn;
+    size_t nLine = 0;
+    const size_t nAddr = brkPtAddr.GetLoadAddress(m_lldbTarget);
+
+    lldb::SBCompileUnit rCmplUnit = symbolCntxt.GetCompileUnit();
+    if (rCmplUnit.IsValid())
+    {
+        lldb::SBFileSpec rFileSpec = rCmplUnit.GetFileSpec();
+        pFile = rFileSpec.GetFilename();
+        pFilePath = rFileSpec.GetDirectory();
+        lldb::SBFunction rFn = symbolCntxt.GetFunction();
+        if (rFn.IsValid())
+            pFn = rFn.GetName();
+        lldb::SBLineEntry rLnEntry = symbolCntxt.GetLineEntry();
+        if (rLnEntry.GetLine() > 0)
+            nLine = rLnEntry.GetLine();
+    }
+
+    vrwBrkPtInfo.m_id = vBrkPt.GetID();
+    vrwBrkPtInfo.m_strType = "breakpoint";
+    vrwBrkPtInfo.m_pc = nAddr;
+    vrwBrkPtInfo.m_fnName = pFn;
+    vrwBrkPtInfo.m_fileName = pFile;
+    vrwBrkPtInfo.m_path = pFilePath;
+    vrwBrkPtInfo.m_nLine = nLine;
+    vrwBrkPtInfo.m_nTimes = vBrkPt.GetHitCount();
 
-	return MIstatus::success;
+    return MIstatus::success;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugSessionInfo.h
+// File:        MICmnLLDBDebugSessionInfo.h
 //
-// Overview:	CMICmnLLDBDebugSessionInfo interface.
+// Overview:    CMICmnLLDBDebugSessionInfo interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,7 +25,7 @@
 #include <map>
 #include <vector>
 #include <lldb/API/SBDebugger.h>
-#include <lldb/API/SBListener.h> 
+#include <lldb/API/SBListener.h>
 #include <lldb/API/SBProcess.h>
 #include <lldb/API/SBTarget.h>
 
@@ -43,194 +43,198 @@ class CMICmnMIValueTuple;
 class CMICmnMIValueList;
 
 //++ ============================================================================
-// Details:	MI debug session object that holds debugging information between
-//			instances of MI commands executing their work and producing MI
-//			result records. Information/data is set by one or many commands then
-//			retrieved by the same or other sebsequent commands.
-//			It primarily to hold LLDB type objects.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 04/03/2014.
-// Changes:	None.
+// Details: MI debug session object that holds debugging information between
+//          instances of MI commands executing their work and producing MI
+//          result records. Information/data is set by one or many commands then
+//          retrieved by the same or other sebsequent commands.
+//          It primarily to hold LLDB type objects.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 04/03/2014.
+// Changes: None.
 //--
-class CMICmnLLDBDebugSessionInfo
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmnLLDBDebugSessionInfo >
+class CMICmnLLDBDebugSessionInfo : public CMICmnBase, public MI::ISingleton<CMICmnLLDBDebugSessionInfo>
 {
-	friend class MI::ISingleton< CMICmnLLDBDebugSessionInfo >;
+    friend class MI::ISingleton<CMICmnLLDBDebugSessionInfo>;
 
-// Structs:
-public:
-	//++ ============================================================================
-	// Details:	Break point information object. Used to easily pass information about
-	//			a break around and record break point information to be recalled by
-	//			other commands or LLDB event handling functions.
-	//-- 
-	struct SBrkPtInfo
-	{
-		SBrkPtInfo( void )
-		:	m_id( 0 )					
-		,	m_bDisp( false )					
-		,	m_bEnabled( false )				
-		,	m_pc( 0 )						
-		,	m_nLine( 0 )					
-		,	m_bHaveArgOptionThreadGrp( false )	
-		,	m_nTimes( 0 )					
-		,	m_bPending( false )					
-		,	m_nIgnore( 0 )		
-		,	m_bCondition( false )
-		,	m_bBrkPtThreadId( false )
-		,	m_nBrkPtThreadId( 0 )
-		{
-		}
-
-		MIuint			m_id;						// LLDB break point ID.
-		CMIUtilString	m_strType;					// Break point type. 
-		bool			m_bDisp	;					// True = "del", false = "keep".
-		bool			m_bEnabled;					// True = enabled, false = disabled break point.
-		MIuint			m_pc;						// Address number.
-		CMIUtilString	m_fnName;					// Function name.
-		CMIUtilString	m_fileName;					// File name text.
-		CMIUtilString	m_path;						// Full file name and path text.
-		MIuint			m_nLine;					// File line number.
-		bool			m_bHaveArgOptionThreadGrp;	// True = include MI field, false = do not include "thread-groups".
-		CMIUtilString	m_strOptThrdGrp;			// Thread group number.
-		MIuint			m_nTimes;					// The count of the breakpoint existence.
-		CMIUtilString	m_strOrigLoc;				// The name of the break point.
-		bool			m_bPending;					// True = the breakpoint has not been established yet, false = location found
-		MIuint			m_nIgnore;					// The number of time the breakpoint is run over before it is stopped on a hit 
-		bool			m_bCondition;				// True = break point is conditional, use condition expression, false = no condition
-		CMIUtilString	m_strCondition;				// Break point condition expression
-		bool			m_bBrkPtThreadId;			// True = break point is specified to work with a specific thread, false = no specified thread given
-		MIuint			m_nBrkPtThreadId;			// Restrict the breakpoint to the specified thread-id
-	};
-
-// Typedefs:
-public:
-	typedef std::vector< uint32_t >	VecActiveThreadId_t;
-
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-
-	// Variant type data which can be assigned and retrieved across all command instances
-	template< typename T > 
-	bool	SharedDataAdd( const CMIUtilString & vKey, const T & vData );
-	template< typename T > 
-	bool	SharedDataRetrieve( const CMIUtilString & vKey, T & vwData );
-	bool	SharedDataDestroy( void );
-	
-	//	Common command required functionality
-	bool	AccessPath( const CMIUtilString & vPath, bool & vwbYesAccessible );
-	bool	GetFrameInfo( const lldb::SBFrame & vrFrame, lldb::addr_t & vwPc, CMIUtilString & vwFnName, CMIUtilString & vwFileName, CMIUtilString & vwPath, MIuint & vwnLine );
-	bool	GetThreadFrames( const SMICmdData & vCmdData, const MIuint vThreadIdx, CMIUtilString & vwrThreadFrames );
-	bool	GetThreadFrames2( const SMICmdData & vCmdData, const MIuint vThreadIdx, CMIUtilString & vwrThreadFrames );
-	bool	ResolvePath( const SMICmdData & vCmdData, const CMIUtilString & vPath, CMIUtilString & vwrResolvedPath );
-	bool	ResolvePath( const CMIUtilString & vstrUnknown, CMIUtilString & vwrResolvedPath );
-	bool	MIResponseFormFrameInfo( const lldb::SBThread & vrThread, const MIuint vnLevel, CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	MIResponseFormFrameInfo( const lldb::addr_t vPc, const CMIUtilString & vFnName, const CMIUtilString & vFileName, const CMIUtilString & vPath, const MIuint vnLine, CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	MIResponseFormFrameInfo2( const lldb::addr_t vPc, const CMIUtilString & vArgInfo, const CMIUtilString & vFnName, const CMIUtilString & vFileName, const CMIUtilString & vPath, const MIuint vnLine, CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	MIResponseFormThreadInfo( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple );
-	bool	MIResponseFormThreadInfo2( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple );
-	bool	MIResponseFormThreadInfo3( const SMICmdData & vCmdData, const lldb::SBThread & vrThread, CMICmnMIValueTuple & vwrMIValueTuple );
-	bool	MIResponseFormVariableInfo( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList );
-	bool	MIResponseFormVariableInfo2( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList );
-	bool	MIResponseFormVariableInfo3( const lldb::SBFrame & vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList & vwrMiValueList );
-	bool	MIResponseFormBrkPtFrameInfo( const SBrkPtInfo & vrBrkPtInfo, CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	MIResponseFormBrkPtInfo( const SBrkPtInfo & vrBrkPtInfo, CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	GetBrkPtInfo( const lldb::SBBreakpoint & vBrkPt, SBrkPtInfo & vrwBrkPtInfo ) const;
-	bool	RecordBrkPtInfo( const MIuint vnBrkPtId, const SBrkPtInfo & vrBrkPtInfo );
-	bool	RecordBrkPtInfoGet( const MIuint vnBrkPtId, SBrkPtInfo & vrwBrkPtInfo ) const;
-	bool	RecordBrkPtInfoDelete( const MIuint vnBrkPtId );
-
-// Attributes:
-public:
-	// The following are available to all command instances
-	lldb::SBDebugger &		m_rLldbDebugger;			
-	lldb::SBListener &		m_rLlldbListener;	
-	lldb::SBTarget 			m_lldbTarget;
-    lldb::SBProcess			m_lldbProcess;
-	const MIuint			m_nBrkPointCntMax;
-  	VecActiveThreadId_t		m_vecActiveThreadId;
-	lldb::tid_t				m_currentSelectedThread;
-
-	// These are keys that can be used to access the shared data map
-	// Note: This list is expected to grow and will be moved and abstracted in the future.
-	const CMIUtilString	m_constStrSharedDataKeyWkDir;
+    // Structs:
+  public:
+    //++ ============================================================================
+    // Details: Break point information object. Used to easily pass information about
+    //          a break around and record break point information to be recalled by
+    //          other commands or LLDB event handling functions.
+    //--
+    struct SBrkPtInfo
+    {
+        SBrkPtInfo(void)
+            : m_id(0)
+            , m_bDisp(false)
+            , m_bEnabled(false)
+            , m_pc(0)
+            , m_nLine(0)
+            , m_bHaveArgOptionThreadGrp(false)
+            , m_nTimes(0)
+            , m_bPending(false)
+            , m_nIgnore(0)
+            , m_bCondition(false)
+            , m_bBrkPtThreadId(false)
+            , m_nBrkPtThreadId(0)
+        {
+        }
+
+        MIuint m_id;                    // LLDB break point ID.
+        CMIUtilString m_strType;        // Break point type.
+        bool m_bDisp;                   // True = "del", false = "keep".
+        bool m_bEnabled;                // True = enabled, false = disabled break point.
+        MIuint m_pc;                    // Address number.
+        CMIUtilString m_fnName;         // Function name.
+        CMIUtilString m_fileName;       // File name text.
+        CMIUtilString m_path;           // Full file name and path text.
+        MIuint m_nLine;                 // File line number.
+        bool m_bHaveArgOptionThreadGrp; // True = include MI field, false = do not include "thread-groups".
+        CMIUtilString m_strOptThrdGrp;  // Thread group number.
+        MIuint m_nTimes;                // The count of the breakpoint existence.
+        CMIUtilString m_strOrigLoc;     // The name of the break point.
+        bool m_bPending;                // True = the breakpoint has not been established yet, false = location found
+        MIuint m_nIgnore;               // The number of time the breakpoint is run over before it is stopped on a hit
+        bool m_bCondition;              // True = break point is conditional, use condition expression, false = no condition
+        CMIUtilString m_strCondition;   // Break point condition expression
+        bool m_bBrkPtThreadId;          // True = break point is specified to work with a specific thread, false = no specified thread given
+        MIuint m_nBrkPtThreadId;        // Restrict the breakpoint to the specified thread-id
+    };
+
+    // Typedefs:
+  public:
+    typedef std::vector<uint32_t> VecActiveThreadId_t;
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+
+    // Variant type data which can be assigned and retrieved across all command instances
+    template <typename T> bool SharedDataAdd(const CMIUtilString &vKey, const T &vData);
+    template <typename T> bool SharedDataRetrieve(const CMIUtilString &vKey, T &vwData);
+    bool SharedDataDestroy(void);
+
+    //  Common command required functionality
+    bool AccessPath(const CMIUtilString &vPath, bool &vwbYesAccessible);
+    bool GetFrameInfo(const lldb::SBFrame &vrFrame, lldb::addr_t &vwPc, CMIUtilString &vwFnName, CMIUtilString &vwFileName,
+                      CMIUtilString &vwPath, MIuint &vwnLine);
+    bool GetThreadFrames(const SMICmdData &vCmdData, const MIuint vThreadIdx, CMIUtilString &vwrThreadFrames);
+    bool GetThreadFrames2(const SMICmdData &vCmdData, const MIuint vThreadIdx, CMIUtilString &vwrThreadFrames);
+    bool ResolvePath(const SMICmdData &vCmdData, const CMIUtilString &vPath, CMIUtilString &vwrResolvedPath);
+    bool ResolvePath(const CMIUtilString &vstrUnknown, CMIUtilString &vwrResolvedPath);
+    bool MIResponseFormFrameInfo(const lldb::SBThread &vrThread, const MIuint vnLevel, CMICmnMIValueTuple &vwrMiValueTuple);
+    bool MIResponseFormFrameInfo(const lldb::addr_t vPc, const CMIUtilString &vFnName, const CMIUtilString &vFileName,
+                                 const CMIUtilString &vPath, const MIuint vnLine, CMICmnMIValueTuple &vwrMiValueTuple);
+    bool MIResponseFormFrameInfo2(const lldb::addr_t vPc, const CMIUtilString &vArgInfo, const CMIUtilString &vFnName,
+                                  const CMIUtilString &vFileName, const CMIUtilString &vPath, const MIuint vnLine,
+                                  CMICmnMIValueTuple &vwrMiValueTuple);
+    bool MIResponseFormThreadInfo(const SMICmdData &vCmdData, const lldb::SBThread &vrThread, CMICmnMIValueTuple &vwrMIValueTuple);
+    bool MIResponseFormThreadInfo2(const SMICmdData &vCmdData, const lldb::SBThread &vrThread, CMICmnMIValueTuple &vwrMIValueTuple);
+    bool MIResponseFormThreadInfo3(const SMICmdData &vCmdData, const lldb::SBThread &vrThread, CMICmnMIValueTuple &vwrMIValueTuple);
+    bool MIResponseFormVariableInfo(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList &vwrMiValueList);
+    bool MIResponseFormVariableInfo2(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList &vwrMiValueList);
+    bool MIResponseFormVariableInfo3(const lldb::SBFrame &vrFrame, const MIuint vMaskVarTypes, CMICmnMIValueList &vwrMiValueList);
+    bool MIResponseFormBrkPtFrameInfo(const SBrkPtInfo &vrBrkPtInfo, CMICmnMIValueTuple &vwrMiValueTuple);
+    bool MIResponseFormBrkPtInfo(const SBrkPtInfo &vrBrkPtInfo, CMICmnMIValueTuple &vwrMiValueTuple);
+    bool GetBrkPtInfo(const lldb::SBBreakpoint &vBrkPt, SBrkPtInfo &vrwBrkPtInfo) const;
+    bool RecordBrkPtInfo(const MIuint vnBrkPtId, const SBrkPtInfo &vrBrkPtInfo);
+    bool RecordBrkPtInfoGet(const MIuint vnBrkPtId, SBrkPtInfo &vrwBrkPtInfo) const;
+    bool RecordBrkPtInfoDelete(const MIuint vnBrkPtId);
+
+    // Attributes:
+  public:
+    // The following are available to all command instances
+    lldb::SBDebugger &m_rLldbDebugger;
+    lldb::SBListener &m_rLlldbListener;
+    lldb::SBTarget m_lldbTarget;
+    lldb::SBProcess m_lldbProcess;
+    const MIuint m_nBrkPointCntMax;
+    VecActiveThreadId_t m_vecActiveThreadId;
+    lldb::tid_t m_currentSelectedThread;
+
+    // These are keys that can be used to access the shared data map
+    // Note: This list is expected to grow and will be moved and abstracted in the future.
+    const CMIUtilString m_constStrSharedDataKeyWkDir;
     const CMIUtilString m_constStrSharedDataSolibPath;
 
-// Typedefs:
-private:
-	typedef std::vector< CMICmnLLDBDebugSessionInfoVarObj >	VecVarObj_t;
-	typedef std::map< MIuint, SBrkPtInfo >					MapBrkPtIdToBrkPtInfo_t;		
-	typedef std::pair< MIuint, SBrkPtInfo >					MapPairBrkPtIdToBrkPtInfo_t;
-
-// Methods:
-private:
-	/* ctor */	CMICmnLLDBDebugSessionInfo( void );
-	/* ctor */	CMICmnLLDBDebugSessionInfo( const CMICmnLLDBDebugSessionInfo & );
-	void		operator=( const CMICmnLLDBDebugSessionInfo & );
-	//
-	bool	GetVariableInfo( const MIuint vnMaxDepth, const lldb::SBValue & vrValue, const bool vbIsChildValue, CMICmnMIValueList & vwrMiValueList, MIuint & vrwnDepth );
-	bool	GetVariableInfo2( const MIuint vnMaxDepth, const lldb::SBValue & vrValue, const bool vbIsChildValue, CMICmnMIValueList & vwrMiValueList, MIuint & vrwnDepth );
-	
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLLDBDebugSessionInfo( void );
-
-// Attributes:
-private:
-	CMIUtilMapIdToVariant	m_mapIdToSessionData;		// Hold and retrieve key to value data available across all commands
-	VecVarObj_t				m_vecVarObj;				// Vector of session variable objects
-	MapBrkPtIdToBrkPtInfo_t	m_mapBrkPtIdToBrkPtInfo;
+    // Typedefs:
+  private:
+    typedef std::vector<CMICmnLLDBDebugSessionInfoVarObj> VecVarObj_t;
+    typedef std::map<MIuint, SBrkPtInfo> MapBrkPtIdToBrkPtInfo_t;
+    typedef std::pair<MIuint, SBrkPtInfo> MapPairBrkPtIdToBrkPtInfo_t;
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnLLDBDebugSessionInfo(void);
+    /* ctor */ CMICmnLLDBDebugSessionInfo(const CMICmnLLDBDebugSessionInfo &);
+    void operator=(const CMICmnLLDBDebugSessionInfo &);
+    //
+    bool GetVariableInfo(const MIuint vnMaxDepth, const lldb::SBValue &vrValue, const bool vbIsChildValue,
+                         CMICmnMIValueList &vwrMiValueList, MIuint &vrwnDepth);
+    bool GetVariableInfo2(const MIuint vnMaxDepth, const lldb::SBValue &vrValue, const bool vbIsChildValue,
+                          CMICmnMIValueList &vwrMiValueList, MIuint &vrwnDepth);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLLDBDebugSessionInfo(void);
+
+    // Attributes:
+  private:
+    CMIUtilMapIdToVariant m_mapIdToSessionData; // Hold and retrieve key to value data available across all commands
+    VecVarObj_t m_vecVarObj;                    // Vector of session variable objects
+    MapBrkPtIdToBrkPtInfo_t m_mapBrkPtIdToBrkPtInfo;
 };
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Command instances can create and share data between other instances of commands.
-//			This function adds new data to the shared data. Using the same ID more than
-//			once replaces any previous matching data keys.
-// Type:	Template method.
-// Args:	T		- The type of the object to be stored.
-//			vKey	- (R) A non empty unique data key to retrieve the data by.
-//			vData	- (R) Data to be added to the share.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Command instances can create and share data between other instances of commands.
+//          This function adds new data to the shared data. Using the same ID more than
+//          once replaces any previous matching data keys.
+// Type:    Template method.
+// Args:    T       - The type of the object to be stored.
+//          vKey    - (R) A non empty unique data key to retrieve the data by.
+//          vData   - (R) Data to be added to the share.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-template< typename T > 
-bool CMICmnLLDBDebugSessionInfo::SharedDataAdd( const CMIUtilString & vKey, const T & vData )
+template <typename T>
+bool
+CMICmnLLDBDebugSessionInfo::SharedDataAdd(const CMIUtilString &vKey, const T &vData)
 {
-	if( !m_mapIdToSessionData.Add< T >( vKey, vData ) )
-	{
-		SetErrorDescription( m_mapIdToSessionData.GetErrorDescription() );
-		return MIstatus::failure;
-	}
+    if (!m_mapIdToSessionData.Add<T>(vKey, vData))
+    {
+        SetErrorDescription(m_mapIdToSessionData.GetErrorDescription());
+        return MIstatus::failure;
+    }
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Command instances can create and share data between other instances of commands.
-//			This function retrieves data from the shared data container.
-// Type:	Method.
-// Args:	T		- The type of the object being retrieved.
-//			vKey	- (R) A non empty unique data key to retrieve the data by.
-//			vData	- (W) The data.
-// Return:	bool - True = data found, false = data not found or an error occurred trying to fetch.
-// Throws:	None.
+// Details: Command instances can create and share data between other instances of commands.
+//          This function retrieves data from the shared data container.
+// Type:    Method.
+// Args:    T     - The type of the object being retrieved.
+//          vKey  - (R) A non empty unique data key to retrieve the data by.
+//          vData - (W) The data.
+// Return:  bool  - True = data found, false = data not found or an error occurred trying to fetch.
+// Throws:  None.
 //--
-template< typename T > 
-bool CMICmnLLDBDebugSessionInfo::SharedDataRetrieve( const CMIUtilString & vKey, T & vwData )
+template <typename T>
+bool
+CMICmnLLDBDebugSessionInfo::SharedDataRetrieve(const CMIUtilString &vKey, T &vwData)
 {
-	bool bDataFound = false;
+    bool bDataFound = false;
 
-	if( !m_mapIdToSessionData.Get< T >( vKey, vwData, bDataFound ) )
-	{
-		SetErrorDescription( m_mapIdToSessionData.GetErrorDescription() );
-		return MIstatus::failure;
-	}
+    if (!m_mapIdToSessionData.Get<T>(vKey, vwData, bDataFound))
+    {
+        SetErrorDescription(m_mapIdToSessionData.GetErrorDescription());
+        return MIstatus::failure;
+    }
 
-	return bDataFound;
-}
\ No newline at end of file
+    return bDataFound;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugSessionInfoVarObj.cpp
+// File:        MICmnLLDBDebugSessionInfoVarObj.cpp
 //
-// Overview:	CMICmnLLDBDebugSessionInfoVarObj implementation.
+// Overview:    CMICmnLLDBDebugSessionInfoVarObj implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -25,546 +25,557 @@
 #include "MICmnLLDBUtilSBValue.h"
 
 // Instantiations:
-const MIchar * CMICmnLLDBDebugSessionInfoVarObj::ms_aVarFormatStrings[] =
-{
-	// CODETAG_SESSIONINFO_VARFORMAT_ENUM
-	// *** Order is import here.
-	"<Invalid var format>",
-	"binary",
-	"octal",
-	"decimal",
-	"hexadecimal",
-	"natural"
-};
-const MIchar * 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;
-MIuint												CMICmnLLDBDebugSessionInfoVarObj::ms_nVarUniqueId = 0; // Index from 0
+const MIchar *CMICmnLLDBDebugSessionInfoVarObj::ms_aVarFormatStrings[] = {
+    // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+    // *** Order is import here.
+    "<Invalid var format>", "binary", "octal", "decimal", "hexadecimal", "natural"};
+const MIchar *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;
+MIuint CMICmnLLDBDebugSessionInfoVarObj::ms_nVarUniqueId = 0; // Index from 0
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( void )
-:	m_eVarFormat( eVarFormat_Natural )
-,	m_eVarType( eVarType_Internal )
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(void)
+    : m_eVarFormat(eVarFormat_Natural)
+    , m_eVarType(eVarType_Internal)
 {
-	// Do not call UpdateValue() in here as not necessary
+    // 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.
-//			vrStrName		- (R) The name given for *this var object.
-//			vrValue			- (R) The LLDB SBValue object represented by *this object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
+// Type:    Method.
+// 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.
+// 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 )
+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();
+    UpdateValue();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj constructor.
-// Type:	Method.
-// 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).
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj constructor.
+// Type:    Method.
+// 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).
+// 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 )
+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();
+    UpdateValue();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj copy constructor.
-// Type:	Method.
-// Args:	vrOther	- (R) The object to copy from.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor.
+// Type:    Method.
+// Args:    vrOther - (R) The object to copy from.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( const CMICmnLLDBDebugSessionInfoVarObj & vrOther )
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
 {
-	CopyOther( vrOther );
+    CopyOther(vrOther);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj copy constructor.
-// Type:	Method.
-// Args:	vrOther	- (R) The object to copy from.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor.
+// Type:    Method.
+// Args:    vrOther - (R) The object to copy from.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( CMICmnLLDBDebugSessionInfoVarObj & vrOther )
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &vrOther)
 {
-	CopyOther( vrOther );
+    CopyOther(vrOther);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj move constructor.
-// Type:	Method.
-// Args:	vrwOther	- (R) The object to copy from.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugSessionInfoVarObj move constructor.
+// Type:    Method.
+// Args:    vrwOther    - (R) The object to copy from.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( CMICmnLLDBDebugSessionInfoVarObj && vrwOther )
+CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther)
 {
-	MoveOther( vrwOther );
+    MoveOther(vrwOther);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugSessionInfoVarObj assignment operator.
-// Type:	Method.
-// Args:	vrOther	- (R) The object to copy from.
-// Return:	CMICmnLLDBDebugSessionInfoVarObj & - Updated *this object.
-// Throws:	None.
+// 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 )
+CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::operator=(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
 {
-	CopyOther( 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.
+// 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 )
+CMICmnLLDBDebugSessionInfoVarObj &CMICmnLLDBDebugSessionInfoVarObj::operator=(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther)
 {
-	MoveOther( 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.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Copy the other instance of that object to *this object.
+// Type:    Method.
+// Args:    vrOther - (R) The object to copy from.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugSessionInfoVarObj::CopyOther( const CMICmnLLDBDebugSessionInfoVarObj & vrOther )
+bool
+CMICmnLLDBDebugSessionInfoVarObj::CopyOther(const CMICmnLLDBDebugSessionInfoVarObj &vrOther)
 {
-	// Check for self-assignment
-	if( this == &vrOther )
-		return MIstatus::success;
+    // 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.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Move that object to *this object.
+// Type:    Method.
+// Args:    vrwOther    - (RW) The object to copy from.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugSessionInfoVarObj::MoveOther( CMICmnLLDBDebugSessionInfoVarObj & vrwOther )
+bool
+CMICmnLLDBDebugSessionInfoVarObj::MoveOther(CMICmnLLDBDebugSessionInfoVarObj &vrwOther)
 {
-	// Check for self-assignment
-	if( this == &vrwOther )
-		return MIstatus::success;
+    // 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.
+// Details: CMICmnLLDBDebugSessionInfoVarObj destructor.
+// Type:    Overridden.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj( void )
+CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the var format enumeration for the specified string.
-// Type:	Static method.
-// Args:	vrStrFormat	- (R) Text description of the var format.
-// Return:	varFormat_e	- Var format enumeration.
-//						- No match found return eVarFormat_Invalid.
-// Throws:	None.
+// Details: Retrieve the var format enumeration for the specified string.
+// Type:    Static method.
+// Args:    vrStrFormat - (R) Text description of the var format.
+// Return:  varFormat_e - Var format enumeration.
+//                      - No match found return eVarFormat_Invalid.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::varFormat_e CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString( const CMIUtilString & vrStrFormat )
+CMICmnLLDBDebugSessionInfoVarObj::varFormat_e
+CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString(const CMIUtilString &vrStrFormat)
 {
-	// CODETAG_SESSIONINFO_VARFORMAT_ENUM
-	for( MIuint i = 0; i < eVarFormat_count; i++ )
-	{
-		const MIchar * pVarFormatString = ms_aVarFormatStrings[ i ];
-		if( vrStrFormat == pVarFormatString )
-			return static_cast< varFormat_e >( i );
-	}
+    // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+    for (MIuint i = 0; i < eVarFormat_count; i++)
+    {
+        const MIchar *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:	vrcFormat	- (R) Character representing the var format.
-// Return:	varFormat_e	- Var format enumeration.
-//						- No match found return eVarFormat_Invalid.
-// Throws:	None.
+// Details: Retrieve the var format enumeration for the specified character.
+// Type:    Static method.
+// Args:    vrcFormat   - (R) Character representing the var format.
+// Return:  varFormat_e - Var format enumeration.
+//                      - No match found return eVarFormat_Invalid.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::varFormat_e CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar( const MIchar & vrcFormat )
+CMICmnLLDBDebugSessionInfoVarObj::varFormat_e
+CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar(const MIchar &vrcFormat)
 {
-	if( 'r' == vrcFormat )
-		return eVarFormat_Hex;
+    if ('r' == vrcFormat)
+        return eVarFormat_Hex;
 
-	// CODETAG_SESSIONINFO_VARFORMAT_ENUM
-	for( MIuint i = 0; i < eVarFormat_count; i++ )
-	{
-		const MIchar * pVarFormatChar = ms_aVarFormatChars[ i ];
-		if( *pVarFormatChar == vrcFormat )
-			return static_cast< varFormat_e >( i );
-	}
+    // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+    for (MIuint i = 0; i < eVarFormat_count; i++)
+    {
+        const MIchar *pVarFormatChar = ms_aVarFormatChars[i];
+        if (*pVarFormatChar == vrcFormat)
+            return static_cast<varFormat_e>(i);
+    }
 
-	return eVarFormat_Invalid;
+    return eVarFormat_Invalid;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the equivalent var value formatted string for the given value type.
-//			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.
-//			veVarFormat	- (R) Var format enumeration.
-// Returns:	CMIUtilString	- Value formatted string.
-// Throws:	None.
+// Details: Return the equivalent var value formatted string for the given value type.
+//          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.
+//          veVarFormat - (R) Var format enumeration.
+// Returns: CMIUtilString   - Value formatted string.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted( const lldb::SBValue & vrValue, const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat )
+CMIUtilString
+CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(const lldb::SBValue &vrValue,
+                                                          const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat)
 {
-	CMIUtilString strFormattedValue;
-	
-	MIuint64 nValue = 0;
-	if( CMICmnLLDBProxySBValue::GetValueAsUnsigned( vrValue, nValue ) == MIstatus::success )
-	{
-		lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-		strFormattedValue = GetStringFormatted( nValue, rValue.GetValue(), veVarFormat );
-	}
-	else
-	{
-		// Composite variable type i.e. struct
-		strFormattedValue = "{...}";
-	}
-	
-	return strFormattedValue;
+    CMIUtilString strFormattedValue;
+
+    MIuint64 nValue = 0;
+    if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(vrValue, nValue) == MIstatus::success)
+    {
+        lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+        strFormattedValue = GetStringFormatted(nValue, rValue.GetValue(), veVarFormat);
+    }
+    else
+    {
+        // Composite variable type i.e. struct
+        strFormattedValue = "{...}";
+    }
+
+    return strFormattedValue;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return nuber 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.
-//			veVarFormat			- (R) Var format enumeration.
-// Returns:	CMIUtilString	- Numerical formatted string.
-// Throws:	None.
+// Details: Return nuber 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.
+//          veVarFormat         - (R) Var format enumeration.
+// Returns: CMIUtilString       - Numerical formatted string.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetStringFormatted( const MIuint64 vnValue, const MIchar * vpStrValueNatural, const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat )
+CMIUtilString
+CMICmnLLDBDebugSessionInfoVarObj::GetStringFormatted(const MIuint64 vnValue, const MIchar *vpStrValueNatural,
+                                                     const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat)
 {
-	CMIUtilString strFormattedValue;
-	
-	switch( veVarFormat )
-	{
-	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 : "";
-	}
-	}
+    CMIUtilString strFormattedValue;
 
-	return strFormattedValue;
+    switch (veVarFormat)
+    {
+        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.
+// Details: Delete internal container contents.
+// Type:    Static method.
+// Args:    None.
+// Returns: None.
+// Throws:  None.
 //--
-void CMICmnLLDBDebugSessionInfoVarObj::VarObjClear( void )
+void
+CMICmnLLDBDebugSessionInfoVarObj::VarObjClear(void)
 {
-	ms_mapVarIdToVarObj.clear();
+    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.
+// 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 )
+void
+CMICmnLLDBDebugSessionInfoVarObj::VarObjAdd(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj)
 {
-	VarObjDelete( vrVarObj.GetName() );
-	MapPairKeyToVarObj_t pr( vrVarObj.GetName(), vrVarObj );
-	ms_mapVarIdToVarObj.insert( pr );
+    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.
-// Type:	Static method.
-// Args:	vrVarName	- (R) The var value name.
-// Returns:	None.
-// Throws:	None.
+// 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 )
+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 );
-	}
+    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.
+// 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 )
+void
+CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj)
 {
-	VarObjAdd( vrVarObj );
+    VarObjAdd(vrVarObj);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the var object matching the specified name.
-// Type:	Static method.
-// Args:	vrVarName	- (R) The var value name.
-//			vrwVarObj	- (W) A var object.
-// Returns:	bool	- True = object found, false = object not found.
-// Throws:	None.
+// Details: Retrieve the var object matching the specified name.
+// Type:    Static method.
+// Args:    vrVarName   - (R) The var value name.
+//          vrwVarObj   - (W) A var object.
+// Returns: bool    - True = object found, false = object not found.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( const CMIUtilString & vrVarName, CMICmnLLDBDebugSessionInfoVarObj & vrwVarObj )
+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;
-	}
+    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
-//			used to ID the var value object. Reset the count to 0.
-// Type:	Static method.
-// Args:	None.
-// Returns:	None.
-// Throws:	None.
+// 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( void )
+void
+CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero(void)
 {
-	ms_nVarUniqueId = 0;
+    ms_nVarUniqueId = 0;
 }
 
 //++ ------------------------------------------------------------------------------------
-// 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.
+// 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( void )
+void
+CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc(void)
 {
-	ms_nVarUniqueId++;
+    ms_nVarUniqueId++;
 }
 
 //++ ------------------------------------------------------------------------------------
-// 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.
+// 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( void )
+MIuint
+CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet(void)
 {
-	return ms_nVarUniqueId;
+    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.
+// 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( void ) const
+const CMIUtilString &
+CMICmnLLDBDebugSessionInfoVarObj::GetName(void) const
 {
-	return m_strName;
+    return m_strName;
 }
 
 //++ ------------------------------------------------------------------------------------
-// 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.
+// 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( void ) const
+const CMIUtilString &
+CMICmnLLDBDebugSessionInfoVarObj::GetNameReal(void) const
 {
-	return m_strNameReal;
+    return m_strNameReal;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the value formatted string.
-// Type:	Method.
-// Args:	None.
-// Returns:	CMIUtilString &	- Value formatted string.
-// Throws:	None.
+// Details: Retrieve the value formatted string.
+// Type:    Method.
+// Args:    None.
+// Returns: CMIUtilString & - Value formatted string.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLLDBDebugSessionInfoVarObj::GetValueFormatted( void ) const
+const CMIUtilString &
+CMICmnLLDBDebugSessionInfoVarObj::GetValueFormatted(void) const
 {
-	return m_strFormattedValue;
+    return m_strFormattedValue;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the LLDB Value object.
-// Type:	Method.
-// Args:	None.
-// Returns:	lldb::SBValue &	- LLDB Value object.
-// Throws:	None.
+// Details: Retrieve the LLDB Value object.
+// Type:    Method.
+// Args:    None.
+// Returns: lldb::SBValue & - LLDB Value object.
+// Throws:  None.
 //--
-const lldb::SBValue & CMICmnLLDBDebugSessionInfoVarObj::GetValue( void ) const
+const lldb::SBValue &
+CMICmnLLDBDebugSessionInfoVarObj::GetValue(void) const
 {
-	return m_SBValue;
+    return m_SBValue;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the var format type for *this object and upate the formatting.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Set the var format type for *this object and upate the formatting.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat( const varFormat_e veVarFormat )
+bool
+CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat(const varFormat_e veVarFormat)
 {
-	if( veVarFormat >= eVarFormat_count )
-		return MIstatus::failure;
+    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.
+// Details: Update *this var obj. Update it's value and type.
+// Type:    Method.
+// Args:    None.
+// Returns: None.
+// Throws:  None.
 //--
-void CMICmnLLDBDebugSessionInfoVarObj::UpdateValue( void )
+void
+CMICmnLLDBDebugSessionInfoVarObj::UpdateValue(void)
 {
-	m_strFormattedValue = CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted( m_SBValue, m_eVarFormat );
+    m_strFormattedValue = CMICmnLLDBDebugSessionInfoVarObj::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.
-// Returns:	varType_e	- Enumeration value.
-// Throws:	None.
+// Details: Retrieve the enumeration type of the var object.
+// Type:    Method.
+// Args:    None.
+// Returns: varType_e   - Enumeration value.
+// Throws:  None.
 //--
-CMICmnLLDBDebugSessionInfoVarObj::varType_e CMICmnLLDBDebugSessionInfoVarObj::GetType( void ) const
+CMICmnLLDBDebugSessionInfoVarObj::varType_e
+CMICmnLLDBDebugSessionInfoVarObj::GetType(void) const
 {
-	return m_eVarType;
+    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 
-//			parent.
-// Type:	Method.
-// Args:	None.
-// Returns:	CMIUtilString &	- Pointer to var object, NULL = no parent.
-// Throws:	None.
+// 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.
+// Returns: CMIUtilString & - Pointer to var object, NULL = no parent.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLLDBDebugSessionInfoVarObj::GetVarParentName( void ) const
+const CMIUtilString &
+CMICmnLLDBDebugSessionInfoVarObj::GetVarParentName(void) const
 {
-	return m_strVarObjParentName;
+    return m_strVarObjParentName;
 }
-	
\ No newline at end of file

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugSessionInfoVarObj.h
+// File:        MICmnLLDBDebugSessionInfoVarObj.h
 //
-// Overview:	CMICmnLLDBDebugSessionInfoVarObj interface.
+// Overview:    CMICmnLLDBDebugSessionInfoVarObj interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -29,111 +29,113 @@
 #include "MIUtilString.h"
 
 //++ ============================================================================
-// Details:	MI debug session variable object. The static functionality in *this
-//			class manages a map container of *these variable objects.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/03/2014.
-// Changes:	None.
+// Details: MI debug session variable object. The static functionality in *this
+//          class manages a map container of *these variable objects.
+// Gotchas: None.
+// Authors: Illya Rudkin 24/03/2014.
+// Changes: None.
 //--
 class CMICmnLLDBDebugSessionInfoVarObj
 {
-// Enums:
-public:
-	//++ ----------------------------------------------------------------------
-	// Details:	Enumeration of a variable type that is not a composite type
-	//--
-	enum varFormat_e
-	{
-		// CODETAG_SESSIONINFO_VARFORMAT_ENUM
-		// *** Order is import here ***
-		eVarFormat_Invalid = 0,
-		eVarFormat_Binary,
-		eVarFormat_Octal,
-		eVarFormat_Decimal,
-		eVarFormat_Hex,
-		eVarFormat_Natural,
-		eVarFormat_count	// Always last one
-	};
-
-	//++ ----------------------------------------------------------------------
-	// Details:	Enumeration of a variable type by composite or internal type
-	//--
-	enum varType_e
-	{
-		eVarType_InValid = 0,
-		eVarType_Composite,		// i.e. struct
-		eVarType_Internal,		// i.e. int 
-		eVarType_count			// Always last one
-	};
-
-// Statics:
-public:
-	static varFormat_e		GetVarFormatForString( const CMIUtilString & vrStrFormat );
-	static varFormat_e		GetVarFormatForChar( const MIchar & vrcFormat );
-	static CMIUtilString	GetValueStringFormatted( const lldb::SBValue & vrValue, const varFormat_e veVarFormat );
-	static void				VarObjAdd( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj );
-	static void				VarObjDelete( const CMIUtilString & vrVarName );
-	static bool				VarObjGet( const CMIUtilString & vrVarName, CMICmnLLDBDebugSessionInfoVarObj & vrwVarObj );
-	static void				VarObjUpdate( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj );
-	static void				VarObjIdInc( void );
-	static MIuint			VarObjIdGet( void );
-	static void				VarObjIdResetToZero( void );
-	static void				VarObjClear( void );
-
-// Methods:
-public:
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( void );
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( const CMIUtilString & vrStrNameReal, const CMIUtilString & vrStrName, const lldb::SBValue & vrValue );
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( const CMIUtilString & vrStrNameReal, const CMIUtilString & vrStrName, const lldb::SBValue & vrValue, const CMIUtilString & vrStrVarObjParentName );
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( const CMICmnLLDBDebugSessionInfoVarObj & vrOther );
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( CMICmnLLDBDebugSessionInfoVarObj & vrOther );
-	/* ctor */	CMICmnLLDBDebugSessionInfoVarObj( CMICmnLLDBDebugSessionInfoVarObj && vrOther );
-	//
-	CMICmnLLDBDebugSessionInfoVarObj & operator= ( const CMICmnLLDBDebugSessionInfoVarObj & vrOther );
-	CMICmnLLDBDebugSessionInfoVarObj & operator= ( CMICmnLLDBDebugSessionInfoVarObj && vrwOther );
-	//
-	const CMIUtilString &	GetName( void ) const;
-	const CMIUtilString &	GetNameReal( void ) const;
-	const CMIUtilString &	GetValueFormatted( void ) const;
-	const lldb::SBValue &	GetValue( void ) const;
-	varType_e				GetType( void ) const;
-	bool					SetVarFormat( const varFormat_e veVarFormat );
-	const CMIUtilString &	GetVarParentName( void ) const;
-	void					UpdateValue( void );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLLDBDebugSessionInfoVarObj( void );
-
-// Typedefs:
-private:
-	typedef std::map< CMIUtilString, CMICmnLLDBDebugSessionInfoVarObj >		MapKeyToVarObj_t;			
-	typedef std::pair< CMIUtilString, CMICmnLLDBDebugSessionInfoVarObj >	MapPairKeyToVarObj_t;
-
-// Statics:
-private:
-	static CMIUtilString 	GetStringFormatted( const MIuint64 vnValue, const MIchar * vpStrValueNatural, varFormat_e veVarFormat );
-	
-// Methods:
-private:
-	bool	CopyOther( const CMICmnLLDBDebugSessionInfoVarObj & vrOther );
-	bool	MoveOther( CMICmnLLDBDebugSessionInfoVarObj & vrwOther );
-
-// Attributes:
-private:
-	static const MIchar *	ms_aVarFormatStrings[];
-	static const MIchar *	ms_aVarFormatChars[];
-	static MapKeyToVarObj_t	ms_mapVarIdToVarObj;
-	static MIuint			ms_nVarUniqueId;
-	//
-	// *** Upate the copy move constructors and assignment operator ***
-	varFormat_e		m_eVarFormat;
-	varType_e		m_eVarType;
-	CMIUtilString	m_strName;
-	lldb::SBValue	m_SBValue;
-	CMIUtilString	m_strNameReal;
-	CMIUtilString	m_strFormattedValue;
-	CMIUtilString	m_strVarObjParentName;
-	// *** Upate the copy move constructors and assignment operator ***
+    // Enums:
+  public:
+    //++ ----------------------------------------------------------------------
+    // Details: Enumeration of a variable type that is not a composite type
+    //--
+    enum varFormat_e
+    {
+        // CODETAG_SESSIONINFO_VARFORMAT_ENUM
+        // *** Order is import here ***
+        eVarFormat_Invalid = 0,
+        eVarFormat_Binary,
+        eVarFormat_Octal,
+        eVarFormat_Decimal,
+        eVarFormat_Hex,
+        eVarFormat_Natural,
+        eVarFormat_count // Always last one
+    };
+
+    //++ ----------------------------------------------------------------------
+    // Details: Enumeration of a variable type by composite or internal type
+    //--
+    enum varType_e
+    {
+        eVarType_InValid = 0,
+        eVarType_Composite, // i.e. struct
+        eVarType_Internal,  // i.e. int
+        eVarType_count      // Always last one
+    };
+
+    // Statics:
+  public:
+    static varFormat_e GetVarFormatForString(const CMIUtilString &vrStrFormat);
+    static varFormat_e GetVarFormatForChar(const MIchar &vrcFormat);
+    static CMIUtilString GetValueStringFormatted(const lldb::SBValue &vrValue, const varFormat_e veVarFormat);
+    static void VarObjAdd(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj);
+    static void VarObjDelete(const CMIUtilString &vrVarName);
+    static bool VarObjGet(const CMIUtilString &vrVarName, CMICmnLLDBDebugSessionInfoVarObj &vrwVarObj);
+    static void VarObjUpdate(const CMICmnLLDBDebugSessionInfoVarObj &vrVarObj);
+    static void VarObjIdInc(void);
+    static MIuint VarObjIdGet(void);
+    static void VarObjIdResetToZero(void);
+    static void VarObjClear(void);
+
+    // Methods:
+  public:
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(void);
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
+                                                const lldb::SBValue &vrValue);
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(const CMIUtilString &vrStrNameReal, const CMIUtilString &vrStrName,
+                                                const lldb::SBValue &vrValue, const CMIUtilString &vrStrVarObjParentName);
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(const CMICmnLLDBDebugSessionInfoVarObj &vrOther);
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &vrOther);
+    /* ctor */ CMICmnLLDBDebugSessionInfoVarObj(CMICmnLLDBDebugSessionInfoVarObj &&vrOther);
+    //
+    CMICmnLLDBDebugSessionInfoVarObj &operator=(const CMICmnLLDBDebugSessionInfoVarObj &vrOther);
+    CMICmnLLDBDebugSessionInfoVarObj &operator=(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther);
+    //
+    const CMIUtilString &GetName(void) const;
+    const CMIUtilString &GetNameReal(void) const;
+    const CMIUtilString &GetValueFormatted(void) const;
+    const lldb::SBValue &GetValue(void) const;
+    varType_e GetType(void) const;
+    bool SetVarFormat(const varFormat_e veVarFormat);
+    const CMIUtilString &GetVarParentName(void) const;
+    void UpdateValue(void);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLLDBDebugSessionInfoVarObj(void);
+
+    // Typedefs:
+  private:
+    typedef std::map<CMIUtilString, CMICmnLLDBDebugSessionInfoVarObj> MapKeyToVarObj_t;
+    typedef std::pair<CMIUtilString, CMICmnLLDBDebugSessionInfoVarObj> MapPairKeyToVarObj_t;
+
+    // Statics:
+  private:
+    static CMIUtilString GetStringFormatted(const MIuint64 vnValue, const MIchar *vpStrValueNatural, varFormat_e veVarFormat);
+
+    // Methods:
+  private:
+    bool CopyOther(const CMICmnLLDBDebugSessionInfoVarObj &vrOther);
+    bool MoveOther(CMICmnLLDBDebugSessionInfoVarObj &vrwOther);
+
+    // Attributes:
+  private:
+    static const MIchar *ms_aVarFormatStrings[];
+    static const MIchar *ms_aVarFormatChars[];
+    static MapKeyToVarObj_t ms_mapVarIdToVarObj;
+    static MIuint ms_nVarUniqueId;
+    //
+    // *** Upate the copy move constructors and assignment operator ***
+    varFormat_e m_eVarFormat;
+    varType_e m_eVarType;
+    CMIUtilString m_strName;
+    lldb::SBValue m_SBValue;
+    CMIUtilString m_strNameReal;
+    CMIUtilString m_strFormattedValue;
+    CMIUtilString m_strVarObjParentName;
+    // *** Upate the copy move constructors and assignment operator ***
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Mon Nov 17 12:06:21 2014
@@ -8,20 +8,20 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugger.cpp
+// File:        MICmnLLDBDebugger.cpp
 //
-// Overview:	CMICmnLLDBDebugger implementation.
+// Overview:    CMICmnLLDBDebugger implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third party headers:
 #include <lldb/API/SBTarget.h>
-#include <lldb/API/SBThread.h> 
+#include <lldb/API/SBThread.h>
 #include <lldb/API/SBProcess.h>
 #include <lldb/API/SBCommandInterpreter.h>
 
@@ -36,672 +36,693 @@
 #include "MIUtilSingletonHelper.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugger constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugger constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugger::CMICmnLLDBDebugger( void )
-:	m_constStrThisThreadId( "MI debugger event" )
+CMICmnLLDBDebugger::CMICmnLLDBDebugger(void)
+    : m_constStrThisThreadId("MI debugger event")
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebugger destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBDebugger destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBDebugger::~CMICmnLLDBDebugger( void )
+CMICmnLLDBDebugger::~CMICmnLLDBDebugger(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this debugger object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Initialize resources for *this debugger object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugger::Initialize( void )
+bool
+CMICmnLLDBDebugger::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-	ClrErrorDescription();
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+    ClrErrorDescription();
 
-	if( m_pClientDriver == nullptr )
-	{
-		bOk = false;
-		errMsg = MIRSRC( IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER );
-	}
-	
-	// Note initialization order is important here as some resources depend on previous
-	MI::ModuleInit< CMICmnLog >                     ( IDS_MI_INIT_ERR_LOG             , bOk, errMsg );
-	MI::ModuleInit< CMICmnResources >               ( IDS_MI_INIT_ERR_RESOURCES       , bOk, errMsg );
-	MI::ModuleInit< CMICmnThreadMgrStd >            ( IDS_MI_INIT_ERR_THREADMGR       , bOk, errMsg );
-	MI::ModuleInit< CMICmnLLDBDebuggerHandleEvents >( IDS_MI_INIT_ERR_OUTOFBANDHANDLER, bOk, errMsg );
-	MI::ModuleInit< CMICmnLLDBDebugSessionInfo >    ( IDS_MI_INIT_ERR_DEBUGSESSIONINFO, bOk, errMsg );
+    if (m_pClientDriver == nullptr)
+    {
+        bOk = false;
+        errMsg = MIRSRC(IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER);
+    }
 
-	// Note order is important here!
-	if( bOk )
-		lldb::SBDebugger::Initialize();
-	if( bOk && !InitSBDebugger() )
-	{
-		bOk = false;
-		if( !errMsg.empty() ) errMsg += ", ";
-		errMsg += GetErrorDescription().c_str();
-	}
-	if( bOk && !InitSBListener() )
-	{
-		bOk = false;
-		if( !errMsg.empty() ) errMsg += ", ";
-		errMsg += GetErrorDescription().c_str();
-	}
-	bOk = bOk && InitStdStreams();
+    // Note initialization order is important here as some resources depend on previous
+    MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+    MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleInit<CMICmnThreadMgrStd>(IDS_MI_INIT_ERR_THREADMGR, bOk, errMsg);
+    MI::ModuleInit<CMICmnLLDBDebuggerHandleEvents>(IDS_MI_INIT_ERR_OUTOFBANDHANDLER, bOk, errMsg);
+    MI::ModuleInit<CMICmnLLDBDebugSessionInfo>(IDS_MI_INIT_ERR_DEBUGSESSIONINFO, bOk, errMsg);
 
-	m_bInitialized = bOk;
+    // Note order is important here!
+    if (bOk)
+        lldb::SBDebugger::Initialize();
+    if (bOk && !InitSBDebugger())
+    {
+        bOk = false;
+        if (!errMsg.empty())
+            errMsg += ", ";
+        errMsg += GetErrorDescription().c_str();
+    }
+    if (bOk && !InitSBListener())
+    {
+        bOk = false;
+        if (!errMsg.empty())
+            errMsg += ", ";
+        errMsg += GetErrorDescription().c_str();
+    }
+    bOk = bOk && InitStdStreams();
 
-	if( !bOk && !HaveErrorDescription() )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_LLDBDEBUGGER ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-	}
+    m_bInitialized = bOk;
 
-	return bOk;
+    if (!bOk && !HaveErrorDescription())
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_LLDBDEBUGGER), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+    }
+
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this debugger object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Release resources for *this debugger object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugger::Shutdown( void )
+bool
+CMICmnLLDBDebugger::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = false;
 
-	m_bInitialized = false;
+    ClrErrorDescription();
 
-	ClrErrorDescription();
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-					
-	// Explicitly delete the remote target in case MI needs to exit prematurely otherwise 
-	// LLDB debugger may hang in its Destroy() fn waiting on events
-	m_lldbDebugger.DeleteTarget( CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget );
+    // Explicitly delete the remote target in case MI needs to exit prematurely otherwise
+    // LLDB debugger may hang in its Destroy() fn waiting on events
+    m_lldbDebugger.DeleteTarget(CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget);
 
-	// Debug: May need this but does seem to work without it so commented out the fudge 19/06/2014
-	// It appears we need to wait as hang does not occur when hitting a debug breakpoint here
-	//const std::chrono::milliseconds time( 1000 );
-	//std::this_thread::sleep_for( time );
-		
-	lldb::SBDebugger::Destroy( m_lldbDebugger );
-	lldb::SBDebugger::Terminate();
-	m_pClientDriver = nullptr;
-	m_mapBroadcastClassNameToEventMask.clear();
-	m_mapIdToEventMask.clear();
+    // Debug: May need this but does seem to work without it so commented out the fudge 19/06/2014
+    // It appears we need to wait as hang does not occur when hitting a debug breakpoint here
+    // const std::chrono::milliseconds time( 1000 );
+    // std::this_thread::sleep_for( time );
 
-	// Note shutdown order is important here
-	MI::ModuleShutdown< CMICmnLLDBDebugSessionInfo >    ( IDS_MI_INIT_ERR_DEBUGSESSIONINFO, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLLDBDebuggerHandleEvents >( IDS_MI_INIT_ERR_OUTOFBANDHANDLER, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnThreadMgrStd >            ( IDS_MI_INIT_ERR_THREADMGR       , bOk, errMsg );
-	MI::ModuleShutdown< CMICmnResources >               ( IDS_MI_INIT_ERR_RESOURCES       , bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLog >                     ( IDS_MI_INIT_ERR_LOG             , bOk, errMsg );
+    lldb::SBDebugger::Destroy(m_lldbDebugger);
+    lldb::SBDebugger::Terminate();
+    m_pClientDriver = nullptr;
+    m_mapBroadcastClassNameToEventMask.clear();
+    m_mapIdToEventMask.clear();
 
-	if( !bOk )
-	{
-		SetErrorDescriptionn( MIRSRC( IDS_MI_SHTDWN_ERR_LLDBDEBUGGER ), errMsg.c_str() );
-	}
+    // Note shutdown order is important here
+    MI::ModuleShutdown<CMICmnLLDBDebugSessionInfo>(IDS_MI_INIT_ERR_DEBUGSESSIONINFO, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLLDBDebuggerHandleEvents>(IDS_MI_INIT_ERR_OUTOFBANDHANDLER, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnThreadMgrStd>(IDS_MI_INIT_ERR_THREADMGR, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
 
-	return MIstatus::success;
-}	
+    if (!bOk)
+    {
+        SetErrorDescriptionn(MIRSRC(IDS_MI_SHTDWN_ERR_LLDBDEBUGGER), errMsg.c_str());
+    }
+
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the LLDB debugger instance created for this debug session.
-// Type:	Method.
-// Args:	None.
-// Return:	lldb::SBDebugger & - LLDB debugger object reference.
-// Throws:	None.
+// Details: Return the LLDB debugger instance created for this debug session.
+// Type:    Method.
+// Args:    None.
+// Return:  lldb::SBDebugger & - LLDB debugger object reference.
+// Throws:  None.
 //--
-lldb::SBDebugger & CMICmnLLDBDebugger::GetTheDebugger( void )
+lldb::SBDebugger &
+CMICmnLLDBDebugger::GetTheDebugger(void)
 {
-	return m_lldbDebugger;
+    return m_lldbDebugger;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the LLDB listener instance created for this debug session.
-// Type:	Method.
-// Args:	None.
-// Return:	lldb::SBListener & - LLDB listener object reference.
-// Throws:	None.
+// Details: Return the LLDB listener instance created for this debug session.
+// Type:    Method.
+// Args:    None.
+// Return:  lldb::SBListener & - LLDB listener object reference.
+// Throws:  None.
 //--
-lldb::SBListener & CMICmnLLDBDebugger::GetTheListener( void )
+lldb::SBListener &
+CMICmnLLDBDebugger::GetTheListener(void)
 {
-	return m_lldbListener;
+    return m_lldbListener;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the client driver that wants to use *this LLDB debugger. Call this function
-//			prior to Initialize().
-// Type:	Method.
-// Args:	vClientDriver	- (R) A driver.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Set the client driver that wants to use *this LLDB debugger. Call this function
+//          prior to Initialize().
+// Type:    Method.
+// Args:    vClientDriver   - (R) A driver.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugger::SetDriver( const CMIDriverBase & vClientDriver )
+bool
+CMICmnLLDBDebugger::SetDriver(const CMIDriverBase &vClientDriver)
 {
-	m_pClientDriver = const_cast< CMIDriverBase * >( &vClientDriver );
+    m_pClientDriver = const_cast<CMIDriverBase *>(&vClientDriver);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Get the client driver that is use *this LLDB debugger.
-// Type:	Method.
-// Args:	vClientDriver	- (R) A driver.
-// Return:	CMIDriverBase & - A driver instance.
-// Throws:	None.
+// Details: Get the client driver that is use *this LLDB debugger.
+// Type:    Method.
+// Args:    vClientDriver   - (R) A driver.
+// Return:  CMIDriverBase & - A driver instance.
+// Throws:  None.
 //--
-CMIDriverBase & CMICmnLLDBDebugger::GetDriver( void ) const
+CMIDriverBase &
+CMICmnLLDBDebugger::GetDriver(void) const
 {
-	return *m_pClientDriver;
+    return *m_pClientDriver;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize the LLDB Debugger object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Initialize the LLDB Debugger object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugger::InitSBDebugger( void )
+bool
+CMICmnLLDBDebugger::InitSBDebugger(void)
 {
-	m_lldbDebugger = lldb::SBDebugger::Create( false );
-	if( m_lldbDebugger.IsValid() )
-		return MIstatus::success;
+    m_lldbDebugger = lldb::SBDebugger::Create(false);
+    if (m_lldbDebugger.IsValid())
+        return MIstatus::success;
 
-	SetErrorDescription( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER ) );
-	return MIstatus::failure;
+    SetErrorDescription(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER));
+    return MIstatus::failure;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the LLDB Debugger's std in, err and out streams. (Not implemented left 
-//			here for reference. Was called in the CMICmnLLDBDebugger::Initialize() )
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Set the LLDB Debugger's std in, err and out streams. (Not implemented left
+//          here for reference. Was called in the CMICmnLLDBDebugger::Initialize() )
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebugger::InitStdStreams( void )
+bool
+CMICmnLLDBDebugger::InitStdStreams(void)
 {
-	// This is not required when operating the MI driver's code as it has its own
-	// streams. Setting the Stdin for the lldbDebugger especially on LINUX will cause
-	// another thread to run and partially consume stdin data meant for MI stdin handler
-	//m_lldbDebugger.SetErrorFileHandle( m_pClientDriver->GetStderr(), false );	
-	//m_lldbDebugger.SetOutputFileHandle( m_pClientDriver->GetStdout(), false );	
-	//m_lldbDebugger.SetInputFileHandle( m_pClientDriver->GetStdin(), false );
+    // This is not required when operating the MI driver's code as it has its own
+    // streams. Setting the Stdin for the lldbDebugger especially on LINUX will cause
+    // another thread to run and partially consume stdin data meant for MI stdin handler
+    // m_lldbDebugger.SetErrorFileHandle( m_pClientDriver->GetStderr(), false );
+    // m_lldbDebugger.SetOutputFileHandle( m_pClientDriver->GetStdout(), false );
+    // m_lldbDebugger.SetInputFileHandle( m_pClientDriver->GetStdin(), false );
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
 // Details: Set up the events from the SBDebugger's we would to listent to.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::InitSBListener( void )
-{
-	m_lldbListener = m_lldbDebugger.GetListener();
-	if( !m_lldbListener.IsValid() )
-	{
-		SetErrorDescription( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER ) );
-		return MIstatus::failure;
-	}
-	
-	const CMIUtilString strDbgId( "CMICmnLLDBDebugger1" );
-	MIuint eventMask = lldb::SBTarget::eBroadcastBitBreakpointChanged;
-	bool bOk = RegisterForEvent( strDbgId, CMIUtilString( lldb::SBTarget::GetBroadcasterClassName() ), eventMask );
-
-	eventMask =	lldb::SBThread::eBroadcastBitStackChanged;
-	bOk = bOk && RegisterForEvent( strDbgId, CMIUtilString( lldb::SBThread::GetBroadcasterClassName() ), eventMask );
-
-	eventMask = lldb::SBProcess::eBroadcastBitStateChanged |
-				lldb::SBProcess::eBroadcastBitInterrupt |	
-				lldb::SBProcess::eBroadcastBitSTDOUT |
-				lldb::SBProcess::eBroadcastBitSTDERR |
-				lldb::SBProcess::eBroadcastBitProfileData;
-	bOk = bOk && RegisterForEvent( strDbgId, CMIUtilString( lldb::SBProcess::GetBroadcasterClassName() ), eventMask );
-
-	eventMask = lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived |
-                lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit |
-				lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData |
-				lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData;
-	bOk = bOk && RegisterForEvent( strDbgId, CMIUtilString( lldb::SBCommandInterpreter::GetBroadcasterClass() ), eventMask );
-	
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Register with the debugger, the SBListener, the type of events you are interested
-//			in. Others, like commands, may have already set the mask.
-// Type:	Method.
-// Args:	vClientName			- (R) ID of the client who wants these events set.
-//			vBroadcasterClass	- (R) The SBBroadcaster's class name.
-//			vEventMask			- (R) The mask of events to listen for.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::RegisterForEvent( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, const MIuint vEventMask )
-{
-	MIuint existingMask = 0;
-	if( !BroadcasterGetMask( vBroadcasterClass, existingMask ) )
-		return MIstatus::failure;
-	
-	if( !ClientSaveMask( vClientName, vBroadcasterClass, vEventMask ) )
-		return MIstatus::failure;
-
-	const MIchar * pBroadCasterName = vBroadcasterClass.c_str();
-	MIuint eventMask = vEventMask;
-	eventMask += existingMask;
-	const MIuint result = m_lldbListener.StartListeningForEventClass( m_lldbDebugger, pBroadCasterName, eventMask );
-	if( result == 0 )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_STARTLISTENER ), pBroadCasterName ) );
-		return MIstatus::failure;
-	}
-
-	return BroadcasterSaveMask( vBroadcasterClass, eventMask );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Register with the debugger, the SBListener, the type of events you are interested
-//			in. Others, like commands, may have already set the mask.
-// Type:	Method.
-// Args:	vClientName		- (R) ID of the client who wants these events set.
-//			vBroadcaster	- (R) An SBBroadcaster's derived class.
-//			vEventMask		- (R) The mask of events to listen for.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::RegisterForEvent( const CMIUtilString & vClientName, const lldb::SBBroadcaster & vBroadcaster, const MIuint vEventMask )
-{
-	const MIchar * pBroadcasterName = vBroadcaster.GetName();
-	if( pBroadcasterName == nullptr )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME ), MIRSRC( IDS_WORD_INVALIDNULLPTR ) ) );
-		return MIstatus::failure;
-	}
-	CMIUtilString broadcasterName( pBroadcasterName );
-	if( broadcasterName.length() == 0 )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME ), MIRSRC( IDS_WORD_INVALIDEMPTY ) ) );
-		return MIstatus::failure;
-	}
-
-	MIuint existingMask = 0;
-	if( !BroadcasterGetMask( broadcasterName, existingMask ) )
-		return MIstatus::failure;
-	
-	if( !ClientSaveMask( vClientName, broadcasterName, vEventMask ) )
-		return MIstatus::failure;
-
-	MIuint eventMask = vEventMask;
-	eventMask += existingMask;
-	const MIuint result = m_lldbListener.StartListeningForEvents( vBroadcaster, eventMask );
-	if( result == 0 )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_STARTLISTENER ), pBroadcasterName ) );
-		return MIstatus::failure;
-	}
-
-	return BroadcasterSaveMask( broadcasterName, eventMask );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Unregister with the debugger, the SBListener, the type of events you are no
-//			longer interested in. Others, like commands, may still remain interested so 
-//			an event may not necessarily be stopped.
-// Type:	Method.
-// Args:	vClientName			- (R) ID of the client who no longer requires these events.
-//			vBroadcasterClass	- (R) The SBBroadcaster's class name.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::UnregisterForEvent( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass )
-{
-	MIuint clientsEventMask = 0;
-	if( !ClientGetTheirMask( vClientName, vBroadcasterClass, clientsEventMask ) )
-		return MIstatus::failure;
-	if( !ClientRemoveTheirMask( vClientName, vBroadcasterClass ) )
-		return MIstatus::failure;
-	
-	const MIuint otherClientsEventMask = ClientGetMaskForAllClients( vBroadcasterClass );
-	MIuint newEventMask = 0;
-	for( MIuint i = 0; i < 32; i++ )
-	{
-		const MIuint bit = 1 << i;
-		const MIuint clientBit = bit & clientsEventMask;
-		const MIuint othersBit = bit & otherClientsEventMask;
-		if( (clientBit != 0) && (othersBit == 0) )
-		{
-			newEventMask += clientBit;
-		}
-	}
-	
-	const MIchar * pBroadCasterName = vBroadcasterClass.c_str();
-	if( !m_lldbListener.StopListeningForEventClass( m_lldbDebugger, pBroadCasterName, newEventMask ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_STOPLISTENER ), vClientName.c_str(), pBroadCasterName ) );
-		return MIstatus::failure;
-	}
-
-	return BroadcasterSaveMask( vBroadcasterClass, otherClientsEventMask );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Given the SBBroadcaster class name retrieve it's current event mask.
-// Type:	Method.
-// Args:	vBroadcasterClass	- (R) The SBBroadcaster's class name.
-//			vEventMask			- (W) The mask of events to listen for.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::BroadcasterGetMask( const CMIUtilString & vBroadcasterClass, MIuint & vwEventMask ) const
-{
-	vwEventMask = 0;
-
-	if( vBroadcasterClass.empty() )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER ), vBroadcasterClass.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	const MapBroadcastClassNameToEventMask_t::const_iterator it = m_mapBroadcastClassNameToEventMask.find( vBroadcasterClass );
-	if( it != m_mapBroadcastClassNameToEventMask.end() )
-	{
-		vwEventMask = (*it).second;
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Remove the event mask for the specified SBBroadcaster class name.
-// Type:	Method.
-// Args:	vBroadcasterClass	- (R) The SBBroadcaster's class name.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::BroadcasterRemoveMask( const CMIUtilString & vBroadcasterClass )
-{
-	MapBroadcastClassNameToEventMask_t::const_iterator it = m_mapBroadcastClassNameToEventMask.find( vBroadcasterClass );
-	if( it != m_mapBroadcastClassNameToEventMask.end() )
-	{
-		m_mapBroadcastClassNameToEventMask.erase( it );
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Given the SBBroadcaster class name save it's current event mask.
-// Type:	Method.
-// Args:	vBroadcasterClass	- (R) The SBBroadcaster's class name.
-//			vEventMask			- (R) The mask of events to listen for.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::BroadcasterSaveMask( const CMIUtilString & vBroadcasterClass, const MIuint vEventMask ) 
-{
-	if( vBroadcasterClass.empty() )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER ), vBroadcasterClass.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	BroadcasterRemoveMask( vBroadcasterClass );
-	MapPairBroadcastClassNameToEventMask_t pr( vBroadcasterClass, vEventMask );
-	m_mapBroadcastClassNameToEventMask.insert( pr );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Iterate all the clients who have registered event masks against particular
-//			SBBroadcasters and build up the mask that is for all of them.
-// Type:	Method.
-// Args:	vBroadcasterClass	- (R) The broadcaster to retrieve the mask for.
-// Return:	MIuint - Event mask.
-// Throws:	None.
-//--
-MIuint CMICmnLLDBDebugger::ClientGetMaskForAllClients( const CMIUtilString & vBroadcasterClass ) const
-{
-	MIuint mask = 0;
-	MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.begin();
-	while( it != m_mapIdToEventMask.end() )
-	{
-		const CMIUtilString & rId( (*it).first );
-		if( rId.find( vBroadcasterClass.c_str() ) != std::string::npos )
-		{
-			const MIuint clientsMask = (*it).second;
-			mask |= clientsMask;
-		}
-
-		// Next
-		++it;
-	}
-
-	return mask;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Given the client save its particular event requirements.
-// Type:	Method.
-// Args:	vClientName			- (R) The Client's unique ID.
-//			vBroadcasterClass	- (R) The SBBroadcaster's class name targeted for the events.
-//			vEventMask			- (R) The mask of events to listen for.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::ClientSaveMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, const MIuint vEventMask )
-{
-	if( vClientName.empty() )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME ), vClientName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	CMIUtilString strId( vBroadcasterClass );
-	strId += vClientName;
-
-	ClientRemoveTheirMask( vClientName, vBroadcasterClass );
-	MapPairIdToEventMask_t pr( strId, vEventMask );
-	m_mapIdToEventMask.insert( pr );
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Given the client remove it's particular event requirements.
-// Type:	Method.
-// Args:	vClientName			- (R) The Client's unique ID.
-//			vBroadcasterClass	- (R) The SBBroadcaster's class name.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::ClientRemoveTheirMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass )
-{
-	if( vClientName.empty() )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME ), vClientName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	CMIUtilString strId( vBroadcasterClass );
-	strId += vClientName;
-
-	const MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.find( strId );
-	if( it != m_mapIdToEventMask.end() )
-	{
-		m_mapIdToEventMask.erase( it );
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the client's event mask used for on a particular SBBroadcaster.
-// Type:	Method.
-// Args:	vClientName			- (R) The Client's unique ID.
-//			vBroadcasterClass	- (R) The SBBroadcaster's class name.
-//			vwEventMask			- (W) The client's mask.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::ClientGetTheirMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, MIuint & vwEventMask )
-{
-	vwEventMask = 0;
-
-	if( vClientName.empty() )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME ), vClientName.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	CMIUtilString strId( vBroadcasterClass.c_str() );
-	strId += vClientName;
-
-	const MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.find( strId );
-	if( it != m_mapIdToEventMask.end() )
-	{
-		vwEventMask = (*it).second;
-	}
-
-	SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD ), vClientName.c_str() ) );
-
-	return MIstatus::failure;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Momentarily wait for an events being broadcast and inspect those that do
-//			come this way. Check if the target should exit event if so start shutting
-//			down this thread and the application. Any other events pass on to the 
-//			Out-of-band handler to futher determine what kind of event arrived.
-//			This function runs in the thread "MI debugger event".
-// Type:	Method.
-// Args:	vrbIsAlive	- (W) False = yes exit event monitoring thread, true = continue.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::MonitorSBListenerEvents( bool & vrbIsAlive )
-{
-	vrbIsAlive = true;
-
-	lldb::SBEvent event;
-	const bool bGotEvent = m_lldbListener.GetNextEvent( event );
-	if ( !bGotEvent || !event.IsValid() )
-	{
-		const std::chrono::milliseconds time( 1 );
-		std::this_thread::sleep_for( time );
-		return MIstatus::success;
-	}
-	if( !event.GetBroadcaster().IsValid() )
-		return MIstatus::success;
-
-	// Debugging
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An event occurred: %s", event.GetBroadcasterClass() ) );
-
-	bool bHandledEvent = false;
-	bool bExitAppEvent = false;
-	const bool bOk = CMICmnLLDBDebuggerHandleEvents::Instance().HandleEvent( event, bHandledEvent, bExitAppEvent );
-	if( !bHandledEvent )
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT ), event.GetBroadcasterClass() ) );
-		m_pLog->WriteLog( msg );
-	}
-	if( !bOk )
-	{
-		m_pLog->WriteLog( CMICmnLLDBDebuggerHandleEvents::Instance().GetErrorDescription() );
-	}
-	
-	if( bExitAppEvent )
-	{
-		// Set the application to shutdown
-		m_pClientDriver->SetExitApplicationFlag( true );
-
-		// Kill *this thread
-		vrbIsAlive = false;
-	}
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	The main worker method for this thread.
-// Type:	Method.
-// Args:	vrbIsAlive	= (W) True = *this thread is working, false = thread has exited.			
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::ThreadRun( bool & vrbIsAlive )
-{
-	return MonitorSBListenerEvents( vrbIsAlive );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Let this thread clean up after itself.
-// Type:	Method.
-// Args:	
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebugger::ThreadFinish( void )
-{
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Retrieve *this thread object's name.
-// Type:	Overridden.
-// Args:	None.			
-// Return:	CMIUtilString & - Text.
-// Throws:	None.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::InitSBListener(void)
+{
+    m_lldbListener = m_lldbDebugger.GetListener();
+    if (!m_lldbListener.IsValid())
+    {
+        SetErrorDescription(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER));
+        return MIstatus::failure;
+    }
+
+    const CMIUtilString strDbgId("CMICmnLLDBDebugger1");
+    MIuint eventMask = lldb::SBTarget::eBroadcastBitBreakpointChanged;
+    bool bOk = RegisterForEvent(strDbgId, CMIUtilString(lldb::SBTarget::GetBroadcasterClassName()), eventMask);
+
+    eventMask = lldb::SBThread::eBroadcastBitStackChanged;
+    bOk = bOk && RegisterForEvent(strDbgId, CMIUtilString(lldb::SBThread::GetBroadcasterClassName()), eventMask);
+
+    eventMask = lldb::SBProcess::eBroadcastBitStateChanged | lldb::SBProcess::eBroadcastBitInterrupt |
+                lldb::SBProcess::eBroadcastBitSTDOUT | lldb::SBProcess::eBroadcastBitSTDERR | lldb::SBProcess::eBroadcastBitProfileData;
+    bOk = bOk && RegisterForEvent(strDbgId, CMIUtilString(lldb::SBProcess::GetBroadcasterClassName()), eventMask);
+
+    eventMask = lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived | lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit |
+                lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData |
+                lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData;
+    bOk = bOk && RegisterForEvent(strDbgId, CMIUtilString(lldb::SBCommandInterpreter::GetBroadcasterClass()), eventMask);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Register with the debugger, the SBListener, the type of events you are interested
+//          in. Others, like commands, may have already set the mask.
+// Type:    Method.
+// Args:    vClientName         - (R) ID of the client who wants these events set.
+//          vBroadcasterClass   - (R) The SBBroadcaster's class name.
+//          vEventMask          - (R) The mask of events to listen for.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::RegisterForEvent(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, const MIuint vEventMask)
+{
+    MIuint existingMask = 0;
+    if (!BroadcasterGetMask(vBroadcasterClass, existingMask))
+        return MIstatus::failure;
+
+    if (!ClientSaveMask(vClientName, vBroadcasterClass, vEventMask))
+        return MIstatus::failure;
+
+    const MIchar *pBroadCasterName = vBroadcasterClass.c_str();
+    MIuint eventMask = vEventMask;
+    eventMask += existingMask;
+    const MIuint result = m_lldbListener.StartListeningForEventClass(m_lldbDebugger, pBroadCasterName, eventMask);
+    if (result == 0)
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_STARTLISTENER), pBroadCasterName));
+        return MIstatus::failure;
+    }
+
+    return BroadcasterSaveMask(vBroadcasterClass, eventMask);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Register with the debugger, the SBListener, the type of events you are interested
+//          in. Others, like commands, may have already set the mask.
+// Type:    Method.
+// Args:    vClientName     - (R) ID of the client who wants these events set.
+//          vBroadcaster    - (R) An SBBroadcaster's derived class.
+//          vEventMask      - (R) The mask of events to listen for.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::RegisterForEvent(const CMIUtilString &vClientName, const lldb::SBBroadcaster &vBroadcaster, const MIuint vEventMask)
+{
+    const MIchar *pBroadcasterName = vBroadcaster.GetName();
+    if (pBroadcasterName == nullptr)
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME), MIRSRC(IDS_WORD_INVALIDNULLPTR)));
+        return MIstatus::failure;
+    }
+    CMIUtilString broadcasterName(pBroadcasterName);
+    if (broadcasterName.length() == 0)
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME), MIRSRC(IDS_WORD_INVALIDEMPTY)));
+        return MIstatus::failure;
+    }
+
+    MIuint existingMask = 0;
+    if (!BroadcasterGetMask(broadcasterName, existingMask))
+        return MIstatus::failure;
+
+    if (!ClientSaveMask(vClientName, broadcasterName, vEventMask))
+        return MIstatus::failure;
+
+    MIuint eventMask = vEventMask;
+    eventMask += existingMask;
+    const MIuint result = m_lldbListener.StartListeningForEvents(vBroadcaster, eventMask);
+    if (result == 0)
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_STARTLISTENER), pBroadcasterName));
+        return MIstatus::failure;
+    }
+
+    return BroadcasterSaveMask(broadcasterName, eventMask);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Unregister with the debugger, the SBListener, the type of events you are no
+//          longer interested in. Others, like commands, may still remain interested so
+//          an event may not necessarily be stopped.
+// Type:    Method.
+// Args:    vClientName         - (R) ID of the client who no longer requires these events.
+//          vBroadcasterClass   - (R) The SBBroadcaster's class name.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::UnregisterForEvent(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass)
+{
+    MIuint clientsEventMask = 0;
+    if (!ClientGetTheirMask(vClientName, vBroadcasterClass, clientsEventMask))
+        return MIstatus::failure;
+    if (!ClientRemoveTheirMask(vClientName, vBroadcasterClass))
+        return MIstatus::failure;
+
+    const MIuint otherClientsEventMask = ClientGetMaskForAllClients(vBroadcasterClass);
+    MIuint newEventMask = 0;
+    for (MIuint i = 0; i < 32; i++)
+    {
+        const MIuint bit = 1 << i;
+        const MIuint clientBit = bit & clientsEventMask;
+        const MIuint othersBit = bit & otherClientsEventMask;
+        if ((clientBit != 0) && (othersBit == 0))
+        {
+            newEventMask += clientBit;
+        }
+    }
+
+    const MIchar *pBroadCasterName = vBroadcasterClass.c_str();
+    if (!m_lldbListener.StopListeningForEventClass(m_lldbDebugger, pBroadCasterName, newEventMask))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_STOPLISTENER), vClientName.c_str(), pBroadCasterName));
+        return MIstatus::failure;
+    }
+
+    return BroadcasterSaveMask(vBroadcasterClass, otherClientsEventMask);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Given the SBBroadcaster class name retrieve it's current event mask.
+// Type:    Method.
+// Args:    vBroadcasterClass   - (R) The SBBroadcaster's class name.
+//          vEventMask          - (W) The mask of events to listen for.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::BroadcasterGetMask(const CMIUtilString &vBroadcasterClass, MIuint &vwEventMask) const
+{
+    vwEventMask = 0;
+
+    if (vBroadcasterClass.empty())
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER), vBroadcasterClass.c_str()));
+        return MIstatus::failure;
+    }
+
+    const MapBroadcastClassNameToEventMask_t::const_iterator it = m_mapBroadcastClassNameToEventMask.find(vBroadcasterClass);
+    if (it != m_mapBroadcastClassNameToEventMask.end())
+    {
+        vwEventMask = (*it).second;
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Remove the event mask for the specified SBBroadcaster class name.
+// Type:    Method.
+// Args:    vBroadcasterClass - (R) The SBBroadcaster's class name.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::BroadcasterRemoveMask(const CMIUtilString &vBroadcasterClass)
+{
+    MapBroadcastClassNameToEventMask_t::const_iterator it = m_mapBroadcastClassNameToEventMask.find(vBroadcasterClass);
+    if (it != m_mapBroadcastClassNameToEventMask.end())
+    {
+        m_mapBroadcastClassNameToEventMask.erase(it);
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Given the SBBroadcaster class name save it's current event mask.
+// Type:    Method.
+// Args:    vBroadcasterClass - (R) The SBBroadcaster's class name.
+//          vEventMask        - (R) The mask of events to listen for.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::BroadcasterSaveMask(const CMIUtilString &vBroadcasterClass, const MIuint vEventMask)
+{
+    if (vBroadcasterClass.empty())
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER), vBroadcasterClass.c_str()));
+        return MIstatus::failure;
+    }
+
+    BroadcasterRemoveMask(vBroadcasterClass);
+    MapPairBroadcastClassNameToEventMask_t pr(vBroadcasterClass, vEventMask);
+    m_mapBroadcastClassNameToEventMask.insert(pr);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Iterate all the clients who have registered event masks against particular
+//          SBBroadcasters and build up the mask that is for all of them.
+// Type:    Method.
+// Args:    vBroadcasterClass   - (R) The broadcaster to retrieve the mask for.
+// Return:  MIuint - Event mask.
+// Throws:  None.
+//--
+MIuint
+CMICmnLLDBDebugger::ClientGetMaskForAllClients(const CMIUtilString &vBroadcasterClass) const
+{
+    MIuint mask = 0;
+    MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.begin();
+    while (it != m_mapIdToEventMask.end())
+    {
+        const CMIUtilString &rId((*it).first);
+        if (rId.find(vBroadcasterClass.c_str()) != std::string::npos)
+        {
+            const MIuint clientsMask = (*it).second;
+            mask |= clientsMask;
+        }
+
+        // Next
+        ++it;
+    }
+
+    return mask;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Given the client save its particular event requirements.
+// Type:    Method.
+// Args:    vClientName       - (R) The Client's unique ID.
+//          vBroadcasterClass - (R) The SBBroadcaster's class name targeted for the events.
+//          vEventMask        - (R) The mask of events to listen for.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::ClientSaveMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, const MIuint vEventMask)
+{
+    if (vClientName.empty())
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME), vClientName.c_str()));
+        return MIstatus::failure;
+    }
+
+    CMIUtilString strId(vBroadcasterClass);
+    strId += vClientName;
+
+    ClientRemoveTheirMask(vClientName, vBroadcasterClass);
+    MapPairIdToEventMask_t pr(strId, vEventMask);
+    m_mapIdToEventMask.insert(pr);
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Given the client remove it's particular event requirements.
+// Type:    Method.
+// Args:    vClientName       - (R) The Client's unique ID.
+//          vBroadcasterClass - (R) The SBBroadcaster's class name.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::ClientRemoveTheirMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass)
+{
+    if (vClientName.empty())
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME), vClientName.c_str()));
+        return MIstatus::failure;
+    }
+
+    CMIUtilString strId(vBroadcasterClass);
+    strId += vClientName;
+
+    const MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.find(strId);
+    if (it != m_mapIdToEventMask.end())
+    {
+        m_mapIdToEventMask.erase(it);
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve the client's event mask used for on a particular SBBroadcaster.
+// Type:    Method.
+// Args:    vClientName       - (R) The Client's unique ID.
+//          vBroadcasterClass - (R) The SBBroadcaster's class name.
+//          vwEventMask       - (W) The client's mask.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::ClientGetTheirMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, MIuint &vwEventMask)
+{
+    vwEventMask = 0;
+
+    if (vClientName.empty())
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME), vClientName.c_str()));
+        return MIstatus::failure;
+    }
+
+    CMIUtilString strId(vBroadcasterClass.c_str());
+    strId += vClientName;
+
+    const MapIdToEventMask_t::const_iterator it = m_mapIdToEventMask.find(strId);
+    if (it != m_mapIdToEventMask.end())
+    {
+        vwEventMask = (*it).second;
+    }
+
+    SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD), vClientName.c_str()));
+
+    return MIstatus::failure;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Momentarily wait for an events being broadcast and inspect those that do
+//          come this way. Check if the target should exit event if so start shutting
+//          down this thread and the application. Any other events pass on to the
+//          Out-of-band handler to futher determine what kind of event arrived.
+//          This function runs in the thread "MI debugger event".
+// Type:    Method.
+// Args:    vrbIsAlive  - (W) False = yes exit event monitoring thread, true = continue.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::MonitorSBListenerEvents(bool &vrbIsAlive)
+{
+    vrbIsAlive = true;
+
+    lldb::SBEvent event;
+    const bool bGotEvent = m_lldbListener.GetNextEvent(event);
+    if (!bGotEvent || !event.IsValid())
+    {
+        const std::chrono::milliseconds time(1);
+        std::this_thread::sleep_for(time);
+        return MIstatus::success;
+    }
+    if (!event.GetBroadcaster().IsValid())
+        return MIstatus::success;
+
+    // Debugging
+    m_pLog->WriteLog(CMIUtilString::Format("##### An event occurred: %s", event.GetBroadcasterClass()));
+
+    bool bHandledEvent = false;
+    bool bExitAppEvent = false;
+    const bool bOk = CMICmnLLDBDebuggerHandleEvents::Instance().HandleEvent(event, bHandledEvent, bExitAppEvent);
+    if (!bHandledEvent)
+    {
+        const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT), event.GetBroadcasterClass()));
+        m_pLog->WriteLog(msg);
+    }
+    if (!bOk)
+    {
+        m_pLog->WriteLog(CMICmnLLDBDebuggerHandleEvents::Instance().GetErrorDescription());
+    }
+
+    if (bExitAppEvent)
+    {
+        // Set the application to shutdown
+        m_pClientDriver->SetExitApplicationFlag(true);
+
+        // Kill *this thread
+        vrbIsAlive = false;
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: The main worker method for this thread.
+// Type:    Method.
+// Args:    vrbIsAlive  - (W) True = *this thread is working, false = thread has exited.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::ThreadRun(bool &vrbIsAlive)
+{
+    return MonitorSBListenerEvents(vrbIsAlive);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Let this thread clean up after itself.
+// Type:    Method.
+// Args:
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebugger::ThreadFinish(void)
+{
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Retrieve *this thread object's name.
+// Type:    Overridden.
+// Args:    None.
+// Return:  CMIUtilString & - Text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLLDBDebugger::ThreadGetName( void ) const
+const CMIUtilString &
+CMICmnLLDBDebugger::ThreadGetName(void) const
 {
-	return m_constStrThisThreadId;
+    return m_constStrThisThreadId;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebugger.h
+// File:        MICmnLLDBDebugger.h
 //
-// Overview:	CMICmnLLDBDebugger interface.
+// Overview:    CMICmnLLDBDebugger interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -38,88 +38,84 @@ class CMIDriverBase;
 class CMICmnLLDBDebuggerHandleEvents;
 
 //++ ============================================================================
-// Details:	MI proxy/adapter for the LLDB public SBDebugger API. The CMIDriver
-//			requires *this object. Command classes make calls on *this object
-//			to facilitate their work effort. The instance runs in its own worker
-//			thread.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 26/02/2014.
-// Changes:	None.
+// Details: MI proxy/adapter for the LLDB public SBDebugger API. The CMIDriver
+//          requires *this object. Command classes make calls on *this object
+//          to facilitate their work effort. The instance runs in its own worker
+//          thread.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 26/02/2014.
+// Changes: None.
 //--
-class CMICmnLLDBDebugger
-:	public CMICmnBase
-,	public CMIUtilThreadActiveObjBase
-,	public MI::ISingleton< CMICmnLLDBDebugger >
+class CMICmnLLDBDebugger : public CMICmnBase, public CMIUtilThreadActiveObjBase, public MI::ISingleton<CMICmnLLDBDebugger>
 {
-	friend class MI::ISingleton< CMICmnLLDBDebugger >;
-	
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	
-	bool				SetDriver( const CMIDriverBase & vClientDriver );
-	CMIDriverBase &		GetDriver( void ) const;
-	lldb::SBDebugger &	GetTheDebugger( void );
-	lldb::SBListener &	GetTheListener( void );
-	
-	// MI Commands can use these functions to listen for events they require 
-	bool RegisterForEvent( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, const MIuint vEventMask );
-	bool UnregisterForEvent( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass );
-	bool RegisterForEvent( const CMIUtilString & vClientName, const lldb::SBBroadcaster & vBroadcaster, const MIuint vEventMask );	
-	bool UnregisterForEvent( const CMIUtilString & vClientName, const lldb::SBBroadcaster & vBroadcaster );							
-	
-// Overridden:
-public:
-	// From CMIUtilThreadActiveObjBase
-	virtual const CMIUtilString & ThreadGetName( void ) const;
-
-// Overridden:
-protected:
-	// From CMIUtilThreadActiveObjBase
-	virtual bool ThreadRun( bool & vrIsAlive );
-	virtual bool ThreadFinish( void );
-	
-// Typedefs:
-private:
-	typedef std::map< CMIUtilString, MIuint >	MapBroadcastClassNameToEventMask_t;
-	typedef std::pair< CMIUtilString, MIuint >	MapPairBroadcastClassNameToEventMask_t;
-	typedef std::map< CMIUtilString, MIuint >	MapIdToEventMask_t;
-	typedef std::pair< CMIUtilString, MIuint >	MapPairIdToEventMask_t;
-
-// Methods:
-private:
-	/* ctor */	CMICmnLLDBDebugger( void );
-	/* ctor */	CMICmnLLDBDebugger( const CMICmnLLDBDebugger & );
-	void		operator=( const CMICmnLLDBDebugger & );
-	
-	bool InitSBDebugger( void );
-	bool InitSBListener( void );
-	bool InitStdStreams( void );
-	bool MonitorSBListenerEvents( bool & vrbYesExit );
-	
-	bool BroadcasterGetMask( const CMIUtilString & vBroadcasterClass, MIuint & vEventMask ) const;
-	bool BroadcasterRemoveMask( const CMIUtilString & vBroadcasterClass );
-	bool BroadcasterSaveMask( const CMIUtilString & vBroadcasterClass, const MIuint vEventMask );
-	
-	MIuint	ClientGetMaskForAllClients( const CMIUtilString & vBroadcasterClass ) const;
-	bool	ClientSaveMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, const MIuint vEventMask );
-	bool	ClientRemoveTheirMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass );
-	bool	ClientGetTheirMask( const CMIUtilString & vClientName, const CMIUtilString & vBroadcasterClass, MIuint & vwEventMask );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLLDBDebugger( void );
-
-// Attributes:
-private:
-	CMIDriverBase *						m_pClientDriver;		// The driver that wants to use *this LLDB debugger
-	lldb::SBDebugger					m_lldbDebugger;			// SBDebugger is the primordial object that creates SBTargets and provides access to them
-	lldb::SBListener					m_lldbListener;			// API clients can register its own listener to debugger events 
-	const CMIUtilString					m_constStrThisThreadId;
-	MapBroadcastClassNameToEventMask_t	m_mapBroadcastClassNameToEventMask;
-	MapIdToEventMask_t					m_mapIdToEventMask;
-};
+    friend class MI::ISingleton<CMICmnLLDBDebugger>;
 
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+
+    bool SetDriver(const CMIDriverBase &vClientDriver);
+    CMIDriverBase &GetDriver(void) const;
+    lldb::SBDebugger &GetTheDebugger(void);
+    lldb::SBListener &GetTheListener(void);
+
+    // MI Commands can use these functions to listen for events they require
+    bool RegisterForEvent(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, const MIuint vEventMask);
+    bool UnregisterForEvent(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass);
+    bool RegisterForEvent(const CMIUtilString &vClientName, const lldb::SBBroadcaster &vBroadcaster, const MIuint vEventMask);
+    bool UnregisterForEvent(const CMIUtilString &vClientName, const lldb::SBBroadcaster &vBroadcaster);
+
+    // Overridden:
+  public:
+    // From CMIUtilThreadActiveObjBase
+    virtual const CMIUtilString &ThreadGetName(void) const;
+
+    // Overridden:
+  protected:
+    // From CMIUtilThreadActiveObjBase
+    virtual bool ThreadRun(bool &vrIsAlive);
+    virtual bool ThreadFinish(void);
+
+    // Typedefs:
+  private:
+    typedef std::map<CMIUtilString, MIuint> MapBroadcastClassNameToEventMask_t;
+    typedef std::pair<CMIUtilString, MIuint> MapPairBroadcastClassNameToEventMask_t;
+    typedef std::map<CMIUtilString, MIuint> MapIdToEventMask_t;
+    typedef std::pair<CMIUtilString, MIuint> MapPairIdToEventMask_t;
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnLLDBDebugger(void);
+    /* ctor */ CMICmnLLDBDebugger(const CMICmnLLDBDebugger &);
+    void operator=(const CMICmnLLDBDebugger &);
+
+    bool InitSBDebugger(void);
+    bool InitSBListener(void);
+    bool InitStdStreams(void);
+    bool MonitorSBListenerEvents(bool &vrbYesExit);
+
+    bool BroadcasterGetMask(const CMIUtilString &vBroadcasterClass, MIuint &vEventMask) const;
+    bool BroadcasterRemoveMask(const CMIUtilString &vBroadcasterClass);
+    bool BroadcasterSaveMask(const CMIUtilString &vBroadcasterClass, const MIuint vEventMask);
+
+    MIuint ClientGetMaskForAllClients(const CMIUtilString &vBroadcasterClass) const;
+    bool ClientSaveMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, const MIuint vEventMask);
+    bool ClientRemoveTheirMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass);
+    bool ClientGetTheirMask(const CMIUtilString &vClientName, const CMIUtilString &vBroadcasterClass, MIuint &vwEventMask);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLLDBDebugger(void);
+
+    // Attributes:
+  private:
+    CMIDriverBase *m_pClientDriver;  // The driver that wants to use *this LLDB debugger
+    lldb::SBDebugger m_lldbDebugger; // SBDebugger is the primordial object that creates SBTargets and provides access to them
+    lldb::SBListener m_lldbListener; // API clients can register its own listener to debugger events
+    const CMIUtilString m_constStrThisThreadId;
+    MapBroadcastClassNameToEventMask_t m_mapBroadcastClassNameToEventMask;
+    MapIdToEventMask_t m_mapIdToEventMask;
+};

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebuggerHandleEvents.cpp
+// File:        MICmnLLDBDebuggerHandleEvents.cpp
 //
-// Overview:	CMICmnLLDBDebuggerHandleEvents implementation.
+// Overview:    CMICmnLLDBDebuggerHandleEvents implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third party headers:
@@ -28,10 +28,10 @@
 #include <lldb/API/SBCommandInterpreter.h>
 #include <lldb/API/SBCommandReturnObject.h>
 #ifdef _WIN32
-	#include <io.h>			// For the ::_access()
+#include <io.h> // For the ::_access()
 #else
-	#include <unistd.h>		// For the ::access()
-#endif // _WIN32
+#include <unistd.h> // For the ::access()
+#endif              // _WIN32
 #include <limits.h>
 
 // In-house headers:
@@ -49,1493 +49,1559 @@
 #include "MIDriver.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebuggerHandleEvents constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmnLLDBDebuggerHandleEvents::CMICmnLLDBDebuggerHandleEvents( void )
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBDebuggerHandleEvents destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmnLLDBDebuggerHandleEvents::~CMICmnLLDBDebuggerHandleEvents( void )
-{
-	Shutdown();
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this broardcaster object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::Initialize( void )
-{
-	m_clientUsageRefCnt++;
-
-	if( m_bInitialized )
-		return MIstatus::success;
-
-	m_bInitialized = MIstatus::success;
-	
-	return m_bInitialized;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this broardcaster object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::Shutdown( void )
-{
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
-
-	m_bInitialized = false;
-
-	return MIstatus::success;
-}	
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Interpret the event object to asscertain the action to take or information to
-//			to form and put in a MI Out-of-band record object which is given to stdout.
-// Type:	Method.
-// Args:	vEvent			- (R) An LLDB broadcast event.
-//			vrbHandledEvent	- (W) True - event handled, false = not handled.
-//			vrbExitAppEvent	- (W) True - Received LLDB exit app event, false = did not.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEvent( const lldb::SBEvent & vEvent, bool & vrbHandledEvent, bool & vrbExitAppEvent )
-{
-	bool bOk = MIstatus::success;
-	vrbHandledEvent = false;
-	vrbExitAppEvent = false;
-	
-	if( lldb::SBProcess::EventIsProcessEvent( vEvent ) )
-	{
-		vrbHandledEvent = true;
-		bOk = HandleEventSBProcess( vEvent, vrbExitAppEvent );
-	}
-	else if( lldb::SBBreakpoint::EventIsBreakpointEvent( vEvent ) )
-	{
-		vrbHandledEvent = true;
-		bOk = HandleEventSBBreakPoint( vEvent );
-	}
-	else if( lldb::SBThread::EventIsThreadEvent( vEvent ) )
-	{
-		vrbHandledEvent = true;
-		bOk = HandleEventSBThread( vEvent );
-	}
-	
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBProcess event.
-// Type:	Method.
-// Args:	vEvent			- (R) An LLDB broadcast event.
-//			vrbExitAppEvent	- (W) True - Received LLDB exit app event, false = did not.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBProcess( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent )
-{
-	bool bOk = MIstatus::success;
-
-	const MIchar * pEventType = "";
-	const MIuint nEventType = vEvent.GetType();
-	switch( nEventType )
-	{
-	case lldb::SBProcess::eBroadcastBitInterrupt:
-		pEventType = "eBroadcastBitInterrupt";
-		break;
-	case lldb::SBProcess::eBroadcastBitProfileData:
-		pEventType = "eBroadcastBitProfileData";
-		break;
-	case lldb::SBProcess::eBroadcastBitStateChanged:
-		pEventType = "eBroadcastBitStateChanged";
-		bOk = HandleProcessEventBroadcastBitStateChanged( vEvent, vrbExitAppEvent );
-		break;
-	case lldb::SBProcess::eBroadcastBitSTDERR:
-		pEventType = "eBroadcastBitSTDERR";
-		bOk = GetProcessStderr();
-		break;
-	case lldb::SBProcess::eBroadcastBitSTDOUT:
-		pEventType = "eBroadcastBitSTDOUT";
-		bOk = GetProcessStdout();
-		break;
-	default:
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT ), "SBProcess", (MIuint) nEventType ) );
-		SetErrorDescription( msg );
-		return MIstatus::failure;
-	}
-	}
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SB Process event occurred: %s", pEventType ) );
-
-	return bOk;
-}
-  
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBBreakpoint event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakPoint( const lldb::SBEvent & vEvent )
-{
-	bool bOk = MIstatus::success;
-
-	const MIchar * pEventType ="";
-    const lldb::BreakpointEventType eEvent = lldb::SBBreakpoint::GetBreakpointEventTypeFromEvent( vEvent );
-	switch( eEvent )
-	{
-	case lldb::eBreakpointEventTypeThreadChanged:
-		pEventType = "eBreakpointEventTypeThreadChanged";
-		break;
-	case lldb::eBreakpointEventTypeLocationsRemoved:
-		pEventType = "eBreakpointEventTypeLocationsRemoved";
-		break;
-    case lldb::eBreakpointEventTypeInvalidType:
-		pEventType = "eBreakpointEventTypeInvalidType";
-		break;
-    case lldb::eBreakpointEventTypeLocationsAdded:
-		pEventType = "eBreakpointEventTypeLocationsAdded";
-		bOk = HandleEventSBBreakpointLocationsAdded( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeAdded:
-		pEventType = "eBreakpointEventTypeAdded";
-		bOk = HandleEventSBBreakpointAdded( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeRemoved:
-		pEventType = "eBreakpointEventTypeRemoved";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeLocationsResolved:
-		pEventType = "eBreakpointEventTypeLocationsResolved";
-		break;
-    case lldb::eBreakpointEventTypeEnabled:
-		pEventType ="eBreakpointEventTypeEnabled";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeDisabled:
-		pEventType = "eBreakpointEventTypeDisabled";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeCommandChanged:
-		pEventType = "eBreakpointEventTypeCommandChanged";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeConditionChanged:
-		pEventType ="eBreakpointEventTypeConditionChanged";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-    case lldb::eBreakpointEventTypeIgnoreChanged:
-		pEventType = "eBreakpointEventTypeIgnoreChanged";
-		bOk = HandleEventSBBreakpointCmn( vEvent );
-		break;
-	}
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SB Breakpoint event occurred: %s", pEventType ) );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBBreakpoint event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointLocationsAdded( const lldb::SBEvent & vEvent )
-{
-	const MIuint nLoc = lldb::SBBreakpoint::GetNumBreakpointLocationsFromEvent( vEvent );
-	if( nLoc == 0 )
-		return MIstatus::success;
-
-	lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent( vEvent );
-	const CMIUtilString plural( (nLoc == 1) ? "" : "s" );
-	const CMIUtilString msg( CMIUtilString::Format( "%d location%s added to breakpoint %d", nLoc, plural.c_str(), brkPt.GetID() ) );
-        
-	return TextToStdout( msg );
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBBreakpoint event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointCmn( const lldb::SBEvent & vEvent )
-{
-	lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent( vEvent );
-	if( !brkPt.IsValid() )
-		return MIstatus::success;
-
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
-	CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
-	if( !rSessionInfo.GetBrkPtInfo( brkPt, sBrkPtInfo ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET ), "HandleEventSBBreakpointCmn()", brkPt.GetID() ) );
-		return MIstatus::failure;
-	}
-	
-	// CODETAG_LLDB_BREAKPOINT_CREATION
-	// This is in a worker thread
-	// Add more breakpoint information or overwrite existing information
-	CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfoRec;
-	if( !rSessionInfo.RecordBrkPtInfoGet( brkPt.GetID(), sBrkPtInfoRec ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND ), "HandleEventSBBreakpointCmn()", brkPt.GetID() ) );
-		return MIstatus::failure;
-	}
-	sBrkPtInfo.m_bDisp = sBrkPtInfoRec.m_bDisp;		
-	sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();		
-	sBrkPtInfo.m_bHaveArgOptionThreadGrp = false; 
-	sBrkPtInfo.m_strOptThrdGrp = "";				
-	sBrkPtInfo.m_nTimes = brkPt.GetHitCount();		
-	sBrkPtInfo.m_strOrigLoc = sBrkPtInfoRec.m_strOrigLoc;			
-	sBrkPtInfo.m_nIgnore = sBrkPtInfoRec.m_nIgnore;
-	sBrkPtInfo.m_bPending = sBrkPtInfoRec.m_bPending;
-	sBrkPtInfo.m_bCondition = sBrkPtInfoRec.m_bCondition;
-	sBrkPtInfo.m_strCondition = sBrkPtInfoRec.m_strCondition;
-	sBrkPtInfo.m_bBrkPtThreadId = sBrkPtInfoRec.m_bBrkPtThreadId;
-	sBrkPtInfo.m_nBrkPtThreadId = sBrkPtInfoRec.m_nBrkPtThreadId;
-																						
-	// MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\", func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
-	CMICmnMIValueTuple miValueTuple;
-	if( !rSessionInfo.MIResponseFormBrkPtInfo( sBrkPtInfo, miValueTuple ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE ), "HandleEventSBBreakpointCmn()" ) );
-		return MIstatus::failure;
-	}
-	
-	const CMICmnMIValueResult miValueResultC( "bkpt", miValueTuple );
-	const CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResultC );
-	const bool bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBBreakpoint added event.
-//			Add more breakpoint information or overwrite existing information.
-//			Normally a break point session info objects exists by now when an MI command 
-//			was issued to insert a break so the retrieval would normally always succeed
-//			however should a user type "b main" into a console then LLDB will create a 
-//			breakpoint directly, hence no MI command, hence no previous record of the 
-//			breakpoint so RecordBrkPtInfoGet() will fail. We still get the event though
-//			so need to create a breakpoint info object here and send appropriate MI 
-//			response.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointAdded( const lldb::SBEvent & vEvent )
-{
-	lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent( vEvent );
-	if( !brkPt.IsValid() )
-		return MIstatus::success;
-
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
-	CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
-	if( !rSessionInfo.GetBrkPtInfo( brkPt, sBrkPtInfo ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET ), "HandleEventSBBreakpointAdded()", brkPt.GetID() ) );
-		return MIstatus::failure;
-	}
-	
-	// CODETAG_LLDB_BREAKPOINT_CREATION
-	// This is in a worker thread
-	CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfoRec;
-	const bool bBrkPtExistAlready = rSessionInfo.RecordBrkPtInfoGet( brkPt.GetID(), sBrkPtInfoRec );
-	if( bBrkPtExistAlready )
-	{
-		// Update breakpoint information object
-		sBrkPtInfo.m_bDisp = sBrkPtInfoRec.m_bDisp;		
-		sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();		
-		sBrkPtInfo.m_bHaveArgOptionThreadGrp = false; 
-		sBrkPtInfo.m_strOptThrdGrp.clear();				
-		sBrkPtInfo.m_nTimes = brkPt.GetHitCount();		
-		sBrkPtInfo.m_strOrigLoc = sBrkPtInfoRec.m_strOrigLoc;			
-		sBrkPtInfo.m_nIgnore = sBrkPtInfoRec.m_nIgnore;
-		sBrkPtInfo.m_bPending = sBrkPtInfoRec.m_bPending;
-		sBrkPtInfo.m_bCondition = sBrkPtInfoRec.m_bCondition;
-		sBrkPtInfo.m_strCondition = sBrkPtInfoRec.m_strCondition;
-		sBrkPtInfo.m_bBrkPtThreadId = sBrkPtInfoRec.m_bBrkPtThreadId;
-		sBrkPtInfo.m_nBrkPtThreadId = sBrkPtInfoRec.m_nBrkPtThreadId;
-	}
-	else
-	{
-		// Create a breakpoint information object
-		sBrkPtInfo.m_bDisp = brkPt.IsOneShot();					
-		sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();			
-		sBrkPtInfo.m_bHaveArgOptionThreadGrp = false; 
-		sBrkPtInfo.m_strOptThrdGrp.clear();	
-		sBrkPtInfo.m_strOrigLoc = CMIUtilString::Format( "%s:%d", sBrkPtInfo.m_fileName.c_str(), sBrkPtInfo.m_nLine );					
-		sBrkPtInfo.m_nIgnore = brkPt.GetIgnoreCount();
-		sBrkPtInfo.m_bPending = false;
-		const MIchar * pStrCondition = brkPt.GetCondition();
-		sBrkPtInfo.m_bCondition = (pStrCondition != nullptr) ? true : false;
-		sBrkPtInfo.m_strCondition = (pStrCondition != nullptr) ? pStrCondition : "??";
-		sBrkPtInfo.m_bBrkPtThreadId = (brkPt.GetThreadID() != 0) ? true : false;
-		sBrkPtInfo.m_nBrkPtThreadId = brkPt.GetThreadID();
-	}
-
-	CMICmnMIValueTuple miValueTuple;
-	if( !rSessionInfo.MIResponseFormBrkPtInfo( sBrkPtInfo, miValueTuple ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE ), "HandleEventSBBreakpointAdded()" ) );
-		return MIstatus::failure;
-	}
-
-	bool bOk = MIstatus::success;
-	if( bBrkPtExistAlready )
-	{
-		// MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
-		const CMICmnMIValueResult miValueResult( "bkpt", miValueTuple );
-		const CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResult );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-	}
-	else
-	{
-		// CODETAG_LLDB_BRKPT_ID_MAX
-		if( brkPt.GetID() > (lldb::break_id_t) rSessionInfo.m_nBrkPointCntMax )
-		{
-			SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_CMD_ERR_BRKPT_CNT_EXCEEDED ), "HandleEventSBBreakpointAdded()", rSessionInfo.m_nBrkPointCntMax, sBrkPtInfo.m_id ) );
-			return MIstatus::failure;
-		}
-		if( !rSessionInfo.RecordBrkPtInfo( brkPt.GetID(), sBrkPtInfo ) )
-		{
-			SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET ), "HandleEventSBBreakpointAdded()", sBrkPtInfo.m_id ) );
-			return MIstatus::failure;
-		}
-
-		// MI print "=breakpoint-created,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
-		const CMICmnMIValueResult miValueResult( "bkpt", miValueTuple );
-		const CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, miValueResult );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-	}
-																						
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBThread event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: CMICmnLLDBDebuggerHandleEvents constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThread( const lldb::SBEvent & vEvent )
+CMICmnLLDBDebuggerHandleEvents::CMICmnLLDBDebuggerHandleEvents(void)
 {
-	if( !ChkForStateChanges() )
-		return MIstatus::failure;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: CMICmnLLDBDebuggerHandleEvents destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmnLLDBDebuggerHandleEvents::~CMICmnLLDBDebuggerHandleEvents(void)
+{
+    Shutdown();
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Initialize resources for *this broardcaster object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::Initialize(void)
+{
+    m_clientUsageRefCnt++;
+
+    if (m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = MIstatus::success;
+
+    return m_bInitialized;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Release resources for *this broardcaster object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::Shutdown(void)
+{
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = false;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Interpret the event object to asscertain the action to take or information to
+//          to form and put in a MI Out-of-band record object which is given to stdout.
+// Type:    Method.
+// Args:    vEvent          - (R) An LLDB broadcast event.
+//          vrbHandledEvent - (W) True - event handled, false = not handled.
+//          vrbExitAppEvent - (W) True - Received LLDB exit app event, false = did not.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent, bool &vrbExitAppEvent)
+{
+    bool bOk = MIstatus::success;
+    vrbHandledEvent = false;
+    vrbExitAppEvent = false;
+
+    if (lldb::SBProcess::EventIsProcessEvent(vEvent))
+    {
+        vrbHandledEvent = true;
+        bOk = HandleEventSBProcess(vEvent, vrbExitAppEvent);
+    }
+    else if (lldb::SBBreakpoint::EventIsBreakpointEvent(vEvent))
+    {
+        vrbHandledEvent = true;
+        bOk = HandleEventSBBreakPoint(vEvent);
+    }
+    else if (lldb::SBThread::EventIsThreadEvent(vEvent))
+    {
+        vrbHandledEvent = true;
+        bOk = HandleEventSBThread(vEvent);
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBProcess event.
+// Type:    Method.
+// Args:    vEvent          - (R) An LLDB broadcast event.
+//          vrbExitAppEvent - (W) True - Received LLDB exit app event, false = did not.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBProcess(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent)
+{
+    bool bOk = MIstatus::success;
+
+    const MIchar *pEventType = "";
+    const MIuint nEventType = vEvent.GetType();
+    switch (nEventType)
+    {
+        case lldb::SBProcess::eBroadcastBitInterrupt:
+            pEventType = "eBroadcastBitInterrupt";
+            break;
+        case lldb::SBProcess::eBroadcastBitProfileData:
+            pEventType = "eBroadcastBitProfileData";
+            break;
+        case lldb::SBProcess::eBroadcastBitStateChanged:
+            pEventType = "eBroadcastBitStateChanged";
+            bOk = HandleProcessEventBroadcastBitStateChanged(vEvent, vrbExitAppEvent);
+            break;
+        case lldb::SBProcess::eBroadcastBitSTDERR:
+            pEventType = "eBroadcastBitSTDERR";
+            bOk = GetProcessStderr();
+            break;
+        case lldb::SBProcess::eBroadcastBitSTDOUT:
+            pEventType = "eBroadcastBitSTDOUT";
+            bOk = GetProcessStdout();
+            break;
+        default:
+        {
+            const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT), "SBProcess", (MIuint)nEventType));
+            SetErrorDescription(msg);
+            return MIstatus::failure;
+        }
+    }
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SB Process event occurred: %s", pEventType));
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBBreakpoint event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakPoint(const lldb::SBEvent &vEvent)
+{
+    bool bOk = MIstatus::success;
+
+    const MIchar *pEventType = "";
+    const lldb::BreakpointEventType eEvent = lldb::SBBreakpoint::GetBreakpointEventTypeFromEvent(vEvent);
+    switch (eEvent)
+    {
+        case lldb::eBreakpointEventTypeThreadChanged:
+            pEventType = "eBreakpointEventTypeThreadChanged";
+            break;
+        case lldb::eBreakpointEventTypeLocationsRemoved:
+            pEventType = "eBreakpointEventTypeLocationsRemoved";
+            break;
+        case lldb::eBreakpointEventTypeInvalidType:
+            pEventType = "eBreakpointEventTypeInvalidType";
+            break;
+        case lldb::eBreakpointEventTypeLocationsAdded:
+            pEventType = "eBreakpointEventTypeLocationsAdded";
+            bOk = HandleEventSBBreakpointLocationsAdded(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeAdded:
+            pEventType = "eBreakpointEventTypeAdded";
+            bOk = HandleEventSBBreakpointAdded(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeRemoved:
+            pEventType = "eBreakpointEventTypeRemoved";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeLocationsResolved:
+            pEventType = "eBreakpointEventTypeLocationsResolved";
+            break;
+        case lldb::eBreakpointEventTypeEnabled:
+            pEventType = "eBreakpointEventTypeEnabled";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeDisabled:
+            pEventType = "eBreakpointEventTypeDisabled";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeCommandChanged:
+            pEventType = "eBreakpointEventTypeCommandChanged";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeConditionChanged:
+            pEventType = "eBreakpointEventTypeConditionChanged";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+        case lldb::eBreakpointEventTypeIgnoreChanged:
+            pEventType = "eBreakpointEventTypeIgnoreChanged";
+            bOk = HandleEventSBBreakpointCmn(vEvent);
+            break;
+    }
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SB Breakpoint event occurred: %s", pEventType));
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBBreakpoint event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointLocationsAdded(const lldb::SBEvent &vEvent)
+{
+    const MIuint nLoc = lldb::SBBreakpoint::GetNumBreakpointLocationsFromEvent(vEvent);
+    if (nLoc == 0)
+        return MIstatus::success;
+
+    lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent(vEvent);
+    const CMIUtilString plural((nLoc == 1) ? "" : "s");
+    const CMIUtilString msg(CMIUtilString::Format("%d location%s added to breakpoint %d", nLoc, plural.c_str(), brkPt.GetID()));
+
+    return TextToStdout(msg);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBBreakpoint event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointCmn(const lldb::SBEvent &vEvent)
+{
+    lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent(vEvent);
+    if (!brkPt.IsValid())
+        return MIstatus::success;
+
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
+    if (!rSessionInfo.GetBrkPtInfo(brkPt, sBrkPtInfo))
+    {
+        SetErrorDescription(
+            CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET), "HandleEventSBBreakpointCmn()", brkPt.GetID()));
+        return MIstatus::failure;
+    }
+
+    // CODETAG_LLDB_BREAKPOINT_CREATION
+    // This is in a worker thread
+    // Add more breakpoint information or overwrite existing information
+    CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfoRec;
+    if (!rSessionInfo.RecordBrkPtInfoGet(brkPt.GetID(), sBrkPtInfoRec))
+    {
+        SetErrorDescription(
+            CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND), "HandleEventSBBreakpointCmn()", brkPt.GetID()));
+        return MIstatus::failure;
+    }
+    sBrkPtInfo.m_bDisp = sBrkPtInfoRec.m_bDisp;
+    sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();
+    sBrkPtInfo.m_bHaveArgOptionThreadGrp = false;
+    sBrkPtInfo.m_strOptThrdGrp = "";
+    sBrkPtInfo.m_nTimes = brkPt.GetHitCount();
+    sBrkPtInfo.m_strOrigLoc = sBrkPtInfoRec.m_strOrigLoc;
+    sBrkPtInfo.m_nIgnore = sBrkPtInfoRec.m_nIgnore;
+    sBrkPtInfo.m_bPending = sBrkPtInfoRec.m_bPending;
+    sBrkPtInfo.m_bCondition = sBrkPtInfoRec.m_bCondition;
+    sBrkPtInfo.m_strCondition = sBrkPtInfoRec.m_strCondition;
+    sBrkPtInfo.m_bBrkPtThreadId = sBrkPtInfoRec.m_bBrkPtThreadId;
+    sBrkPtInfo.m_nBrkPtThreadId = sBrkPtInfoRec.m_nBrkPtThreadId;
+
+    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",
+    // func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+    CMICmnMIValueTuple miValueTuple;
+    if (!rSessionInfo.MIResponseFormBrkPtInfo(sBrkPtInfo, miValueTuple))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE), "HandleEventSBBreakpointCmn()"));
+        return MIstatus::failure;
+    }
+
+    const CMICmnMIValueResult miValueResultC("bkpt", miValueTuple);
+    const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResultC);
+    const bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBBreakpoint added event.
+//          Add more breakpoint information or overwrite existing information.
+//          Normally a break point session info objects exists by now when an MI command
+//          was issued to insert a break so the retrieval would normally always succeed
+//          however should a user type "b main" into a console then LLDB will create a
+//          breakpoint directly, hence no MI command, hence no previous record of the
+//          breakpoint so RecordBrkPtInfoGet() will fail. We still get the event though
+//          so need to create a breakpoint info object here and send appropriate MI
+//          response.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointAdded(const lldb::SBEvent &vEvent)
+{
+    lldb::SBBreakpoint brkPt = lldb::SBBreakpoint::GetBreakpointFromEvent(vEvent);
+    if (!brkPt.IsValid())
+        return MIstatus::success;
+
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfo;
+    if (!rSessionInfo.GetBrkPtInfo(brkPt, sBrkPtInfo))
+    {
+        SetErrorDescription(
+            CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET), "HandleEventSBBreakpointAdded()", brkPt.GetID()));
+        return MIstatus::failure;
+    }
+
+    // CODETAG_LLDB_BREAKPOINT_CREATION
+    // This is in a worker thread
+    CMICmnLLDBDebugSessionInfo::SBrkPtInfo sBrkPtInfoRec;
+    const bool bBrkPtExistAlready = rSessionInfo.RecordBrkPtInfoGet(brkPt.GetID(), sBrkPtInfoRec);
+    if (bBrkPtExistAlready)
+    {
+        // Update breakpoint information object
+        sBrkPtInfo.m_bDisp = sBrkPtInfoRec.m_bDisp;
+        sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();
+        sBrkPtInfo.m_bHaveArgOptionThreadGrp = false;
+        sBrkPtInfo.m_strOptThrdGrp.clear();
+        sBrkPtInfo.m_nTimes = brkPt.GetHitCount();
+        sBrkPtInfo.m_strOrigLoc = sBrkPtInfoRec.m_strOrigLoc;
+        sBrkPtInfo.m_nIgnore = sBrkPtInfoRec.m_nIgnore;
+        sBrkPtInfo.m_bPending = sBrkPtInfoRec.m_bPending;
+        sBrkPtInfo.m_bCondition = sBrkPtInfoRec.m_bCondition;
+        sBrkPtInfo.m_strCondition = sBrkPtInfoRec.m_strCondition;
+        sBrkPtInfo.m_bBrkPtThreadId = sBrkPtInfoRec.m_bBrkPtThreadId;
+        sBrkPtInfo.m_nBrkPtThreadId = sBrkPtInfoRec.m_nBrkPtThreadId;
+    }
+    else
+    {
+        // Create a breakpoint information object
+        sBrkPtInfo.m_bDisp = brkPt.IsOneShot();
+        sBrkPtInfo.m_bEnabled = brkPt.IsEnabled();
+        sBrkPtInfo.m_bHaveArgOptionThreadGrp = false;
+        sBrkPtInfo.m_strOptThrdGrp.clear();
+        sBrkPtInfo.m_strOrigLoc = CMIUtilString::Format("%s:%d", sBrkPtInfo.m_fileName.c_str(), sBrkPtInfo.m_nLine);
+        sBrkPtInfo.m_nIgnore = brkPt.GetIgnoreCount();
+        sBrkPtInfo.m_bPending = false;
+        const MIchar *pStrCondition = brkPt.GetCondition();
+        sBrkPtInfo.m_bCondition = (pStrCondition != nullptr) ? true : false;
+        sBrkPtInfo.m_strCondition = (pStrCondition != nullptr) ? pStrCondition : "??";
+        sBrkPtInfo.m_bBrkPtThreadId = (brkPt.GetThreadID() != 0) ? true : false;
+        sBrkPtInfo.m_nBrkPtThreadId = brkPt.GetThreadID();
+    }
+
+    CMICmnMIValueTuple miValueTuple;
+    if (!rSessionInfo.MIResponseFormBrkPtInfo(sBrkPtInfo, miValueTuple))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE), "HandleEventSBBreakpointAdded()"));
+        return MIstatus::failure;
+    }
+
+    bool bOk = MIstatus::success;
+    if (bBrkPtExistAlready)
+    {
+        // MI print
+        // "=breakpoint-modified,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+        const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
+        const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResult);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    }
+    else
+    {
+        // CODETAG_LLDB_BRKPT_ID_MAX
+        if (brkPt.GetID() > (lldb::break_id_t)rSessionInfo.m_nBrkPointCntMax)
+        {
+            SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_BRKPT_CNT_EXCEEDED), "HandleEventSBBreakpointAdded()",
+                                                      rSessionInfo.m_nBrkPointCntMax, sBrkPtInfo.m_id));
+            return MIstatus::failure;
+        }
+        if (!rSessionInfo.RecordBrkPtInfo(brkPt.GetID(), sBrkPtInfo))
+        {
+            SetErrorDescription(
+                CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET), "HandleEventSBBreakpointAdded()", sBrkPtInfo.m_id));
+            return MIstatus::failure;
+        }
+
+        // MI print
+        // "=breakpoint-created,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\",times=\"%d\",original-location=\"%s\"}"
+        const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
+        const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, miValueResult);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBThread event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBThread(const lldb::SBEvent &vEvent)
+{
+    if (!ChkForStateChanges())
+        return MIstatus::failure;
 
-	bool bOk = MIstatus::success;
-	const MIchar * pEventType = "";
+    bool bOk = MIstatus::success;
+    const MIchar *pEventType = "";
     const MIuint nEventType = vEvent.GetType();
-	switch( nEventType )
-	{
-	case lldb::SBThread::eBroadcastBitStackChanged:
-		pEventType = "eBroadcastBitStackChanged";
-		bOk = HandleEventSBThreadBitStackChanged( vEvent );
-		break;
-	case lldb::SBThread::eBroadcastBitThreadSuspended:
-		pEventType = "eBroadcastBitThreadSuspended";
-		bOk = HandleEventSBThreadSuspended( vEvent );
-		break;
-	case lldb::SBThread::eBroadcastBitThreadResumed:
-		pEventType = "eBroadcastBitThreadResumed";
-		break;
-	case lldb::SBThread::eBroadcastBitSelectedFrameChanged:
-		pEventType = "eBroadcastBitSelectedFrameChanged";
-		break;
-	case lldb::SBThread::eBroadcastBitThreadSelected:
-		pEventType = "eBroadcastBitThreadSelected";
-		break;
-	default:
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT ), "SBThread", (MIuint) nEventType ) );
-		SetErrorDescription( msg );
-		return MIstatus::failure;
-	}
-	}
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SBThread event occurred: %s", pEventType ) );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBThread event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadSuspended( const lldb::SBEvent & vEvent )
-{
-	lldb::SBThread thread = lldb::SBThread::GetThreadFromEvent( vEvent );
-	if( !thread.IsValid() )
-		return MIstatus::success;
-
-	const lldb::StopReason eStopReason = thread.GetStopReason();
-	if( eStopReason != lldb::eStopReasonSignal )
-		return MIstatus::success;
-
-	// MI print "@thread=%d,signal=%lld"
-	const MIuint64 nId = thread.GetStopReasonDataAtIndex( 0 );
-	const CMIUtilString strThread( CMIUtilString::Format( "%d", thread.GetThreadID() ) );
-	const CMICmnMIValueConst  miValueConst( strThread );
-	const CMICmnMIValueResult miValueResult( "thread", miValueConst );
-	CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Thread, miValueResult );
-	const CMIUtilString strSignal( CMIUtilString::Format( "%lld", nId ) );
-	const CMICmnMIValueConst  miValueConst2( strSignal );
-	const CMICmnMIValueResult miValueResult2( "signal", miValueConst2 );
-	bool bOk = miOutOfBandRecord.Add( miValueResult2 );
-	bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );	
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBThread event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB broadcast event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadBitStackChanged( const lldb::SBEvent & vEvent )
-{
-	lldb::SBThread thread = lldb::SBThread::GetThreadFromEvent( vEvent );
-	if( !thread.IsValid() )
-		return MIstatus::success;
-
-	lldb::SBStream streamOut;
-	const bool bOk = thread.GetStatus( streamOut );
-	return bOk && TextToStdout( streamOut.GetData() );
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle a LLDB SBCommandInterpreter event.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB command interpreter event.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+    switch (nEventType)
+    {
+        case lldb::SBThread::eBroadcastBitStackChanged:
+            pEventType = "eBroadcastBitStackChanged";
+            bOk = HandleEventSBThreadBitStackChanged(vEvent);
+            break;
+        case lldb::SBThread::eBroadcastBitThreadSuspended:
+            pEventType = "eBroadcastBitThreadSuspended";
+            bOk = HandleEventSBThreadSuspended(vEvent);
+            break;
+        case lldb::SBThread::eBroadcastBitThreadResumed:
+            pEventType = "eBroadcastBitThreadResumed";
+            break;
+        case lldb::SBThread::eBroadcastBitSelectedFrameChanged:
+            pEventType = "eBroadcastBitSelectedFrameChanged";
+            break;
+        case lldb::SBThread::eBroadcastBitThreadSelected:
+            pEventType = "eBroadcastBitThreadSelected";
+            break;
+        default:
+        {
+            const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT), "SBThread", (MIuint)nEventType));
+            SetErrorDescription(msg);
+            return MIstatus::failure;
+        }
+    }
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SBThread event occurred: %s", pEventType));
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBThread event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadSuspended(const lldb::SBEvent &vEvent)
+{
+    lldb::SBThread thread = lldb::SBThread::GetThreadFromEvent(vEvent);
+    if (!thread.IsValid())
+        return MIstatus::success;
+
+    const lldb::StopReason eStopReason = thread.GetStopReason();
+    if (eStopReason != lldb::eStopReasonSignal)
+        return MIstatus::success;
+
+    // MI print "@thread=%d,signal=%lld"
+    const MIuint64 nId = thread.GetStopReasonDataAtIndex(0);
+    const CMIUtilString strThread(CMIUtilString::Format("%d", thread.GetThreadID()));
+    const CMICmnMIValueConst miValueConst(strThread);
+    const CMICmnMIValueResult miValueResult("thread", miValueConst);
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Thread, miValueResult);
+    const CMIUtilString strSignal(CMIUtilString::Format("%lld", nId));
+    const CMICmnMIValueConst miValueConst2(strSignal);
+    const CMICmnMIValueResult miValueResult2("signal", miValueConst2);
+    bool bOk = miOutOfBandRecord.Add(miValueResult2);
+    bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBThread event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB broadcast event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadBitStackChanged(const lldb::SBEvent &vEvent)
+{
+    lldb::SBThread thread = lldb::SBThread::GetThreadFromEvent(vEvent);
+    if (!thread.IsValid())
+        return MIstatus::success;
+
+    lldb::SBStream streamOut;
+    const bool bOk = thread.GetStatus(streamOut);
+    return bOk && TextToStdout(streamOut.GetData());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle a LLDB SBCommandInterpreter event.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB command interpreter event.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBCommandInterpreter( const lldb::SBEvent & vEvent )
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleEventSBCommandInterpreter(const lldb::SBEvent &vEvent)
 {
-	// This function is not used
-	// *** This function is under development
+    // This function is not used
+    // *** This function is under development
 
-    const MIchar * pEventType = "";
+    const MIchar *pEventType = "";
     const MIuint nEventType = vEvent.GetType();
-	switch( nEventType )
-	{
-	case lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit:
-		pEventType ="eBroadcastBitThreadShouldExit";
-	// ToDo: IOR: Reminder to maybe handle this here
-	//const MIuint nEventType = event.GetType();
-	//if( nEventType & lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit )
-	//{
-	//	m_pClientDriver->SetExitApplicationFlag();    
-	//	vrbYesExit = true;
-	//	return MIstatus::success;
-	//}		break;
-	case lldb::SBCommandInterpreter::eBroadcastBitResetPrompt:
-		pEventType = "eBroadcastBitResetPrompt";
-		break;
-	case lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived:
-		pEventType = "eBroadcastBitQuitCommandReceived";
-		break;
-	case lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData:
-		pEventType = "eBroadcastBitAsynchronousOutputData";
-		break;
-	case lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData:
-		pEventType = "eBroadcastBitAsynchronousErrorData";
-		break;
-	default:
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT ), "SBCommandInterpreter", (MIuint) nEventType ) );
-		SetErrorDescription( msg );
-		return MIstatus::failure;
-	}
-	}
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SBCommandInterpreter event occurred: %s", pEventType ) );
-
-	return MIstatus::success;
-}
- 
-//++ ------------------------------------------------------------------------------------
-// Details:	Handle SBProcess event eBroadcastBitStateChanged.
-// Type:	Method.
-// Args:	vEvent			- (R) An LLDB event object.
-//			vrbExitAppEvent	- (W) True - Received LLDB exit app event, false = did not.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventBroadcastBitStateChanged( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent )
-{
-	bool bOk = ChkForStateChanges();
-	bOk = bOk && GetProcessStdout();
-	bOk = bOk && GetProcessStderr();
-	if( !bOk )
-		return MIstatus::failure;
-
-	// Something changed in the process; get the event and report the process's current 
-	// status and location
-    const lldb::StateType eEventState = lldb::SBProcess::GetStateFromEvent( vEvent );
-	if( eEventState == lldb::eStateInvalid )
-		return MIstatus::success;
-
-	lldb::SBProcess process = lldb::SBProcess::GetProcessFromEvent( vEvent );
-	if( !process.IsValid() )
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID ), "SBProcess", "HandleProcessEventBroadcastBitStateChanged()" ) );
-		SetErrorDescription( msg );
-		return MIstatus::failure;
-	}
-
-	bool bShouldBrk = true;
-	const MIchar * pEventType = "";
-    switch( eEventState )
-	{
-	case lldb::eStateUnloaded:
-		pEventType = "eStateUnloaded";
-		break;
-    case lldb::eStateConnected:
-		pEventType = "eStateConnected";
-		break;
-    case lldb::eStateAttaching:
-		pEventType = "eStateAttaching";
-		break;
-    case lldb::eStateLaunching:
-		pEventType ="eStateLaunching";
-		break;
-    case lldb::eStateStopped:
-		pEventType = "eStateStopped";
-		bOk = HandleProcessEventStateStopped( bShouldBrk );
-		if( bShouldBrk )
-			break;
-    case lldb::eStateCrashed:
-	case lldb::eStateSuspended:
-		pEventType = "eStateSuspended";
-		bOk = HandleProcessEventStateSuspended( vEvent );
-		break;
-	case lldb::eStateRunning:
-		pEventType = "eStateRunning";
-		bOk = HandleProcessEventStateRunning();
-		break;
-    case lldb::eStateStepping:
-		pEventType = "eStateStepping";
-		break;
-   case lldb::eStateDetached:
-		pEventType = "eStateDetached";
-		break;
-    case lldb::eStateExited:
-		pEventType = "eStateExited";
-		vrbExitAppEvent = true;
-		bOk = HandleProcessEventStateExited();
-		break;
-    default:
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT ), "SBProcess BroadcastBitStateChanged", (MIuint) eEventState ) );
-		SetErrorDescription( msg );
-		return MIstatus::failure;
-	}
-	}
-
-	// ToDo: Remove when finished coding application
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SB Process event BroadcastBitStateChanged occurred: %s", pEventType ) );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous event handler for LLDB Process state suspended.
-// Type:	Method.
-// Args:	vEvent	- (R) An LLDB event object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended( const lldb::SBEvent & vEvent )
-{
-	// Make sure the program hasn't been auto-restarted:
-    if( lldb::SBProcess::GetRestartedFromEvent( vEvent ) )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	lldb::SBDebugger & rDebugger = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger;
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	lldb::SBTarget target = rProcess.GetTarget();
-	if( rDebugger.GetSelectedTarget() == target )
-	{
-		if( !UpdateSelectedThread() )
-			return MIstatus::failure;
-
-		lldb::SBCommandReturnObject result;
-		const lldb::ReturnStatus status = rDebugger.GetCommandInterpreter().HandleCommand( "process status", result, false ); MIunused( status );
-		bOk = TextToStderr( result.GetError() );
-		bOk = bOk && TextToStdout( result.GetOutput() );
-	}
-	else
-	{
-		lldb::SBStream streamOut;
-		const MIuint nTargetIndex = rDebugger.GetIndexOfTarget( target );
-		if( nTargetIndex != UINT_MAX )
-			streamOut.Printf( "Target %d: (", nTargetIndex );
-		else
-			streamOut.Printf( "Target <unknown index>: (" );
-		target.GetDescription( streamOut, lldb::eDescriptionLevelBrief );
-		streamOut.Printf( ") stopped.\n" );
-		bOk = TextToStdout( streamOut.GetData() );
-	}
-	
-	return bOk;
-}
-		
-//++ ------------------------------------------------------------------------------------
-// Details:	Print to stdout MI formatted text to indicate process stopped.
-// Type:	Method.
-// Args:	vwrbShouldBrk	- (W) True = Yes break, false = do not.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped( bool & vwrbShouldBrk )
-{
-	if( !UpdateSelectedThread() )
-		return MIstatus::failure;
-
-	const MIchar * pEventType = "";
-	bool bOk = MIstatus::success;
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	const lldb::StopReason eStoppedReason = rProcess.GetSelectedThread().GetStopReason();
-	switch( eStoppedReason )
-	{
-	case lldb::eStopReasonInvalid:
-		pEventType = "eStopReasonInvalid";
-		vwrbShouldBrk = false;
-		break;
-    case lldb::eStopReasonNone:
-		pEventType = "eStopReasonNone";
-		break;
-    case lldb::eStopReasonTrace:
-		pEventType = "eStopReasonTrace";
-		bOk = HandleProcessEventStopReasonTrace();
-		break;
-    case lldb::eStopReasonBreakpoint:
-		pEventType = "eStopReasonBreakpoint";
-		bOk = HandleProcessEventStopReasonBreakpoint();
-		break;
-    case lldb::eStopReasonWatchpoint:
-		pEventType = "eStopReasonWatchpoint";
-		break;
-    case lldb::eStopReasonSignal:
-		pEventType = "eStopReasonSignal";
-		bOk = HandleProcessEventStopSignal( vwrbShouldBrk );
-		break;
-    case lldb::eStopReasonException:
-		pEventType ="eStopReasonException";
-		break;
-    case lldb::eStopReasonExec:
-		pEventType = "eStopReasonExec";
-		break;
-    case lldb::eStopReasonPlanComplete:
-		pEventType = "eStopReasonPlanComplete";
-		bOk = HandleProcessEventStopReasonTrace();
-		break;
-    case lldb::eStopReasonThreadExiting:
-		pEventType = "eStopReasonThreadExiting";
-		break;
-	}
-	
-	// ToDo: Remove when finished coding application
-	m_pLog->WriteLog( CMIUtilString::Format( "##### An SB Process event stop state occurred: %s", pEventType ) );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous event handler for LLDB Process stop signal.
-// Type:	Method.
-// Args:	vwrbShouldBrk	- (W) True = Yes break, false = do not.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal( bool & vwrbShouldBrk )
-{
-	bool bOk = MIstatus::success;
-
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	const MIuint64 nStopReason = rProcess.GetSelectedThread().GetStopReasonDataAtIndex( 0 );
-	switch( nStopReason )
-	{
-	case 2:	// Terminal interrupt signal. SIGINT
-		{
-			// MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGNINT\",signal-meaning=\"Interrupt\",frame={%s}"
-			const CMICmnMIValueConst miValueConst( "signal-received" );
-			const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-			CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-			const CMICmnMIValueConst miValueConst2( "SIGINT" );
-			const CMICmnMIValueResult miValueResult2( "signal-name", miValueConst2 );
-			bOk = miOutOfBandRecord.Add( miValueResult2 );
-			const CMICmnMIValueConst miValueConst3( "Interrupt" );
-			const CMICmnMIValueResult miValueResult3( "signal-meaning", miValueConst3 );
-			bOk = bOk && miOutOfBandRecord.Add( miValueResult3 );
-			CMICmnMIValueTuple miValueTuple;
-			bOk = bOk && MiHelpGetCurrentThreadFrame( miValueTuple );
-			const CMICmnMIValueResult miValueResult5( "frame", miValueTuple );
-			bOk = bOk && miOutOfBandRecord.Add( miValueResult5 );
-			bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );
-			bOk = bOk && TextToStdout( "(gdb)" );
-		}
-		break;
-	case 11: // Invalid memory reference. SIGSEGV
-		{
-			// MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGSEGV\",signal-meaning=\"Segmentation fault\",thread-id=\"%d\",frame={%s}"
-			const CMICmnMIValueConst miValueConst( "signal-received" );
-			const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-			CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-			const CMICmnMIValueConst miValueConst2( "SIGSEGV" );
-			const CMICmnMIValueResult miValueResult2( "signal-name", miValueConst2 );
-			bOk = miOutOfBandRecord.Add( miValueResult2 );
-			const CMICmnMIValueConst miValueConst3( "Segmentation fault" );
-			const CMICmnMIValueResult miValueResult3( "signal-meaning", miValueConst3 );
-			bOk = bOk && miOutOfBandRecord.Add( miValueResult3 );
-			const CMIUtilString strThreadId( CMIUtilString::Format( "%d", rProcess.GetSelectedThread().GetIndexID() ) );
-			const CMICmnMIValueConst miValueConst4( strThreadId );
-			const CMICmnMIValueResult miValueResult4( "thread-id", miValueConst4 );
-			bOk = bOk && miOutOfBandRecord.Add( miValueResult4 );
-			CMICmnMIValueTuple miValueTuple;
-			bOk = bOk && MiHelpGetCurrentThreadFrame( miValueTuple );
-			const CMICmnMIValueResult miValueResult5( "frame", miValueTuple );
-			bOk = bOk && miOutOfBandRecord.Add( miValueResult5 );
-			bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );
-			// Note no "(gdb)" output here
-		}
-		break;
-	case 19:
-		if( rProcess.IsValid() )
-			rProcess.Continue();
-		break;
-	case 5:	//  Trace/breakpoint trap. SIGTRAP
-	{
-		lldb::SBThread thread = rProcess.GetSelectedThread();
-		const MIuint nFrames = thread.GetNumFrames();
-		if( nFrames > 0 )
-		{
-			lldb::SBFrame frame = thread.GetFrameAtIndex( 0 );
-			const char * pFnName = frame.GetFunctionName();
-			if( pFnName != nullptr )
-			{
-				const CMIUtilString fnName = CMIUtilString( pFnName );
-				static const CMIUtilString threadCloneFn = CMIUtilString( "__pthread_clone" );
-
-				if( CMIUtilString::Compare( threadCloneFn, fnName ) )
-				{
-					if( rProcess.IsValid() )
-					{
-						rProcess.Continue();
-						vwrbShouldBrk = true;
-						break;
-					}
-				}
-			}
-		}
-	}
-	default:
-	{
-		// MI print "*stopped,reason=\"signal-received\",signal=\"%lld\",stopped-threads=\"all\""
-		const CMICmnMIValueConst miValueConst( "signal-received" );
-		const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-		CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-		const CMIUtilString strReason( CMIUtilString::Format( "%lld", nStopReason ) );
-		const CMICmnMIValueConst miValueConst2( strReason );
-		const CMICmnMIValueResult miValueResult2( "signal", miValueConst2 );
-		bOk = miOutOfBandRecord.Add( miValueResult2 );
-		const CMICmnMIValueConst miValueConst3( "all" );
-		const CMICmnMIValueResult miValueResult3( "stopped-threads", miValueConst3 );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult3 );
-		bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		bOk = bOk && TextToStdout( "(gdb)" );
-	}
-	} // switch( nStopReason )
-	 
-	return bOk;
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Form partial MI response in a MI value tuple object.
-// Type:	Method.
-// Args:	vwrMiValueTuple	- (W) MI value tuple object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::MiHelpGetCurrentThreadFrame( CMICmnMIValueTuple & vwrMiValueTuple )
-{
-	CMIUtilString strThreadFrame;
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	lldb::SBThread thread = rProcess.GetSelectedThread();
-	const MIuint nFrame = thread.GetNumFrames();
-	if( nFrame == 0 )
-	{
-		// MI print "addr=\"??\",func=\"??\",file=\"??\",fullname=\"??\",line=\"??\""
-		const CMICmnMIValueConst miValueConst( "??" );
-		const CMICmnMIValueResult miValueResult( "addr", miValueConst );
-		CMICmnMIValueTuple miValueTuple( miValueResult );
-		const CMICmnMIValueResult miValueResult2( "func", miValueConst );
-		miValueTuple.Add( miValueResult2 );
-		const CMICmnMIValueResult miValueResult4( "file", miValueConst );
-		miValueTuple.Add( miValueResult4 );
-		const CMICmnMIValueResult miValueResult5( "fullname", miValueConst );
-		miValueTuple.Add( miValueResult5 );
-		const CMICmnMIValueResult miValueResult6( "line", miValueConst );
-		miValueTuple.Add( miValueResult6 );
-
-		vwrMiValueTuple = miValueTuple;
-
-		return MIstatus::success;
-	}
-
-	CMICmnMIValueTuple miValueTuple;
-	if( !CMICmnLLDBDebugSessionInfo::Instance().MIResponseFormFrameInfo( thread, 0, miValueTuple ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE ), "MiHelpGetCurrentThreadFrame()" ) );
-		return MIstatus::failure;
-	}
-		
-	vwrMiValueTuple = miValueTuple;
-
-	return MIstatus::success;
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous event handler for LLDB Process stop reason breakpoint.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonBreakpoint( void )
-{
-	// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
-	if( !CMIDriver::Instance().SetDriverStateRunningNotDebugging() )
-	{
-		const CMIUtilString & rErrMsg( CMIDriver::Instance().GetErrorDescription() );
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE ), "HandleProcessEventStopReasonBreakpoint()", rErrMsg.c_str() ) );
-		return MIstatus::failure;
-	}
-
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	const MIuint64 brkPtId = rProcess.GetSelectedThread().GetStopReasonDataAtIndex( 0 );
-	lldb::SBBreakpoint brkPt = CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget.GetBreakpointAtIndex( (MIuint) brkPtId );
-	
-	return MiStoppedAtBreakPoint( brkPtId, brkPt );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Form the MI Out-of-band response for stopped reason on hitting a break point.
-// Type:	Method.
-// Args:	vBrkPtId	- (R) The LLDB break point's ID
-//			vBrkPt		- (R) THe LLDB break point object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( const MIuint64 vBrkPtId, const lldb::SBBreakpoint & vBrkPt )
-{
-	bool bOk = MIstatus::success;
-
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	lldb::SBThread thread = rProcess.GetSelectedThread();
-	const MIuint nFrame = thread.GetNumFrames();
-	if( nFrame == 0 )
-	{
-		// MI print "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%d\",frame={},thread-id=\"%d\",stopped-threads=\"all\""
-		const CMICmnMIValueConst miValueConst( "breakpoint-hit" );
-		const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-		CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-		const CMICmnMIValueConst miValueConst2( "del" );
-		const CMICmnMIValueResult miValueResult2( "disp", miValueConst2 );
-		bOk = miOutOfBandRecord.Add( miValueResult2 );
-		const CMIUtilString strBkp( CMIUtilString::Format( "%d", vBrkPtId ) );
-		const CMICmnMIValueConst miValueConst3( strBkp );
-		CMICmnMIValueResult miValueResult3( "bkptno", miValueConst3 );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult3 );
-		const CMICmnMIValueConst miValueConst4( "{}" );
-		const CMICmnMIValueResult miValueResult4( "frame", miValueConst4 );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult4 );
-		const CMIUtilString strThreadId( CMIUtilString::Format( "%d", vBrkPt.GetThreadIndex() ) );
-		const CMICmnMIValueConst miValueConst5( strThreadId );
-		const CMICmnMIValueResult miValueResult5( "thread-id", miValueConst5 );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult5 );
-		const CMICmnMIValueConst miValueConst6( "all" );
-		const CMICmnMIValueResult miValueResult6( "stopped-threads", miValueConst6 );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult6 );
-		bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		bOk = bOk && TextToStdout( "(gdb)" );
-		return bOk;
-	}
-
-	CMICmnLLDBDebugSessionInfo & rSession =  CMICmnLLDBDebugSessionInfo::Instance();
-
-	lldb::SBFrame frame = thread.GetFrameAtIndex( 0 );
-	lldb::addr_t pc = 0;
-	CMIUtilString fnName;
-	CMIUtilString fileName;
-	CMIUtilString path; 
-	MIuint nLine = 0;
-	if( !rSession.GetFrameInfo( frame, pc, fnName, fileName, path, nLine ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET ), "MiStoppedAtBreakPoint()" ) );
-		return MIstatus::failure;
-	}
-	
-	// MI print "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%d\",frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
-	const CMICmnMIValueConst miValueConst( "breakpoint-hit" );
-	const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-	CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-	const CMICmnMIValueConst miValueConstA( "del" );
-	const CMICmnMIValueResult miValueResultA( "disp", miValueConstA );
-	bOk = miOutOfBandRecord.Add( miValueResultA );
-	const CMIUtilString strBkp( CMIUtilString::Format( "%d", vBrkPtId ) );
-	const CMICmnMIValueConst miValueConstB( strBkp );
-	CMICmnMIValueResult miValueResultB( "bkptno", miValueConstB );
-	bOk = bOk && miOutOfBandRecord.Add( miValueResultB );
-
-	// frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\",fullname=\"%s\",line=\"%d\"}
-	if( bOk )
-	{
-		CMICmnMIValueList miValueList( true );
-		const MIuint maskVarTypes = 0x1000;
-		bOk = rSession.MIResponseFormVariableInfo2( frame, maskVarTypes, miValueList );
-		
-		CMICmnMIValueTuple miValueTuple; 
-		bOk = bOk && rSession.MIResponseFormFrameInfo2( pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple );
-		const CMICmnMIValueResult miValueResult8( "frame", miValueTuple );
-		bOk = bOk && miOutOfBandRecord.Add( miValueResult8 );
-	}
-
-	// Add to MI thread-id=\"%d\",stopped-threads=\"all\"
-	if( bOk )
-	{
-		const CMIUtilString strThreadId( CMIUtilString::Format( "%d", thread.GetIndexID() ) );
-		const CMICmnMIValueConst miValueConst8( strThreadId );
-		const CMICmnMIValueResult miValueResult8( "thread-id", miValueConst8 );
-		bOk = miOutOfBandRecord.Add( miValueResult8 );
-	}	
-	if( bOk )
-	{
-		const CMICmnMIValueConst miValueConst9( "all" );
-		const CMICmnMIValueResult miValueResult9( "stopped-threads", miValueConst9 );
-		bOk = miOutOfBandRecord.Add( miValueResult9 );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		bOk = bOk && TextToStdout( "(gdb)" );
-	}	
-
-	return MIstatus::success;
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous event handler for LLDB Process stop reason trace.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonTrace( void )
-{
-	bool bOk = true;
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	lldb::SBThread thread = rProcess.GetSelectedThread();
-	const MIuint nFrame = thread.GetNumFrames();
-	if( nFrame == 0 )
-	{
-		// MI print "*stopped,reason=\"trace\",stopped-threads=\"all\""
-		const CMICmnMIValueConst miValueConst( "trace" );
-		const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-		CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-		const CMICmnMIValueConst miValueConst2( "all" );
-		const CMICmnMIValueResult miValueResult2( "stopped-threads", miValueConst2 );
-		bOk = miOutOfBandRecord.Add( miValueResult2 );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		bOk = bOk && TextToStdout( "(gdb)" );
-		return bOk;
-	}
-
-	CMICmnLLDBDebugSessionInfo & rSession = CMICmnLLDBDebugSessionInfo::Instance();
-
-	// MI print "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x%08x\",func=\"%s\",args=[\"%s\"],file=\"%s\",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
-	lldb::SBFrame frame = thread.GetFrameAtIndex( 0 );
-	lldb::addr_t pc = 0;
-	CMIUtilString fnName;
-	CMIUtilString fileName;
-	CMIUtilString path; 
-	MIuint nLine = 0;
-	if( !rSession.GetFrameInfo( frame, pc, fnName, fileName, path, nLine ) )
-	{
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET ), "HandleProcessEventStopReasonTrace()" ) );
-		return MIstatus::failure;
-	}
-
-	// Function args
-	CMICmnMIValueList miValueList( true );
-	const MIuint maskVarTypes = 0x1000;
-	if( !rSession.MIResponseFormVariableInfo2( frame, maskVarTypes, miValueList ) )
-		return MIstatus::failure;
-	CMICmnMIValueTuple miValueTuple;
-	if( !rSession.MIResponseFormFrameInfo2( pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple ) )
-		return MIstatus::failure;
-
-	const CMICmnMIValueConst miValueConst( "end-stepping-range" );
-	const CMICmnMIValueResult miValueResult( "reason", miValueConst );
-	CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult );
-	const CMICmnMIValueResult miValueResult2( "frame", miValueTuple );
-	bOk = miOutOfBandRecord.Add( miValueResult2 );
-
-	// Add to MI thread-id=\"%d\",stopped-threads=\"all\"
-	if( bOk )
-	{
-		const CMIUtilString strThreadId( CMIUtilString::Format( "%d", thread.GetIndexID() ) );
-		const CMICmnMIValueConst miValueConst8( strThreadId );
-		const CMICmnMIValueResult miValueResult8( "thread-id", miValueConst8 );
-		bOk = miOutOfBandRecord.Add( miValueResult8 );
-	}	
-	if( bOk )
-	{
-		const CMICmnMIValueConst miValueConst9( "all" );
-		const CMICmnMIValueResult miValueResult9( "stopped-threads", miValueConst9 );
-		bOk = miOutOfBandRecord.Add( miValueResult9 );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-		bOk = bOk && TextToStdout( "(gdb)" );
-	}	
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous function update selected thread.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::UpdateSelectedThread( void )
-{
-	lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
-	if( !process.IsValid() )
-		return MIstatus::success;
-
-	lldb::SBThread currentThread = process.GetSelectedThread();
-	lldb::SBThread thread;
-	const lldb::StopReason eCurrentThreadStoppedReason = currentThread.GetStopReason();
-	if( !currentThread.IsValid() || (eCurrentThreadStoppedReason == lldb::eStopReasonInvalid) || (eCurrentThreadStoppedReason == lldb::eStopReasonNone) )
-	{
-		// Prefer a thread that has just completed its plan over another thread as current thread
-		lldb::SBThread planThread;
-		lldb::SBThread otherThread;
-		const size_t nThread = process.GetNumThreads();
-		for( MIuint i = 0; i < nThread; i++ )
-		{
-			//	GetThreadAtIndex() uses a base 0 index
-			//	GetThreadByIndexID() uses a base 1 index
-			thread = process.GetThreadAtIndex( i );
-			const lldb::StopReason eThreadStopReason = thread.GetStopReason();
-			switch( eThreadStopReason )
-			{
+    switch (nEventType)
+    {
+        case lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit:
+            pEventType = "eBroadcastBitThreadShouldExit";
+        // ToDo: IOR: Reminder to maybe handle this here
+        // const MIuint nEventType = event.GetType();
+        // if (nEventType & lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit)
+        //{
+        //  m_pClientDriver->SetExitApplicationFlag();
+        //  vrbYesExit = true;
+        //  return MIstatus::success;
+        //}     break;
+        case lldb::SBCommandInterpreter::eBroadcastBitResetPrompt:
+            pEventType = "eBroadcastBitResetPrompt";
+            break;
+        case lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived:
+            pEventType = "eBroadcastBitQuitCommandReceived";
+            break;
+        case lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData:
+            pEventType = "eBroadcastBitAsynchronousOutputData";
+            break;
+        case lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData:
+            pEventType = "eBroadcastBitAsynchronousErrorData";
+            break;
+        default:
+        {
+            const CMIUtilString msg(
+                CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT), "SBCommandInterpreter", (MIuint)nEventType));
+            SetErrorDescription(msg);
+            return MIstatus::failure;
+        }
+    }
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SBCommandInterpreter event occurred: %s", pEventType));
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Handle SBProcess event eBroadcastBitStateChanged.
+// Type:    Method.
+// Args:    vEvent          - (R) An LLDB event object.
+//          vrbExitAppEvent - (W) True - Received LLDB exit app event, false = did not.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventBroadcastBitStateChanged(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent)
+{
+    bool bOk = ChkForStateChanges();
+    bOk = bOk && GetProcessStdout();
+    bOk = bOk && GetProcessStderr();
+    if (!bOk)
+        return MIstatus::failure;
+
+    // Something changed in the process; get the event and report the process's current
+    // status and location
+    const lldb::StateType eEventState = lldb::SBProcess::GetStateFromEvent(vEvent);
+    if (eEventState == lldb::eStateInvalid)
+        return MIstatus::success;
+
+    lldb::SBProcess process = lldb::SBProcess::GetProcessFromEvent(vEvent);
+    if (!process.IsValid())
+    {
+        const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID), "SBProcess",
+                                                      "HandleProcessEventBroadcastBitStateChanged()"));
+        SetErrorDescription(msg);
+        return MIstatus::failure;
+    }
+
+    bool bShouldBrk = true;
+    const MIchar *pEventType = "";
+    switch (eEventState)
+    {
+        case lldb::eStateUnloaded:
+            pEventType = "eStateUnloaded";
+            break;
+        case lldb::eStateConnected:
+            pEventType = "eStateConnected";
+            break;
+        case lldb::eStateAttaching:
+            pEventType = "eStateAttaching";
+            break;
+        case lldb::eStateLaunching:
+            pEventType = "eStateLaunching";
+            break;
+        case lldb::eStateStopped:
+            pEventType = "eStateStopped";
+            bOk = HandleProcessEventStateStopped(bShouldBrk);
+            if (bShouldBrk)
+                break;
+        case lldb::eStateCrashed:
+        case lldb::eStateSuspended:
+            pEventType = "eStateSuspended";
+            bOk = HandleProcessEventStateSuspended(vEvent);
+            break;
+        case lldb::eStateRunning:
+            pEventType = "eStateRunning";
+            bOk = HandleProcessEventStateRunning();
+            break;
+        case lldb::eStateStepping:
+            pEventType = "eStateStepping";
+            break;
+        case lldb::eStateDetached:
+            pEventType = "eStateDetached";
+            break;
+        case lldb::eStateExited:
+            pEventType = "eStateExited";
+            vrbExitAppEvent = true;
+            bOk = HandleProcessEventStateExited();
+            break;
+        default:
+        {
+            const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT), "SBProcess BroadcastBitStateChanged",
+                                                          (MIuint)eEventState));
+            SetErrorDescription(msg);
+            return MIstatus::failure;
+        }
+    }
+
+    // ToDo: Remove when finished coding application
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SB Process event BroadcastBitStateChanged occurred: %s", pEventType));
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous event handler for LLDB Process state suspended.
+// Type:    Method.
+// Args:    vEvent  - (R) An LLDB event object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended(const lldb::SBEvent &vEvent)
+{
+    // Make sure the program hasn't been auto-restarted:
+    if (lldb::SBProcess::GetRestartedFromEvent(vEvent))
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    lldb::SBDebugger &rDebugger = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger;
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    lldb::SBTarget target = rProcess.GetTarget();
+    if (rDebugger.GetSelectedTarget() == target)
+    {
+        if (!UpdateSelectedThread())
+            return MIstatus::failure;
+
+        lldb::SBCommandReturnObject result;
+        const lldb::ReturnStatus status = rDebugger.GetCommandInterpreter().HandleCommand("process status", result, false);
+        MIunused(status);
+        bOk = TextToStderr(result.GetError());
+        bOk = bOk && TextToStdout(result.GetOutput());
+    }
+    else
+    {
+        lldb::SBStream streamOut;
+        const MIuint nTargetIndex = rDebugger.GetIndexOfTarget(target);
+        if (nTargetIndex != UINT_MAX)
+            streamOut.Printf("Target %d: (", nTargetIndex);
+        else
+            streamOut.Printf("Target <unknown index>: (");
+        target.GetDescription(streamOut, lldb::eDescriptionLevelBrief);
+        streamOut.Printf(") stopped.\n");
+        bOk = TextToStdout(streamOut.GetData());
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Print to stdout MI formatted text to indicate process stopped.
+// Type:    Method.
+// Args:    vwrbShouldBrk   - (W) True = Yes break, false = do not.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped(bool &vwrbShouldBrk)
+{
+    if (!UpdateSelectedThread())
+        return MIstatus::failure;
+
+    const MIchar *pEventType = "";
+    bool bOk = MIstatus::success;
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    const lldb::StopReason eStoppedReason = rProcess.GetSelectedThread().GetStopReason();
+    switch (eStoppedReason)
+    {
+        case lldb::eStopReasonInvalid:
+            pEventType = "eStopReasonInvalid";
+            vwrbShouldBrk = false;
+            break;
+        case lldb::eStopReasonNone:
+            pEventType = "eStopReasonNone";
+            break;
+        case lldb::eStopReasonTrace:
+            pEventType = "eStopReasonTrace";
+            bOk = HandleProcessEventStopReasonTrace();
+            break;
+        case lldb::eStopReasonBreakpoint:
+            pEventType = "eStopReasonBreakpoint";
+            bOk = HandleProcessEventStopReasonBreakpoint();
+            break;
+        case lldb::eStopReasonWatchpoint:
+            pEventType = "eStopReasonWatchpoint";
+            break;
+        case lldb::eStopReasonSignal:
+            pEventType = "eStopReasonSignal";
+            bOk = HandleProcessEventStopSignal(vwrbShouldBrk);
+            break;
+        case lldb::eStopReasonException:
+            pEventType = "eStopReasonException";
+            break;
+        case lldb::eStopReasonExec:
+            pEventType = "eStopReasonExec";
+            break;
+        case lldb::eStopReasonPlanComplete:
+            pEventType = "eStopReasonPlanComplete";
+            bOk = HandleProcessEventStopReasonTrace();
+            break;
+        case lldb::eStopReasonThreadExiting:
+            pEventType = "eStopReasonThreadExiting";
+            break;
+    }
+
+    // ToDo: Remove when finished coding application
+    m_pLog->WriteLog(CMIUtilString::Format("##### An SB Process event stop state occurred: %s", pEventType));
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous event handler for LLDB Process stop signal.
+// Type:    Method.
+// Args:    vwrbShouldBrk   - (W) True = Yes break, false = do not.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal(bool &vwrbShouldBrk)
+{
+    bool bOk = MIstatus::success;
+
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    const MIuint64 nStopReason = rProcess.GetSelectedThread().GetStopReasonDataAtIndex(0);
+    switch (nStopReason)
+    {
+        case 2: // Terminal interrupt signal. SIGINT
+        {
+            // MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGNINT\",signal-meaning=\"Interrupt\",frame={%s}"
+            const CMICmnMIValueConst miValueConst("signal-received");
+            const CMICmnMIValueResult miValueResult("reason", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+            const CMICmnMIValueConst miValueConst2("SIGINT");
+            const CMICmnMIValueResult miValueResult2("signal-name", miValueConst2);
+            bOk = miOutOfBandRecord.Add(miValueResult2);
+            const CMICmnMIValueConst miValueConst3("Interrupt");
+            const CMICmnMIValueResult miValueResult3("signal-meaning", miValueConst3);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+            CMICmnMIValueTuple miValueTuple;
+            bOk = bOk && MiHelpGetCurrentThreadFrame(miValueTuple);
+            const CMICmnMIValueResult miValueResult5("frame", miValueTuple);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult5);
+            bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+            bOk = bOk && TextToStdout("(gdb)");
+        }
+        break;
+        case 11: // Invalid memory reference. SIGSEGV
+        {
+            // MI print "*stopped,reason=\"signal-received\",signal-name=\"SIGSEGV\",signal-meaning=\"Segmentation
+            // fault\",thread-id=\"%d\",frame={%s}"
+            const CMICmnMIValueConst miValueConst("signal-received");
+            const CMICmnMIValueResult miValueResult("reason", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+            const CMICmnMIValueConst miValueConst2("SIGSEGV");
+            const CMICmnMIValueResult miValueResult2("signal-name", miValueConst2);
+            bOk = miOutOfBandRecord.Add(miValueResult2);
+            const CMICmnMIValueConst miValueConst3("Segmentation fault");
+            const CMICmnMIValueResult miValueResult3("signal-meaning", miValueConst3);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+            const CMIUtilString strThreadId(CMIUtilString::Format("%d", rProcess.GetSelectedThread().GetIndexID()));
+            const CMICmnMIValueConst miValueConst4(strThreadId);
+            const CMICmnMIValueResult miValueResult4("thread-id", miValueConst4);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult4);
+            CMICmnMIValueTuple miValueTuple;
+            bOk = bOk && MiHelpGetCurrentThreadFrame(miValueTuple);
+            const CMICmnMIValueResult miValueResult5("frame", miValueTuple);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult5);
+            bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+            // Note no "(gdb)" output here
+        }
+        break;
+        case 19:
+            if (rProcess.IsValid())
+                rProcess.Continue();
+            break;
+        case 5: //  Trace/breakpoint trap. SIGTRAP
+        {
+            lldb::SBThread thread = rProcess.GetSelectedThread();
+            const MIuint nFrames = thread.GetNumFrames();
+            if (nFrames > 0)
+            {
+                lldb::SBFrame frame = thread.GetFrameAtIndex(0);
+                const char *pFnName = frame.GetFunctionName();
+                if (pFnName != nullptr)
+                {
+                    const CMIUtilString fnName = CMIUtilString(pFnName);
+                    static const CMIUtilString threadCloneFn = CMIUtilString("__pthread_clone");
+
+                    if (CMIUtilString::Compare(threadCloneFn, fnName))
+                    {
+                        if (rProcess.IsValid())
+                        {
+                            rProcess.Continue();
+                            vwrbShouldBrk = true;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        default:
+        {
+            // MI print "*stopped,reason=\"signal-received\",signal=\"%lld\",stopped-threads=\"all\""
+            const CMICmnMIValueConst miValueConst("signal-received");
+            const CMICmnMIValueResult miValueResult("reason", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+            const CMIUtilString strReason(CMIUtilString::Format("%lld", nStopReason));
+            const CMICmnMIValueConst miValueConst2(strReason);
+            const CMICmnMIValueResult miValueResult2("signal", miValueConst2);
+            bOk = miOutOfBandRecord.Add(miValueResult2);
+            const CMICmnMIValueConst miValueConst3("all");
+            const CMICmnMIValueResult miValueResult3("stopped-threads", miValueConst3);
+            bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+            bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+            bOk = bOk && TextToStdout("(gdb)");
+        }
+    } // switch( nStopReason )
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form partial MI response in a MI value tuple object.
+// Type:    Method.
+// Args:    vwrMiValueTuple   - (W) MI value tuple object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::MiHelpGetCurrentThreadFrame(CMICmnMIValueTuple &vwrMiValueTuple)
+{
+    CMIUtilString strThreadFrame;
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    lldb::SBThread thread = rProcess.GetSelectedThread();
+    const MIuint nFrame = thread.GetNumFrames();
+    if (nFrame == 0)
+    {
+        // MI print "addr=\"??\",func=\"??\",file=\"??\",fullname=\"??\",line=\"??\""
+        const CMICmnMIValueConst miValueConst("??");
+        const CMICmnMIValueResult miValueResult("addr", miValueConst);
+        CMICmnMIValueTuple miValueTuple(miValueResult);
+        const CMICmnMIValueResult miValueResult2("func", miValueConst);
+        miValueTuple.Add(miValueResult2);
+        const CMICmnMIValueResult miValueResult4("file", miValueConst);
+        miValueTuple.Add(miValueResult4);
+        const CMICmnMIValueResult miValueResult5("fullname", miValueConst);
+        miValueTuple.Add(miValueResult5);
+        const CMICmnMIValueResult miValueResult6("line", miValueConst);
+        miValueTuple.Add(miValueResult6);
+
+        vwrMiValueTuple = miValueTuple;
+
+        return MIstatus::success;
+    }
+
+    CMICmnMIValueTuple miValueTuple;
+    if (!CMICmnLLDBDebugSessionInfo::Instance().MIResponseFormFrameInfo(thread, 0, miValueTuple))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE), "MiHelpGetCurrentThreadFrame()"));
+        return MIstatus::failure;
+    }
+
+    vwrMiValueTuple = miValueTuple;
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous event handler for LLDB Process stop reason breakpoint.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonBreakpoint(void)
+{
+    // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
+    if (!CMIDriver::Instance().SetDriverStateRunningNotDebugging())
+    {
+        const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE),
+                                                  "HandleProcessEventStopReasonBreakpoint()", rErrMsg.c_str()));
+        return MIstatus::failure;
+    }
+
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    const MIuint64 brkPtId = rProcess.GetSelectedThread().GetStopReasonDataAtIndex(0);
+    lldb::SBBreakpoint brkPt = CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget.GetBreakpointAtIndex((MIuint)brkPtId);
+
+    return MiStoppedAtBreakPoint(brkPtId, brkPt);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Form the MI Out-of-band response for stopped reason on hitting a break point.
+// Type:    Method.
+// Args:    vBrkPtId    - (R) The LLDB break point's ID
+//          vBrkPt      - (R) THe LLDB break point object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint(const MIuint64 vBrkPtId, const lldb::SBBreakpoint &vBrkPt)
+{
+    bool bOk = MIstatus::success;
+
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    lldb::SBThread thread = rProcess.GetSelectedThread();
+    const MIuint nFrame = thread.GetNumFrames();
+    if (nFrame == 0)
+    {
+        // MI print "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%d\",frame={},thread-id=\"%d\",stopped-threads=\"all\""
+        const CMICmnMIValueConst miValueConst("breakpoint-hit");
+        const CMICmnMIValueResult miValueResult("reason", miValueConst);
+        CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+        const CMICmnMIValueConst miValueConst2("del");
+        const CMICmnMIValueResult miValueResult2("disp", miValueConst2);
+        bOk = miOutOfBandRecord.Add(miValueResult2);
+        const CMIUtilString strBkp(CMIUtilString::Format("%d", vBrkPtId));
+        const CMICmnMIValueConst miValueConst3(strBkp);
+        CMICmnMIValueResult miValueResult3("bkptno", miValueConst3);
+        bOk = bOk && miOutOfBandRecord.Add(miValueResult3);
+        const CMICmnMIValueConst miValueConst4("{}");
+        const CMICmnMIValueResult miValueResult4("frame", miValueConst4);
+        bOk = bOk && miOutOfBandRecord.Add(miValueResult4);
+        const CMIUtilString strThreadId(CMIUtilString::Format("%d", vBrkPt.GetThreadIndex()));
+        const CMICmnMIValueConst miValueConst5(strThreadId);
+        const CMICmnMIValueResult miValueResult5("thread-id", miValueConst5);
+        bOk = bOk && miOutOfBandRecord.Add(miValueResult5);
+        const CMICmnMIValueConst miValueConst6("all");
+        const CMICmnMIValueResult miValueResult6("stopped-threads", miValueConst6);
+        bOk = bOk && miOutOfBandRecord.Add(miValueResult6);
+        bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+        bOk = bOk && TextToStdout("(gdb)");
+        return bOk;
+    }
+
+    CMICmnLLDBDebugSessionInfo &rSession = CMICmnLLDBDebugSessionInfo::Instance();
+
+    lldb::SBFrame frame = thread.GetFrameAtIndex(0);
+    lldb::addr_t pc = 0;
+    CMIUtilString fnName;
+    CMIUtilString fileName;
+    CMIUtilString path;
+    MIuint nLine = 0;
+    if (!rSession.GetFrameInfo(frame, pc, fnName, fileName, path, nLine))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET), "MiStoppedAtBreakPoint()"));
+        return MIstatus::failure;
+    }
+
+    // MI print
+    // "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%d\",frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
+    const CMICmnMIValueConst miValueConst("breakpoint-hit");
+    const CMICmnMIValueResult miValueResult("reason", miValueConst);
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+    const CMICmnMIValueConst miValueConstA("del");
+    const CMICmnMIValueResult miValueResultA("disp", miValueConstA);
+    bOk = miOutOfBandRecord.Add(miValueResultA);
+    const CMIUtilString strBkp(CMIUtilString::Format("%d", vBrkPtId));
+    const CMICmnMIValueConst miValueConstB(strBkp);
+    CMICmnMIValueResult miValueResultB("bkptno", miValueConstB);
+    bOk = bOk && miOutOfBandRecord.Add(miValueResultB);
+
+    // frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\",fullname=\"%s\",line=\"%d\"}
+    if (bOk)
+    {
+        CMICmnMIValueList miValueList(true);
+        const MIuint maskVarTypes = 0x1000;
+        bOk = rSession.MIResponseFormVariableInfo2(frame, maskVarTypes, miValueList);
+
+        CMICmnMIValueTuple miValueTuple;
+        bOk = bOk && rSession.MIResponseFormFrameInfo2(pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple);
+        const CMICmnMIValueResult miValueResult8("frame", miValueTuple);
+        bOk = bOk && miOutOfBandRecord.Add(miValueResult8);
+    }
+
+    // Add to MI thread-id=\"%d\",stopped-threads=\"all\"
+    if (bOk)
+    {
+        const CMIUtilString strThreadId(CMIUtilString::Format("%d", thread.GetIndexID()));
+        const CMICmnMIValueConst miValueConst8(strThreadId);
+        const CMICmnMIValueResult miValueResult8("thread-id", miValueConst8);
+        bOk = miOutOfBandRecord.Add(miValueResult8);
+    }
+    if (bOk)
+    {
+        const CMICmnMIValueConst miValueConst9("all");
+        const CMICmnMIValueResult miValueResult9("stopped-threads", miValueConst9);
+        bOk = miOutOfBandRecord.Add(miValueResult9);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+        bOk = bOk && TextToStdout("(gdb)");
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous event handler for LLDB Process stop reason trace.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonTrace(void)
+{
+    bool bOk = true;
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    lldb::SBThread thread = rProcess.GetSelectedThread();
+    const MIuint nFrame = thread.GetNumFrames();
+    if (nFrame == 0)
+    {
+        // MI print "*stopped,reason=\"trace\",stopped-threads=\"all\""
+        const CMICmnMIValueConst miValueConst("trace");
+        const CMICmnMIValueResult miValueResult("reason", miValueConst);
+        CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+        const CMICmnMIValueConst miValueConst2("all");
+        const CMICmnMIValueResult miValueResult2("stopped-threads", miValueConst2);
+        bOk = miOutOfBandRecord.Add(miValueResult2);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+        bOk = bOk && TextToStdout("(gdb)");
+        return bOk;
+    }
+
+    CMICmnLLDBDebugSessionInfo &rSession = CMICmnLLDBDebugSessionInfo::Instance();
+
+    // MI print
+    // "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x%08x\",func=\"%s\",args=[\"%s\"],file=\"%s\",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
+    lldb::SBFrame frame = thread.GetFrameAtIndex(0);
+    lldb::addr_t pc = 0;
+    CMIUtilString fnName;
+    CMIUtilString fileName;
+    CMIUtilString path;
+    MIuint nLine = 0;
+    if (!rSession.GetFrameInfo(frame, pc, fnName, fileName, path, nLine))
+    {
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET), "HandleProcessEventStopReasonTrace()"));
+        return MIstatus::failure;
+    }
+
+    // Function args
+    CMICmnMIValueList miValueList(true);
+    const MIuint maskVarTypes = 0x1000;
+    if (!rSession.MIResponseFormVariableInfo2(frame, maskVarTypes, miValueList))
+        return MIstatus::failure;
+    CMICmnMIValueTuple miValueTuple;
+    if (!rSession.MIResponseFormFrameInfo2(pc, miValueList.GetString(), fnName, fileName, path, nLine, miValueTuple))
+        return MIstatus::failure;
+
+    const CMICmnMIValueConst miValueConst("end-stepping-range");
+    const CMICmnMIValueResult miValueResult("reason", miValueConst);
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
+    const CMICmnMIValueResult miValueResult2("frame", miValueTuple);
+    bOk = miOutOfBandRecord.Add(miValueResult2);
+
+    // Add to MI thread-id=\"%d\",stopped-threads=\"all\"
+    if (bOk)
+    {
+        const CMIUtilString strThreadId(CMIUtilString::Format("%d", thread.GetIndexID()));
+        const CMICmnMIValueConst miValueConst8(strThreadId);
+        const CMICmnMIValueResult miValueResult8("thread-id", miValueConst8);
+        bOk = miOutOfBandRecord.Add(miValueResult8);
+    }
+    if (bOk)
+    {
+        const CMICmnMIValueConst miValueConst9("all");
+        const CMICmnMIValueResult miValueResult9("stopped-threads", miValueConst9);
+        bOk = miOutOfBandRecord.Add(miValueResult9);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+        bOk = bOk && TextToStdout("(gdb)");
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous function update selected thread.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::UpdateSelectedThread(void)
+{
+    lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
+    if (!process.IsValid())
+        return MIstatus::success;
+
+    lldb::SBThread currentThread = process.GetSelectedThread();
+    lldb::SBThread thread;
+    const lldb::StopReason eCurrentThreadStoppedReason = currentThread.GetStopReason();
+    if (!currentThread.IsValid() || (eCurrentThreadStoppedReason == lldb::eStopReasonInvalid) ||
+        (eCurrentThreadStoppedReason == lldb::eStopReasonNone))
+    {
+        // Prefer a thread that has just completed its plan over another thread as current thread
+        lldb::SBThread planThread;
+        lldb::SBThread otherThread;
+        const size_t nThread = process.GetNumThreads();
+        for (MIuint i = 0; i < nThread; i++)
+        {
+            //  GetThreadAtIndex() uses a base 0 index
+            //  GetThreadByIndexID() uses a base 1 index
+            thread = process.GetThreadAtIndex(i);
+            const lldb::StopReason eThreadStopReason = thread.GetStopReason();
+            switch (eThreadStopReason)
+            {
                 case lldb::eStopReasonTrace:
                 case lldb::eStopReasonBreakpoint:
                 case lldb::eStopReasonWatchpoint:
                 case lldb::eStopReasonSignal:
                 case lldb::eStopReasonException:
-                    if( !otherThread.IsValid() )
+                    if (!otherThread.IsValid())
                         otherThread = thread;
                     break;
                 case lldb::eStopReasonPlanComplete:
-                    if( !planThread.IsValid() )
+                    if (!planThread.IsValid())
                         planThread = thread;
                     break;
-				case lldb::eStopReasonInvalid:
+                case lldb::eStopReasonInvalid:
                 case lldb::eStopReasonNone:
                 default:
                     break;
-			}
-		}
-		if( planThread.IsValid() )
-			process.SetSelectedThread( planThread );
-		else if( otherThread.IsValid() )
-			process.SetSelectedThread( otherThread );
-		else
-		{
-			if( currentThread.IsValid() )
-				thread = currentThread;
-			else
-				thread = process.GetThreadAtIndex( 0 );
-
-			if( thread.IsValid() )
-				process.SetSelectedThread( thread );
-		}
-	} // if( !currentThread.IsValid() || (eCurrentThreadStoppedReason == lldb::eStopReasonInvalid) || (eCurrentThreadStoppedReason == lldb::eStopReasonNone) )
-	
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Print to stdout "*running,thread-id=\"all\"", "(gdb)".
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateRunning( void )
-{
-	CMICmnMIValueConst miValueConst( "all" );
-	CMICmnMIValueResult miValueResult( "thread-id", miValueConst );
-	CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_Running, miValueResult );
-	bool bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord );
-	bOk = bOk && TextToStdout( "(gdb)" );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Print to stdout "=thread-exited,id=\"%ld\",group-id=\"i1\"", 
-//							"=thread-group-exited,id=\"i1\",exit-code=\"0\""),
-//							"*stopped,reason=\"exited-normally\"",
-//							"(gdb)"
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateExited( void )
-{
-	const CMIUtilString strId( CMIUtilString::Format( "%ld", 1 ) );
-	CMICmnMIValueConst miValueConst( strId );
-	CMICmnMIValueResult miValueResult( "id", miValueConst );
-	CMICmnMIOutOfBandRecord miOutOfBandRecord( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, miValueResult );
-	CMICmnMIValueConst miValueConst2( "i1" );
-	CMICmnMIValueResult miValueResult2( "group-id", miValueConst2 );
-	bool bOk = miOutOfBandRecord.Add( miValueResult2 );
-	bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord );
-	if( bOk )
-	{
-		CMICmnMIValueConst miValueConst3( "i1" );
-		CMICmnMIValueResult miValueResult3( "id", miValueConst3 );
-		CMICmnMIOutOfBandRecord miOutOfBandRecord2( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, miValueResult3 );
-		CMICmnMIValueConst miValueConst2( "0" );
-		CMICmnMIValueResult miValueResult2( "exit-code", miValueConst2 );
-		bOk = miOutOfBandRecord2.Add( miValueResult2 );
-		bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBandRecord2 );
-	}	
-	if( bOk )
-	{
-		CMICmnMIValueConst miValueConst4( "exited-normally" );
-		CMICmnMIValueResult miValueResult4( "reason", miValueConst4 );
-		CMICmnMIOutOfBandRecord miOutOfBandRecord3( CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult4 );
-		bOk = MiOutOfBandRecordToStdout( miOutOfBandRecord3 );
-	}	
-	bOk = bOk && TextToStdout( "(gdb)" );
-
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Drain all stdout so we don't see any output come after we print our prompts. 
-//			The process has stuff waiting for stdout; get it and write it out to the 
-//			appropriate place.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::GetProcessStdout( void )
-{
-	bool bOk = MIstatus::success;
-
-	char c;
-	size_t nBytes = 0;
-	CMIUtilString text;
-	lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
-	while( process.GetSTDOUT( &c, 1 ) > 0 )
-	{
-		CMIUtilString str;
-		if( ConvertPrintfCtrlCodeToString( c, str ) )
-			text += str;
-		nBytes++;
-	}
-	if( nBytes > 0 )
-	{
-		const CMIUtilString t( CMIUtilString::Format( "~\"%s\"", text.c_str() ) );
-		bOk = TextToStdout( t );
-	}
-	
-	return bOk;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Drain all stderr so we don't see any output come after we print our prompts.
-//			The process has stuff waiting for stderr; get it and write it out to the 
-//			appropriate place.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::GetProcessStderr( void )
-{
-	bool bOk = MIstatus::success;
-
-	char c;
-	size_t nBytes = 0;
-	CMIUtilString text;
-	lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
-	while( process.GetSTDERR( &c, 1 ) > 0 )
-	{
-		CMIUtilString str;
-		if( ConvertPrintfCtrlCodeToString( c, str ) )
-			text += str;
-		nBytes++;
-	}
-	if( nBytes > 0 )
-	{
-		const CMIUtilString t( CMIUtilString::Format( "~\"%s\"", text.c_str() ) );
-		bOk = TextToStdout( t );
-	}
-	
-	return bOk;
-}
-	
-//++ ------------------------------------------------------------------------------------
-// Details:	Convert text stream control codes to text equivalent.
-// Type:	Method.
-// Args:	vCtrl				- (R) The control code.
-//			vwrStrEquivalent	- (W) The text equivalent.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::ConvertPrintfCtrlCodeToString( const MIchar vCtrl, CMIUtilString & vwrStrEquivalent )
-{
-	switch( vCtrl )
-	{
-	    case '\033': vwrStrEquivalent = "\\e"; break;
-		case '\a': vwrStrEquivalent = "\\a"; break;
-		case '\b': vwrStrEquivalent = "\\b"; break;
-		case '\f': vwrStrEquivalent = "\\f"; break;
-		case '\n': vwrStrEquivalent = "\\n"; break;
-		case '\r': vwrStrEquivalent = "\\r"; break;
-		case '\t': vwrStrEquivalent = "\\t"; break;
-		case '\v': vwrStrEquivalent = "\\v"; break;
-		default: 
-			vwrStrEquivalent = CMIUtilString::Format( "%c", vCtrl ); 
-			break;
-	}
-
-	return MIstatus::success;
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Asynchronous event function check for state changes.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges( void )
-{
-	lldb::SBProcess & rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
-	if( !rProcess.IsValid() )
-		return MIstatus::success;
-	lldb::SBTarget & rTarget = CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget;
-	if( !rTarget.IsValid() )
-		return MIstatus::success;
+            }
+        }
+        if (planThread.IsValid())
+            process.SetSelectedThread(planThread);
+        else if (otherThread.IsValid())
+            process.SetSelectedThread(otherThread);
+        else
+        {
+            if (currentThread.IsValid())
+                thread = currentThread;
+            else
+                thread = process.GetThreadAtIndex(0);
+
+            if (thread.IsValid())
+                process.SetSelectedThread(thread);
+        }
+    } // if( !currentThread.IsValid() || (eCurrentThreadStoppedReason == lldb::eStopReasonInvalid) || (eCurrentThreadStoppedReason ==
+      // lldb::eStopReasonNone) )
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Print to stdout "*running,thread-id=\"all\"", "(gdb)".
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateRunning(void)
+{
+    CMICmnMIValueConst miValueConst("all");
+    CMICmnMIValueResult miValueResult("thread-id", miValueConst);
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Running, miValueResult);
+    bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    bOk = bOk && TextToStdout("(gdb)");
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Print to stdout "=thread-exited,id=\"%ld\",group-id=\"i1\"",
+//                          "=thread-group-exited,id=\"i1\",exit-code=\"0\""),
+//                          "*stopped,reason=\"exited-normally\"",
+//                          "(gdb)"
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateExited(void)
+{
+    const CMIUtilString strId(CMIUtilString::Format("%ld", 1));
+    CMICmnMIValueConst miValueConst(strId);
+    CMICmnMIValueResult miValueResult("id", miValueConst);
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, miValueResult);
+    CMICmnMIValueConst miValueConst2("i1");
+    CMICmnMIValueResult miValueResult2("group-id", miValueConst2);
+    bool bOk = miOutOfBandRecord.Add(miValueResult2);
+    bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord);
+    if (bOk)
+    {
+        CMICmnMIValueConst miValueConst3("i1");
+        CMICmnMIValueResult miValueResult3("id", miValueConst3);
+        CMICmnMIOutOfBandRecord miOutOfBandRecord2(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, miValueResult3);
+        CMICmnMIValueConst miValueConst2("0");
+        CMICmnMIValueResult miValueResult2("exit-code", miValueConst2);
+        bOk = miOutOfBandRecord2.Add(miValueResult2);
+        bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBandRecord2);
+    }
+    if (bOk)
+    {
+        CMICmnMIValueConst miValueConst4("exited-normally");
+        CMICmnMIValueResult miValueResult4("reason", miValueConst4);
+        CMICmnMIOutOfBandRecord miOutOfBandRecord3(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult4);
+        bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord3);
+    }
+    bOk = bOk && TextToStdout("(gdb)");
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Drain all stdout so we don't see any output come after we print our prompts.
+//          The process has stuff waiting for stdout; get it and write it out to the
+//          appropriate place.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::GetProcessStdout(void)
+{
+    bool bOk = MIstatus::success;
+
+    char c;
+    size_t nBytes = 0;
+    CMIUtilString text;
+    lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
+    while (process.GetSTDOUT(&c, 1) > 0)
+    {
+        CMIUtilString str;
+        if (ConvertPrintfCtrlCodeToString(c, str))
+            text += str;
+        nBytes++;
+    }
+    if (nBytes > 0)
+    {
+        const CMIUtilString t(CMIUtilString::Format("~\"%s\"", text.c_str()));
+        bOk = TextToStdout(t);
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Drain all stderr so we don't see any output come after we print our prompts.
+//          The process has stuff waiting for stderr; get it and write it out to the
+//          appropriate place.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::GetProcessStderr(void)
+{
+    bool bOk = MIstatus::success;
+
+    char c;
+    size_t nBytes = 0;
+    CMIUtilString text;
+    lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().m_rLldbDebugger.GetSelectedTarget().GetProcess();
+    while (process.GetSTDERR(&c, 1) > 0)
+    {
+        CMIUtilString str;
+        if (ConvertPrintfCtrlCodeToString(c, str))
+            text += str;
+        nBytes++;
+    }
+    if (nBytes > 0)
+    {
+        const CMIUtilString t(CMIUtilString::Format("~\"%s\"", text.c_str()));
+        bOk = TextToStdout(t);
+    }
+
+    return bOk;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Convert text stream control codes to text equivalent.
+// Type:    Method.
+// Args:    vCtrl             - (R) The control code.
+//          vwrStrEquivalent  - (W) The text equivalent.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::ConvertPrintfCtrlCodeToString(const MIchar vCtrl, CMIUtilString &vwrStrEquivalent)
+{
+    switch (vCtrl)
+    {
+        case '\033':
+            vwrStrEquivalent = "\\e";
+            break;
+        case '\a':
+            vwrStrEquivalent = "\\a";
+            break;
+        case '\b':
+            vwrStrEquivalent = "\\b";
+            break;
+        case '\f':
+            vwrStrEquivalent = "\\f";
+            break;
+        case '\n':
+            vwrStrEquivalent = "\\n";
+            break;
+        case '\r':
+            vwrStrEquivalent = "\\r";
+            break;
+        case '\t':
+            vwrStrEquivalent = "\\t";
+            break;
+        case '\v':
+            vwrStrEquivalent = "\\v";
+            break;
+        default:
+            vwrStrEquivalent = CMIUtilString::Format("%c", vCtrl);
+            break;
+    }
+
+    return MIstatus::success;
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Asynchronous event function check for state changes.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges(void)
+{
+    lldb::SBProcess &rProcess = CMICmnLLDBDebugSessionInfo::Instance().m_lldbProcess;
+    if (!rProcess.IsValid())
+        return MIstatus::success;
+    lldb::SBTarget &rTarget = CMICmnLLDBDebugSessionInfo::Instance().m_lldbTarget;
+    if (!rTarget.IsValid())
+        return MIstatus::success;
 
-	bool bOk = MIstatus::success;
+    bool bOk = MIstatus::success;
 
-	// Check for created threads
+    // Check for created threads
     const MIuint nThread = rProcess.GetNumThreads();
-	for( MIuint i = 0; i < nThread; i++ )
-	{
-		//	GetThreadAtIndex() uses a base 0 index
-		//	GetThreadByIndexID() uses a base 1 index
-		lldb::SBThread thread = rProcess.GetThreadAtIndex( i );
-		if( !thread.IsValid() )
-			continue;
-
-		CMICmnLLDBDebugSessionInfo::VecActiveThreadId_t::const_iterator it = CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.begin();
-		bool bFound = false;
-		while( it != CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.end() )
-		{
-			const MIuint nThreadId = *it;
-			if( nThreadId == i )
-			{
-				bFound = true;
-				break;
-			}
-
-			// Next
-			++it;
-		}
-		if( !bFound )
-		{
-			CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.push_back( i );
-
-			// Form MI "=thread-created,id=\"%d\",group-id=\"i1\""
-			const CMIUtilString strValue( CMIUtilString::Format( "%d", thread.GetIndexID() ) );
-			const CMICmnMIValueConst miValueConst( strValue );
-			const CMICmnMIValueResult miValueResult( "id", miValueConst );
-			CMICmnMIOutOfBandRecord miOutOfBand( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, miValueResult );
-			const CMICmnMIValueConst miValueConst2( "i1" );
-			const CMICmnMIValueResult miValueResult2( "group-id", miValueConst2 );
-			bOk = miOutOfBand.Add( miValueResult2 );
-			bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBand );
-			if( !bOk )
-				return MIstatus::failure;
-		}
-	}
-
-	lldb::SBThread currentThread = rProcess.GetSelectedThread();
-	if( currentThread.IsValid() )
-	{
-		const MIuint threadId = currentThread.GetIndexID();
-		if( CMICmnLLDBDebugSessionInfo::Instance().m_currentSelectedThread != threadId )
-		{
-			CMICmnLLDBDebugSessionInfo::Instance().m_currentSelectedThread = threadId;
-
-			// Form MI "=thread-selected,id=\"%d\""
-			const CMIUtilString strValue( CMIUtilString::Format( "%d", currentThread.GetIndexID() ) );
-			const CMICmnMIValueConst miValueConst( strValue );
-			const CMICmnMIValueResult miValueResult( "id", miValueConst );
-			CMICmnMIOutOfBandRecord miOutOfBand( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, miValueResult );
-			if( !MiOutOfBandRecordToStdout( miOutOfBand ) )
-				return MIstatus::failure;
-		}
-	}
-
-	// Check for invalid (removed) threads
-	CMICmnLLDBDebugSessionInfo::VecActiveThreadId_t::const_iterator it = CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.begin();
-	while( it != CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.end() )
-	{
-		const MIuint nThreadId = *it;
-		lldb::SBThread thread = rProcess.GetThreadAtIndex( nThreadId );
-		if( !thread.IsValid() )
-		{
-			// Form MI "=thread-exited,id=\"%ld\",group-id=\"i1\""
-			const CMIUtilString strValue( CMIUtilString::Format( "%ld", thread.GetIndexID() ) );
-			const CMICmnMIValueConst miValueConst( strValue );
-			const CMICmnMIValueResult miValueResult( "id", miValueConst );
-			CMICmnMIOutOfBandRecord miOutOfBand( CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, miValueResult );
-			const CMICmnMIValueConst miValueConst2( "i1" );
-			const CMICmnMIValueResult miValueResult2( "group-id", miValueConst2 );
-			bOk = miOutOfBand.Add( miValueResult2 );
-			bOk = bOk && MiOutOfBandRecordToStdout( miOutOfBand );
-			if( !bOk )
-				return MIstatus::failure;
-		}
-
-		// Next
-		++it;
-	}
-			
-	return TextToStdout( "(gdb)" ); 
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Take a fully formed MI result record and send to the stdout stream.
-//			Also output to the MI Log file.
-// Type:	Method.
-// Args:	vrMiResultRecord	- (R) MI result record object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::MiResultRecordToStdout( const CMICmnMIResultRecord & vrMiResultRecord )
-{
-	return TextToStdout( vrMiResultRecord.GetString() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Take a fully formed MI Out-of-band record and send to the stdout stream. 
-//			Also output to the MI Log file.
-// Type:	Method.
-// Args:	vrMiOutOfBandRecord	- (R) MI Out-of-band record object.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::MiOutOfBandRecordToStdout( const CMICmnMIOutOfBandRecord & vrMiOutOfBandRecord )
-{
-	return TextToStdout( vrMiOutOfBandRecord.GetString() );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Take a text data and send to the stdout stream. Also output to the MI Log
-//			file.
-// Type:	Method.
-// Args:	vrTxt	- (R) Text.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnLLDBDebuggerHandleEvents::TextToStdout( const CMIUtilString & vrTxt )
-{
-	return CMICmnStreamStdout::TextToStdout( vrTxt );
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details:	Take a text data and send to the stderr stream. Also output to the MI Log
-//			file.
-// Type:	Method.
-// Args:	vrTxt	- (R) Text.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+    for (MIuint i = 0; i < nThread; i++)
+    {
+        //  GetThreadAtIndex() uses a base 0 index
+        //  GetThreadByIndexID() uses a base 1 index
+        lldb::SBThread thread = rProcess.GetThreadAtIndex(i);
+        if (!thread.IsValid())
+            continue;
+
+        CMICmnLLDBDebugSessionInfo::VecActiveThreadId_t::const_iterator it =
+            CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.begin();
+        bool bFound = false;
+        while (it != CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.end())
+        {
+            const MIuint nThreadId = *it;
+            if (nThreadId == i)
+            {
+                bFound = true;
+                break;
+            }
+
+            // Next
+            ++it;
+        }
+        if (!bFound)
+        {
+            CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.push_back(i);
+
+            // Form MI "=thread-created,id=\"%d\",group-id=\"i1\""
+            const CMIUtilString strValue(CMIUtilString::Format("%d", thread.GetIndexID()));
+            const CMICmnMIValueConst miValueConst(strValue);
+            const CMICmnMIValueResult miValueResult("id", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBand(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, miValueResult);
+            const CMICmnMIValueConst miValueConst2("i1");
+            const CMICmnMIValueResult miValueResult2("group-id", miValueConst2);
+            bOk = miOutOfBand.Add(miValueResult2);
+            bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBand);
+            if (!bOk)
+                return MIstatus::failure;
+        }
+    }
+
+    lldb::SBThread currentThread = rProcess.GetSelectedThread();
+    if (currentThread.IsValid())
+    {
+        const MIuint threadId = currentThread.GetIndexID();
+        if (CMICmnLLDBDebugSessionInfo::Instance().m_currentSelectedThread != threadId)
+        {
+            CMICmnLLDBDebugSessionInfo::Instance().m_currentSelectedThread = threadId;
+
+            // Form MI "=thread-selected,id=\"%d\""
+            const CMIUtilString strValue(CMIUtilString::Format("%d", currentThread.GetIndexID()));
+            const CMICmnMIValueConst miValueConst(strValue);
+            const CMICmnMIValueResult miValueResult("id", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBand(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, miValueResult);
+            if (!MiOutOfBandRecordToStdout(miOutOfBand))
+                return MIstatus::failure;
+        }
+    }
+
+    // Check for invalid (removed) threads
+    CMICmnLLDBDebugSessionInfo::VecActiveThreadId_t::const_iterator it = CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.begin();
+    while (it != CMICmnLLDBDebugSessionInfo::Instance().m_vecActiveThreadId.end())
+    {
+        const MIuint nThreadId = *it;
+        lldb::SBThread thread = rProcess.GetThreadAtIndex(nThreadId);
+        if (!thread.IsValid())
+        {
+            // Form MI "=thread-exited,id=\"%ld\",group-id=\"i1\""
+            const CMIUtilString strValue(CMIUtilString::Format("%ld", thread.GetIndexID()));
+            const CMICmnMIValueConst miValueConst(strValue);
+            const CMICmnMIValueResult miValueResult("id", miValueConst);
+            CMICmnMIOutOfBandRecord miOutOfBand(CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, miValueResult);
+            const CMICmnMIValueConst miValueConst2("i1");
+            const CMICmnMIValueResult miValueResult2("group-id", miValueConst2);
+            bOk = miOutOfBand.Add(miValueResult2);
+            bOk = bOk && MiOutOfBandRecordToStdout(miOutOfBand);
+            if (!bOk)
+                return MIstatus::failure;
+        }
+
+        // Next
+        ++it;
+    }
+
+    return TextToStdout("(gdb)");
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Take a fully formed MI result record and send to the stdout stream.
+//          Also output to the MI Log file.
+// Type:    Method.
+// Args:    vrMiResultRecord  - (R) MI result record object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord)
+{
+    return TextToStdout(vrMiResultRecord.GetString());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Take a fully formed MI Out-of-band record and send to the stdout stream.
+//          Also output to the MI Log file.
+// Type:    Method.
+// Args:    vrMiOutOfBandRecord - (R) MI Out-of-band record object.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiOutOfBandRecord)
+{
+    return TextToStdout(vrMiOutOfBandRecord.GetString());
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Take a text data and send to the stdout stream. Also output to the MI Log
+//          file.
+// Type:    Method.
+// Args:    vrTxt   - (R) Text.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnLLDBDebuggerHandleEvents::TextToStdout(const CMIUtilString &vrTxt)
+{
+    return CMICmnStreamStdout::TextToStdout(vrTxt);
+}
+
+//++ ------------------------------------------------------------------------------------
+// Details: Take a text data and send to the stderr stream. Also output to the MI Log
+//          file.
+// Type:    Method.
+// Args:    vrTxt   - (R) Text.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBDebuggerHandleEvents::TextToStderr( const CMIUtilString & vrTxt )
+bool
+CMICmnLLDBDebuggerHandleEvents::TextToStderr(const CMIUtilString &vrTxt)
 {
-	return CMICmnStreamStderr::TextToStderr( vrTxt );
+    return CMICmnStreamStderr::TextToStderr(vrTxt);
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBDebuggerHandleEvents.h
+// File:        MICmnLLDBDebuggerHandleEvents.h
 //
-// Overview:	CMICmnLLDBDebuggerHandleEvents interface.
+// Overview:    CMICmnLLDBDebuggerHandleEvents interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -33,65 +33,62 @@ class CMICmnStreamStdout;
 class CMICmnMIOutOfBandRecord;
 
 //++ ============================================================================
-// Details:	MI class to take LLDB SBEvent objects, filter them and form
-//			MI Out-of-band records from the information inside the event object.
-//			These records are then pushed to stdout.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 02/03/2014.
-// Changes:	None.
+// Details: MI class to take LLDB SBEvent objects, filter them and form
+//          MI Out-of-band records from the information inside the event object.
+//          These records are then pushed to stdout.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 02/03/2014.
+// Changes: None.
 //--
-class CMICmnLLDBDebuggerHandleEvents 
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmnLLDBDebuggerHandleEvents >
+class CMICmnLLDBDebuggerHandleEvents : public CMICmnBase, public MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>
 {
-	friend class MI::ISingleton< CMICmnLLDBDebuggerHandleEvents >;
+    friend class MI::ISingleton<CMICmnLLDBDebuggerHandleEvents>;
 
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	//
-	bool	HandleEvent( const lldb::SBEvent & vEvent, bool & vrbHandledEvent, bool & vrbExitAppEvent );
-
-// Methods:
-private:
-	/* ctor */	CMICmnLLDBDebuggerHandleEvents( void );
-	/* ctor */	CMICmnLLDBDebuggerHandleEvents( const CMICmnLLDBDebuggerHandleEvents & );
-	void		operator=( const CMICmnLLDBDebuggerHandleEvents & );
-	//
-	bool	ChkForStateChanges( void );
-	bool	GetProcessStdout( void );
-	bool	GetProcessStderr( void );
-	bool	HandleEventSBBreakPoint( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBBreakpointCmn( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBBreakpointAdded( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBBreakpointLocationsAdded( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBProcess( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent );
-	bool	HandleEventSBThread( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBThreadBitStackChanged( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBThreadSuspended( const lldb::SBEvent & vEvent );
-	bool	HandleEventSBCommandInterpreter( const lldb::SBEvent & vEvent );
-	bool	HandleProcessEventBroadcastBitStateChanged( const lldb::SBEvent & vEvent, bool & vrbExitAppEvent );
-	bool	HandleProcessEventStateRunning( void );
-	bool	HandleProcessEventStateExited( void );
-	bool	HandleProcessEventStateStopped( bool & vwrbShouldBrk );
-	bool	HandleProcessEventStopReasonTrace( void );
-	bool	HandleProcessEventStopReasonBreakpoint( void );
-	bool	HandleProcessEventStopSignal( bool & vwrbShouldBrk );
-	bool	HandleProcessEventStateSuspended( const lldb::SBEvent & vEvent );
-	bool	MiHelpGetCurrentThreadFrame( CMICmnMIValueTuple & vwrMiValueTuple );
-	bool	MiResultRecordToStdout( const CMICmnMIResultRecord & vrMiResultRecord );
-	bool	MiOutOfBandRecordToStdout( const CMICmnMIOutOfBandRecord & vrMiResultRecord );
-	bool	MiStoppedAtBreakPoint( const MIuint64 vBrkPtId, const lldb::SBBreakpoint & vBrkPt );
-	bool	TextToStdout( const CMIUtilString & vrTxt );
-	bool	TextToStderr( const CMIUtilString & vrTxt );
-	bool	UpdateSelectedThread( void );
-	bool	ConvertPrintfCtrlCodeToString( const MIchar vCtrl, CMIUtilString & vwrStrEquivalent );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLLDBDebuggerHandleEvents( void );
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    //
+    bool HandleEvent(const lldb::SBEvent &vEvent, bool &vrbHandledEvent, bool &vrbExitAppEvent);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnLLDBDebuggerHandleEvents(void);
+    /* ctor */ CMICmnLLDBDebuggerHandleEvents(const CMICmnLLDBDebuggerHandleEvents &);
+    void operator=(const CMICmnLLDBDebuggerHandleEvents &);
+    //
+    bool ChkForStateChanges(void);
+    bool GetProcessStdout(void);
+    bool GetProcessStderr(void);
+    bool HandleEventSBBreakPoint(const lldb::SBEvent &vEvent);
+    bool HandleEventSBBreakpointCmn(const lldb::SBEvent &vEvent);
+    bool HandleEventSBBreakpointAdded(const lldb::SBEvent &vEvent);
+    bool HandleEventSBBreakpointLocationsAdded(const lldb::SBEvent &vEvent);
+    bool HandleEventSBProcess(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent);
+    bool HandleEventSBThread(const lldb::SBEvent &vEvent);
+    bool HandleEventSBThreadBitStackChanged(const lldb::SBEvent &vEvent);
+    bool HandleEventSBThreadSuspended(const lldb::SBEvent &vEvent);
+    bool HandleEventSBCommandInterpreter(const lldb::SBEvent &vEvent);
+    bool HandleProcessEventBroadcastBitStateChanged(const lldb::SBEvent &vEvent, bool &vrbExitAppEvent);
+    bool HandleProcessEventStateRunning(void);
+    bool HandleProcessEventStateExited(void);
+    bool HandleProcessEventStateStopped(bool &vwrbShouldBrk);
+    bool HandleProcessEventStopReasonTrace(void);
+    bool HandleProcessEventStopReasonBreakpoint(void);
+    bool HandleProcessEventStopSignal(bool &vwrbShouldBrk);
+    bool HandleProcessEventStateSuspended(const lldb::SBEvent &vEvent);
+    bool MiHelpGetCurrentThreadFrame(CMICmnMIValueTuple &vwrMiValueTuple);
+    bool MiResultRecordToStdout(const CMICmnMIResultRecord &vrMiResultRecord);
+    bool MiOutOfBandRecordToStdout(const CMICmnMIOutOfBandRecord &vrMiResultRecord);
+    bool MiStoppedAtBreakPoint(const MIuint64 vBrkPtId, const lldb::SBBreakpoint &vBrkPt);
+    bool TextToStdout(const CMIUtilString &vrTxt);
+    bool TextToStderr(const CMIUtilString &vrTxt);
+    bool UpdateSelectedThread(void);
+    bool ConvertPrintfCtrlCodeToString(const MIchar vCtrl, CMIUtilString &vwrStrEquivalent);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLLDBDebuggerHandleEvents(void);
 };
-

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBProxySBValue.cpp
+// File:        MICmnLLDBProxySBValue.cpp
 //
-// Overview:	CMICmnLLDBProxySBValue implementation.
+// Overview:    CMICmnLLDBProxySBValue implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #include <stdlib.h>
@@ -30,124 +30,125 @@
 #include "MICmnLLDBDebugSessionInfo.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the numerical value from the SBValue object. If the function fails
-//			it could indicate the SBValue object does not represent an internal type.
-// Type:	Static method.
-// Args:	vrValue	- (R) The SBValue object to get a value from.
-//			vwValue	- (W) The numerical value.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Retrieve the numerical value from the SBValue object. If the function fails
+//          it could indicate the SBValue object does not represent an internal type.
+// Type:    Static method.
+// Args:    vrValue - (R) The SBValue object to get a value from.
+//          vwValue - (W) The numerical value.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBProxySBValue::GetValueAsUnsigned( const lldb::SBValue & vrValue, MIuint64 & vwValue )
+bool
+CMICmnLLDBProxySBValue::GetValueAsUnsigned(const lldb::SBValue &vrValue, MIuint64 &vwValue)
 {
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-	bool bCompositeType = true;
-	MIuint64 nFailValue = 0;
-	MIuint64 nValue = rValue.GetValueAsUnsigned( nFailValue );
-	if( nValue == nFailValue )
-	{
-		nFailValue = 5; // Some arbitary number
-		nValue = rValue.GetValueAsUnsigned( nFailValue );
-		if( nValue != nFailValue )
-		{
-			bCompositeType = false;
-			vwValue = nValue;
-		}
-	}
-	else
-	{
-		bCompositeType = false;
-		vwValue = nValue;
-	}
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+    bool bCompositeType = true;
+    MIuint64 nFailValue = 0;
+    MIuint64 nValue = rValue.GetValueAsUnsigned(nFailValue);
+    if (nValue == nFailValue)
+    {
+        nFailValue = 5; // Some arbitary number
+        nValue = rValue.GetValueAsUnsigned(nFailValue);
+        if (nValue != nFailValue)
+        {
+            bCompositeType = false;
+            vwValue = nValue;
+        }
+    }
+    else
+    {
+        bCompositeType = false;
+        vwValue = nValue;
+    }
 
-	return (bCompositeType ? MIstatus::failure : MIstatus::success);
+    return (bCompositeType ? MIstatus::failure : MIstatus::success);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the numerical value from the SBValue object. If the function fails
-//			it could indicate the SBValue object does not represent an internal type.
-// Type:	Static method.
-// Args:	vrValue	- (R) The SBValue object to get a value from.
-//			vwValue	- (W) The numerical value.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
+// Details: Retrieve the numerical value from the SBValue object. If the function fails
+//          it could indicate the SBValue object does not represent an internal type.
+// Type:    Static method.
+// Args:    vrValue - (R) The SBValue object to get a value from.
+//          vwValue - (W) The numerical value.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
 //--
-bool CMICmnLLDBProxySBValue::GetValueAsSigned( const lldb::SBValue & vrValue, MIint64 & vwValue )
+bool
+CMICmnLLDBProxySBValue::GetValueAsSigned(const lldb::SBValue &vrValue, MIint64 &vwValue)
 {
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-	bool bCompositeType = true;
-	MIuint64 nFailValue = 0;
-	MIuint64 nValue = rValue.GetValueAsSigned( nFailValue );
-	if( nValue == nFailValue )
-	{
-		nFailValue = 5; // Some arbitary number
-		nValue = rValue.GetValueAsSigned( nFailValue );
-		if( nValue != nFailValue )
-		{
-			bCompositeType = false;
-			vwValue = nValue;
-		}
-	}
-	else
-	{
-		bCompositeType = false;
-		vwValue = nValue;
-	}
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+    bool bCompositeType = true;
+    MIuint64 nFailValue = 0;
+    MIuint64 nValue = rValue.GetValueAsSigned(nFailValue);
+    if (nValue == nFailValue)
+    {
+        nFailValue = 5; // Some arbitary number
+        nValue = rValue.GetValueAsSigned(nFailValue);
+        if (nValue != nFailValue)
+        {
+            bCompositeType = false;
+            vwValue = nValue;
+        }
+    }
+    else
+    {
+        bCompositeType = false;
+        vwValue = nValue;
+    }
 
-	return (bCompositeType ? MIstatus::failure : MIstatus::success);
+    return (bCompositeType ? MIstatus::failure : MIstatus::success);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the NUL terminated string from the SBValue object if it of the type
-//			unsigned char *. 
-// Type:	Static method.
-// Args:	vrValue		- (R) The SBValue object to get a value from.
-//			vwCString	- (W) The text data '\0' terminated.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed, not suitable type.
-// Throws:	None.
+// Details: Retrieve the NUL terminated string from the SBValue object if it of the type
+//          unsigned char *.
+// Type:    Static method.
+// Args:    vrValue     - (R) The SBValue object to get a value from.
+//          vwCString   - (W) The text data '\0' terminated.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed, not suitable type.
+// Throws:  None.
 //--
-bool CMICmnLLDBProxySBValue::GetCString( const lldb::SBValue & vrValue, CMIUtilString & vwCString )
+bool
+CMICmnLLDBProxySBValue::GetCString(const lldb::SBValue &vrValue, CMIUtilString &vwCString)
 {
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValue );
-	const MIchar * pCType = rValue.GetTypeName();
-	if( pCType == nullptr )
-		return MIstatus::failure;
-	
-	const MIchar * pType = "unsigned char *";
-	if( !CMIUtilString::Compare( pCType, pType ) )
-		return MIstatus::failure;
-
-	const CMIUtilString strAddr( rValue.GetValue() );
-	MIint64 nNum = 0;
-	if( !strAddr.ExtractNumber( nNum ) )
-		return MIstatus::failure;
-
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() );
-	lldb::SBProcess & rProcess = rSessionInfo.m_lldbProcess;
-	MIuint nBufferSize = 64;
-	bool bNeedResize = false;
-	MIchar * pBuffer = static_cast< MIchar * >( ::malloc( nBufferSize ) );
-	do
-	{
-		lldb::SBError error;
-		const size_t nReadSize = rProcess.ReadCStringFromMemory( (lldb::addr_t) nNum, pBuffer, nBufferSize, error );
-		if( nReadSize == (nBufferSize - 1) )
-		{
-			bNeedResize = true;
-			nBufferSize  = nBufferSize << 1;
-			pBuffer = static_cast< MIchar * >( ::realloc( pBuffer, nBufferSize ) );
-		}
-		else
-			bNeedResize = false;
-	} 
-	while( bNeedResize );
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
+    const MIchar *pCType = rValue.GetTypeName();
+    if (pCType == nullptr)
+        return MIstatus::failure;
+
+    const MIchar *pType = "unsigned char *";
+    if (!CMIUtilString::Compare(pCType, pType))
+        return MIstatus::failure;
+
+    const CMIUtilString strAddr(rValue.GetValue());
+    MIint64 nNum = 0;
+    if (!strAddr.ExtractNumber(nNum))
+        return MIstatus::failure;
+
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    lldb::SBProcess &rProcess = rSessionInfo.m_lldbProcess;
+    MIuint nBufferSize = 64;
+    bool bNeedResize = false;
+    MIchar *pBuffer = static_cast<MIchar *>(::malloc(nBufferSize));
+    do
+    {
+        lldb::SBError error;
+        const size_t nReadSize = rProcess.ReadCStringFromMemory((lldb::addr_t)nNum, pBuffer, nBufferSize, error);
+        if (nReadSize == (nBufferSize - 1))
+        {
+            bNeedResize = true;
+            nBufferSize = nBufferSize << 1;
+            pBuffer = static_cast<MIchar *>(::realloc(pBuffer, nBufferSize));
+        }
+        else
+            bNeedResize = false;
+    } while (bNeedResize);
 
-	vwCString = pBuffer;
-	free( (void *) pBuffer );
+    vwCString = pBuffer;
+    free((void *)pBuffer);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBProxySBValue.h
+// File:        MICmnLLDBProxySBValue.h
 //
-// Overview:	CMICmnLLDBProxySBValue interface.
+// Overview:    CMICmnLLDBProxySBValue interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -31,17 +31,17 @@
 class CMIUtilString;
 
 //++ ============================================================================
-// Details:	MI proxy wrapper class to lldb::SBValue. The class provides functionality
-//			to assist in the use of SBValue's parculiar function usage.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 03/04/2014.
-// Changes:	None.
+// Details: MI proxy wrapper class to lldb::SBValue. The class provides functionality
+//          to assist in the use of SBValue's parculiar function usage.
+// Gotchas: None.
+// Authors: Illya Rudkin 03/04/2014.
+// Changes: None.
 //--
 class CMICmnLLDBProxySBValue
 {
-// Statics:
-public:
-	static bool	GetValueAsSigned( const lldb::SBValue & vrValue, MIint64 & vwValue );
-	static bool	GetValueAsUnsigned( const lldb::SBValue & vrValue, MIuint64 & vwValue );
-	static bool GetCString( const lldb::SBValue & vrValue, CMIUtilString & vwCString );
+    // Statics:
+  public:
+    static bool GetValueAsSigned(const lldb::SBValue &vrValue, MIint64 &vwValue);
+    static bool GetValueAsUnsigned(const lldb::SBValue &vrValue, MIuint64 &vwValue);
+    static bool GetCString(const lldb::SBValue &vrValue, CMIUtilString &vwCString);
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBUtilSBValue.cpp
+// File:        MICmnLLDBUtilSBValue.cpp
 //
-// Overview:	CMICmnLLDBUtilSBValue implementation.
+// Overview:    CMICmnLLDBUtilSBValue implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -25,300 +25,312 @@
 #include "MICmnLLDBDebugSessionInfo.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBUtilSBValue constructor.
-// Type:	Method.
-// Args:	vrValue				- (R) The LLDb value object.
-//			vbHandleCharType	- (R) True = Yes return text molding to char type, 
-//									  False = just return data.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBUtilSBValue constructor.
+// Type:    Method.
+// Args:    vrValue             - (R) The LLDb value object.
+//          vbHandleCharType    - (R) True = Yes return text molding to char type,
+//                                    False = just return data.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBUtilSBValue::CMICmnLLDBUtilSBValue( const lldb::SBValue & vrValue, const bool vbHandleCharType /* = false */ )
-:	m_rValue( const_cast< lldb::SBValue & >( vrValue ) )
-,	m_pUnkwn( "??" )
-,	m_bHandleCharType( vbHandleCharType )
+CMICmnLLDBUtilSBValue::CMICmnLLDBUtilSBValue(const lldb::SBValue &vrValue, const bool vbHandleCharType /* = false */)
+    : m_rValue(const_cast<lldb::SBValue &>(vrValue))
+    , m_pUnkwn("??")
+    , m_bHandleCharType(vbHandleCharType)
 {
-	m_bValidSBValue = m_rValue.IsValid();
+    m_bValidSBValue = m_rValue.IsValid();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLLDBUtilSBValue destructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLLDBUtilSBValue destructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLLDBUtilSBValue::~CMICmnLLDBUtilSBValue( void )
+CMICmnLLDBUtilSBValue::~CMICmnLLDBUtilSBValue(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve from the LLDB SB Value object the name of the variable. If the name
-//			is invalid (or the SBValue object invalid) then "??" is returned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- Name of the variable or "??" for unknown.
-// Throws:	None.
+// Details: Retrieve from the LLDB SB Value object the name of the variable. If the name
+//          is invalid (or the SBValue object invalid) then "??" is returned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - Name of the variable or "??" for unknown.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetName( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetName(void) const
 {
-	const MIchar * pName = m_bValidSBValue ? m_rValue.GetName() : nullptr;
-	const CMIUtilString text( (pName != nullptr) ? pName : m_pUnkwn );
-				
-	return text;
+    const MIchar *pName = m_bValidSBValue ? m_rValue.GetName() : nullptr;
+    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);
+
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve from the LLDB SB Value object the value of the variable described in
-//			text. If the value is invalid (or the SBValue object invalid) then "??" is 
-//			returned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- Text description of the variable's value or "??".
-// Throws:	None.
+// Details: Retrieve from the LLDB SB Value object the value of the variable described in
+//          text. If the value is invalid (or the SBValue object invalid) then "??" is
+//          returned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - Text description of the variable's value or "??".
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetValue( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetValue(void) const
 {
-	CMIUtilString text; 
+    CMIUtilString text;
+
+    if (m_bHandleCharType && IsCharType())
+    {
+        const lldb::addr_t addr = m_rValue.GetLoadAddress();
+        text = CMIUtilString::Format("0x%08x", addr);
+        const CMIUtilString cString(GetValueCString());
+        if (!cString.empty())
+            text += CMIUtilString::Format(" %s", cString.c_str());
+    }
+    else
+    {
+        const MIchar *pValue = m_bValidSBValue ? m_rValue.GetValue() : nullptr;
+        text = (pValue != nullptr) ? pValue : m_pUnkwn;
+    }
 
-	if( m_bHandleCharType && IsCharType() )
-	{
-		const lldb::addr_t addr = m_rValue.GetLoadAddress();
-		text = CMIUtilString::Format( "0x%08x", addr );
-		const CMIUtilString cString( GetValueCString() );
-		if( !cString.empty() )
-			text += CMIUtilString::Format( " %s", cString.c_str() );
-	}
-	else
-	{
-		const MIchar * pValue = m_bValidSBValue ? m_rValue.GetValue() : nullptr;
-		text = (pValue != nullptr) ? pValue : m_pUnkwn;
-	}
-	
-	return text;
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	If the LLDB SB Value object is a char type then form the text data string
-//			otherwise return nothing. m_bHandleCharType must be true to return text data
-//			if any.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- Text description of the variable's value.
-// Throws:	None.
+// Details: If the LLDB SB Value object is a char type then form the text data string
+//          otherwise return nothing. m_bHandleCharType must be true to return text data
+//          if any.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - Text description of the variable's value.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetValueCString( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetValueCString(void) const
 {
-	CMIUtilString text; 
+    CMIUtilString text;
+
+    if (m_bHandleCharType && IsCharType())
+    {
+        text = ReadCStringFromHostMemory(m_rValue);
+    }
 
-	if( m_bHandleCharType && IsCharType() )
-	{
-		text = ReadCStringFromHostMemory( m_rValue );
-	}
-	
-	return text;
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the flag stating whether this value object is a char type or some
-//			other type. Char type can be signed or unsigned.
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = Yes is a char type, false = some other type.
-// Throws:	None.
+// Details: Retrieve the flag stating whether this value object is a char type or some
+//          other type. Char type can be signed or unsigned.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = Yes is a char type, false = some other type.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsCharType( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsCharType(void) const
 {
-	const MIchar * pName = m_rValue.GetName(); MIunused( pName );
-	const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
-	return ((eType == lldb::eBasicTypeChar) || 
-		    (eType == lldb::eBasicTypeSignedChar) || 
-			(eType == lldb::eBasicTypeUnsignedChar) );
+    const MIchar *pName = m_rValue.GetName();
+    MIunused(pName);
+    const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
+    return ((eType == lldb::eBasicTypeChar) || (eType == lldb::eBasicTypeSignedChar) || (eType == lldb::eBasicTypeUnsignedChar));
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the flag stating whether any child value object of *this object is a 
-//			char type or some other type. Returns false if there are not children. Char 
-//			type can be signed or unsigned.
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = Yes is a char type, false = some other type.
-// Throws:	None.
+// Details: Retrieve the flag stating whether any child value object of *this object is a
+//          char type or some other type. Returns false if there are not children. Char
+//          type can be signed or unsigned.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = Yes is a char type, false = some other type.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsChildCharType( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsChildCharType(void) const
 {
-	const MIuint nChildren = m_rValue.GetNumChildren();
-	
-	// Is it a basic type
-	if( nChildren == 0 )
-		return false;
+    const MIuint nChildren = m_rValue.GetNumChildren();
 
-	// Is it a composite type
-	if( nChildren > 1 )
-		return false;
+    // Is it a basic type
+    if (nChildren == 0)
+        return false;
 
-	lldb::SBValue member = m_rValue.GetChildAtIndex( 0 );
-	const CMICmnLLDBUtilSBValue utilValue( member );
-	return utilValue.IsCharType();			
+    // Is it a composite type
+    if (nChildren > 1)
+        return false;
+
+    lldb::SBValue member = m_rValue.GetChildAtIndex(0);
+    const CMICmnLLDBUtilSBValue utilValue(member);
+    return utilValue.IsCharType();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the C string data for a child of char type (one and only child) for
-//			the parent value object. If the child is not a char type or the parent has
-//			more than one child then an empty string is returned. Char type can be 
-//			signed or unsigned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- Text description of the variable's value.
-// Throws:	None.
+// Details: Retrieve the C string data for a child of char type (one and only child) for
+//          the parent value object. If the child is not a char type or the parent has
+//          more than one child then an empty string is returned. Char type can be
+//          signed or unsigned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - Text description of the variable's value.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetChildValueCString( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetChildValueCString(void) const
 {
-	CMIUtilString text;
-	const MIuint nChildren = m_rValue.GetNumChildren();
-	
-	// Is it a basic type
-	if( nChildren == 0 )
-		return text;
+    CMIUtilString text;
+    const MIuint nChildren = m_rValue.GetNumChildren();
+
+    // Is it a basic type
+    if (nChildren == 0)
+        return text;
 
-	// Is it a composite type
-	if( nChildren > 1 )
-		return text;
+    // Is it a composite type
+    if (nChildren > 1)
+        return text;
 
-	lldb::SBValue member = m_rValue.GetChildAtIndex( 0 );
-	const CMICmnLLDBUtilSBValue utilValue( member );
-	if( m_bHandleCharType && utilValue.IsCharType() )
-	{
-		text = ReadCStringFromHostMemory( member );
-	}
+    lldb::SBValue member = m_rValue.GetChildAtIndex(0);
+    const CMICmnLLDBUtilSBValue utilValue(member);
+    if (m_bHandleCharType && utilValue.IsCharType())
+    {
+        text = ReadCStringFromHostMemory(member);
+    }
 
-	return text;
+    return text;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the C string data of value object by read the memory where the 
-//			variable is held. 
-// Type:	Method.
-// Args:	vrValueObj	- (R) LLDB SBValue variable object.
-// Return:	CMIUtilString	- Text description of the variable's value.
-// Throws:	None.
+// Details: Retrieve the C string data of value object by read the memory where the
+//          variable is held.
+// Type:    Method.
+// Args:    vrValueObj  - (R) LLDB SBValue variable object.
+// Return:  CMIUtilString   - Text description of the variable's value.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory( const lldb::SBValue & vrValueObj ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory(const lldb::SBValue &vrValueObj) const
 {
-	CMIUtilString text;
+    CMIUtilString text;
+
+    lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValueObj);
+    const lldb::addr_t addr = rValue.GetLoadAddress();
+    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+    const MIuint nBytes(128);
+    const MIchar *pBufferMemory = new MIchar[nBytes];
+    lldb::SBError error;
+    const MIuint64 nReadBytes = rSessionInfo.m_lldbProcess.ReadMemory(addr, (void *)pBufferMemory, nBytes, error);
+    MIunused(nReadBytes);
+    text = CMIUtilString::Format("\\\"%s\\\"", pBufferMemory);
+    delete[] pBufferMemory;
 
-	lldb::SBValue & rValue = const_cast< lldb::SBValue & >( vrValueObj );
-	const lldb::addr_t addr = rValue.GetLoadAddress();
-	CMICmnLLDBDebugSessionInfo & rSessionInfo( CMICmnLLDBDebugSessionInfo::Instance() ); 
-	const MIuint nBytes( 128 );
-	const MIchar * pBufferMemory = new MIchar[ nBytes ];
-	lldb::SBError error;
-	const MIuint64 nReadBytes = rSessionInfo.m_lldbProcess.ReadMemory( addr, (void *) pBufferMemory, nBytes, error ); MIunused( nReadBytes );
-	text = CMIUtilString::Format( "\\\"%s\\\"", pBufferMemory );
-	delete [] pBufferMemory;
-	
-	return text;
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the state of the value object's name. 
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = yes name is indeterminate, false = name is valid.
-// Throws:	None.
+// Details: Retrieve the state of the value object's name.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = yes name is indeterminate, false = name is valid.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsNameUnknown( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsNameUnknown(void) const
 {
-	const CMIUtilString name( GetName() );
-	return (name == m_pUnkwn);
+    const CMIUtilString name(GetName());
+    return (name == m_pUnkwn);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the state of the value object's value data. 
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = yes value is indeterminate, false = value valid.
-// Throws:	None.
+// Details: Retrieve the state of the value object's value data.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = yes value is indeterminate, false = value valid.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsValueUnknown( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsValueUnknown(void) const
 {
-	const CMIUtilString value( GetValue() );
-	return (value == m_pUnkwn);
+    const CMIUtilString value(GetValue());
+    return (value == m_pUnkwn);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the value object's type name if valid.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- The type name or "??".
-// Throws:	None.
+// Details: Retrieve the value object's type name if valid.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - The type name or "??".
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetTypeName( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetTypeName(void) const
 {
-	const MIchar * pName = m_bValidSBValue ? m_rValue.GetTypeName() : nullptr;
-	const CMIUtilString text( (pName != nullptr) ? pName : m_pUnkwn );
-				
-	return text;
+    const MIchar *pName = m_bValidSBValue ? m_rValue.GetTypeName() : nullptr;
+    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);
+
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the value object's display type name if valid. 
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString	- The type name or "??".
-// Throws:	None.
+// Details: Retrieve the value object's display type name if valid.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString   - The type name or "??".
+// Throws:  None.
 //--
-CMIUtilString CMICmnLLDBUtilSBValue::GetTypeNameDisplay( void ) const
+CMIUtilString
+CMICmnLLDBUtilSBValue::GetTypeNameDisplay(void) const
 {
-	const MIchar * pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
-	const CMIUtilString text( (pName != nullptr) ? pName : m_pUnkwn );
-				
-	return text;
+    const MIchar *pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
+    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);
+
+    return text;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve whether the value object's is valid or not. 
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = valid, false = not valid.
-// Throws:	None.
+// Details: Retrieve whether the value object's is valid or not.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = valid, false = not valid.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsValid( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsValid(void) const
 {
-	return m_bValidSBValue;
+    return m_bValidSBValue;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the value object' has a name. A value object can be valid but still
-//			have no name which suggest it is not a variable. 
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = valid, false = not valid.
-// Throws:	None.
+// Details: Retrieve the value object' has a name. A value object can be valid but still
+//          have no name which suggest it is not a variable.
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = valid, false = not valid.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::HasName( void ) const
+bool
+CMICmnLLDBUtilSBValue::HasName(void) const
 {
-	bool bHasAName = false;
+    bool bHasAName = false;
 
-	const MIchar * pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
-	if( pName != nullptr )
-	{
-		bHasAName = (CMIUtilString( pName ).length() > 0);
-	}
+    const MIchar *pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
+    if (pName != nullptr)
+    {
+        bHasAName = (CMIUtilString(pName).length() > 0);
+    }
 
-	return bHasAName;
+    return bHasAName;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if the value object' respresents a LLDB variable i.e. "$0".
-// Type:	Method.
-// Args:	None.
-// Return:	bool	- True = Yes LLDB variable, false = no.
-// Throws:	None.
+// Details: Determine if the value object' respresents a LLDB variable i.e. "$0".
+// Type:    Method.
+// Args:    None.
+// Return:  bool    - True = Yes LLDB variable, false = no.
+// Throws:  None.
 //--
-bool CMICmnLLDBUtilSBValue::IsLLDBVariable( void ) const
+bool
+CMICmnLLDBUtilSBValue::IsLLDBVariable(void) const
 {
-	return (GetName().at( 0 ) == '$' );
+    return (GetName().at(0) == '$');
 }
-	
-

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLLDBUtilSBValue.h
+// File:        MICmnLLDBUtilSBValue.h
 //
-// Overview:	CMICmnLLDBUtilSBValue interface.
+// Overview:    CMICmnLLDBUtilSBValue interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -31,41 +31,41 @@
 class CMIUtilString;
 
 //++ ============================================================================
-// Details:	Utility helper class to lldb::SBValue. Using a lldb::SBValue extract
-//			value object information to help form verbose debug information.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 08/07/2014.
-// Changes:	None.
+// Details: Utility helper class to lldb::SBValue. Using a lldb::SBValue extract
+//          value object information to help form verbose debug information.
+// Gotchas: None.
+// Authors: Illya Rudkin 08/07/2014.
+// Changes: None.
 //--
 class CMICmnLLDBUtilSBValue
 {
-// Methods:
-public:
-	/* ctor */	CMICmnLLDBUtilSBValue( const lldb::SBValue & vrValue, const bool vbHandleCharType = false );
-	/* dtor */	~CMICmnLLDBUtilSBValue( void );
-	//
-	CMIUtilString	GetName( void ) const;
-	CMIUtilString	GetValue( void ) const;
-	CMIUtilString	GetValueCString( void ) const;
-	CMIUtilString	GetChildValueCString( void ) const;
-	CMIUtilString	GetTypeName( void ) const;
-	CMIUtilString	GetTypeNameDisplay( void ) const;
-	bool			IsCharType( void ) const;
-	bool			IsChildCharType( void ) const;
-	bool			IsLLDBVariable( void ) const;
-	bool			IsNameUnknown( void ) const;
-	bool			IsValueUnknown( void ) const;
-	bool			IsValid( void ) const;
-	bool			HasName( void ) const;
-
-// Methods:
-private:
-	CMIUtilString	ReadCStringFromHostMemory( const lldb::SBValue & vrValueObj ) const;
-
-// Attributes:
-private:
-	lldb::SBValue & m_rValue;
-	const MIchar *	m_pUnkwn;
-	bool			m_bValidSBValue;	// True = SBValue is a valid object, false = not valid.
-	bool			m_bHandleCharType;	// True = Yes return text molding to char type, false = just return data.
+    // Methods:
+  public:
+    /* ctor */ CMICmnLLDBUtilSBValue(const lldb::SBValue &vrValue, const bool vbHandleCharType = false);
+    /* dtor */ ~CMICmnLLDBUtilSBValue(void);
+    //
+    CMIUtilString GetName(void) const;
+    CMIUtilString GetValue(void) const;
+    CMIUtilString GetValueCString(void) const;
+    CMIUtilString GetChildValueCString(void) const;
+    CMIUtilString GetTypeName(void) const;
+    CMIUtilString GetTypeNameDisplay(void) const;
+    bool IsCharType(void) const;
+    bool IsChildCharType(void) const;
+    bool IsLLDBVariable(void) const;
+    bool IsNameUnknown(void) const;
+    bool IsValueUnknown(void) const;
+    bool IsValid(void) const;
+    bool HasName(void) const;
+
+    // Methods:
+  private:
+    CMIUtilString ReadCStringFromHostMemory(const lldb::SBValue &vrValueObj) const;
+
+    // Attributes:
+  private:
+    lldb::SBValue &m_rValue;
+    const MIchar *m_pUnkwn;
+    bool m_bValidSBValue;   // True = SBValue is a valid object, false = not valid.
+    bool m_bHandleCharType; // True = Yes return text molding to char type, false = just return data.
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLog.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLog.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLog.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLog.cpp
+// File:        MICmnLog.cpp
 //
-// Overview:	CMICmnLog implementation.
+// Overview:    CMICmnLog implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -27,329 +27,344 @@
 #include "MIUtilDateTimeStd.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLog constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLog constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLog::CMICmnLog( void )
-:	m_bEnabled( false )
-,	m_bInitializingATM( false )
+CMICmnLog::CMICmnLog(void)
+    : m_bEnabled(false)
+    , m_bInitializingATM(false)
 {
-	// Do not use this constructor, use Initialize()
+    // Do not use this constructor, use Initialize()
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLog destructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLog destructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLog::~CMICmnLog( void )
+CMICmnLog::~CMICmnLog(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Logger.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize resources for *this Logger.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::Initialize( void )
+bool
+CMICmnLog::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	ClrErrorDescription();
+    ClrErrorDescription();
 
-	// Mediums set inside because explicitly initing in MIDriverMain.cpp causes compile errors with CAtlFile
-	CMICmnLogMediumFile & rFileLog( CMICmnLogMediumFile::Instance() );		
-	bool bOk = RegisterMedium( rFileLog );
-	bOk = bOk && SetEnabled( true );
-	if( bOk ) 
-	{
-		// Set the Log trace file's header
-		const CMIUtilString & rCR( rFileLog.GetLineReturn() );
-		CMIUtilDateTimeStd date;
-		CMIUtilString msg;
-		msg = CMIUtilString::Format( "%s\n", CMIDriverMgr::Instance().GetAppVersion().c_str() );
-		CMIUtilString logHdr( msg );
-		msg = CMIUtilString::Format( MIRSRC( IDS_LOG_MSG_CREATION_DATE ), date.GetDate().c_str(), date.GetTime().c_str(), rCR.c_str() );
-		logHdr += msg;
-		msg = CMIUtilString::Format( MIRSRC( IDS_LOG_MSG_FILE_LOGGER_PATH ), rFileLog.GetFileNamePath().c_str(), rCR.c_str() );
-		logHdr += msg;
-		
-		bOk = rFileLog.SetHeaderTxt( logHdr );
+    // Mediums set inside because explicitly initing in MIDriverMain.cpp causes compile errors with CAtlFile
+    CMICmnLogMediumFile &rFileLog(CMICmnLogMediumFile::Instance());
+    bool bOk = RegisterMedium(rFileLog);
+    bOk = bOk && SetEnabled(true);
+    if (bOk)
+    {
+        // Set the Log trace file's header
+        const CMIUtilString &rCR(rFileLog.GetLineReturn());
+        CMIUtilDateTimeStd date;
+        CMIUtilString msg;
+        msg = CMIUtilString::Format("%s\n", CMIDriverMgr::Instance().GetAppVersion().c_str());
+        CMIUtilString logHdr(msg);
+        msg = CMIUtilString::Format(MIRSRC(IDS_LOG_MSG_CREATION_DATE), date.GetDate().c_str(), date.GetTime().c_str(), rCR.c_str());
+        logHdr += msg;
+        msg = CMIUtilString::Format(MIRSRC(IDS_LOG_MSG_FILE_LOGGER_PATH), rFileLog.GetFileNamePath().c_str(), rCR.c_str());
+        logHdr += msg;
 
-		// Note log file medium's status is not available until we write at least once to the file (so just write the title 1st line)
-		m_bInitializingATM = true;
-		CMICmnLog::WriteLog( "." );
-		if( !rFileLog.IsOk() )
-		{
-			const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_LOG_ERR_FILE_LOGGER_DISABLED ), rFileLog.GetErrorDescription().c_str() ) );
-			CMICmnLog::WriteLog( msg );
-		}
-		m_bInitializingATM = false;
-	}
+        bOk = rFileLog.SetHeaderTxt(logHdr);
 
-	m_bInitialized = bOk;
+        // Note log file medium's status is not available until we write at least once to the file (so just write the title 1st line)
+        m_bInitializingATM = true;
+        CMICmnLog::WriteLog(".");
+        if (!rFileLog.IsOk())
+        {
+            const CMIUtilString msg(
+                CMIUtilString::Format(MIRSRC(IDS_LOG_ERR_FILE_LOGGER_DISABLED), rFileLog.GetErrorDescription().c_str()));
+            CMICmnLog::WriteLog(msg);
+        }
+        m_bInitializingATM = false;
+    }
 
-	return  bOk;
+    m_bInitialized = bOk;
+
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Logger.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this Logger.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::Shutdown( void )
+bool
+CMICmnLog::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    ClrErrorDescription();
 
-	ClrErrorDescription();
+    const bool bOk = UnregisterMediumAll();
 
-	const bool bOk = UnregisterMediumAll();
-	
-	m_bInitialized = bOk;
-		
-	return bOk;
-}	
+    m_bInitialized = bOk;
+
+    return bOk;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Enabled or disable *this Logger from writing any data to registered clients.
-// Type:	Method.
-// Args:	vbYes	- (R) True = Logger enabled, false = disabled.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Enabled or disable *this Logger from writing any data to registered clients.
+// Type:    Method.
+// Args:    vbYes   - (R) True = Logger enabled, false = disabled.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::SetEnabled( const bool vbYes )
+bool
+CMICmnLog::SetEnabled(const bool vbYes)
 {
-	m_bEnabled = vbYes;
+    m_bEnabled = vbYes;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve state whether *this Logger is enabled writing data to registered clients.
-// Type:	Method.
-// Args:	None.
-// Return:	True = Logger enable.
-//			False = disabled.
-// Throws:	None.
+// Details: Retrieve state whether *this Logger is enabled writing data to registered clients.
+// Type:    Method.
+// Args:    None.
+// Return:  True = Logger enable.
+//          False = disabled.
+// Throws:  None.
 //--
-bool CMICmnLog::GetEnabled( void ) const
+bool
+CMICmnLog::GetEnabled(void) const
 {
-	return m_bEnabled;
+    return m_bEnabled;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Unregister all the Mediums registered with *this Logger.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Unregister all the Mediums registered with *this Logger.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::UnregisterMediumAll( void )
+bool
+CMICmnLog::UnregisterMediumAll(void)
 {
-	MapMediumToName_t::const_iterator it = m_mapMediumToName.begin();
-	for( ; it != m_mapMediumToName.end( ); it++ )
-	{
-		IMedium * pMedium = (*it).first;
-		pMedium->Shutdown();
-	}
+    MapMediumToName_t::const_iterator it = m_mapMediumToName.begin();
+    for (; it != m_mapMediumToName.end(); it++)
+    {
+        IMedium *pMedium = (*it).first;
+        pMedium->Shutdown();
+    }
 
-	m_mapMediumToName.clear();
-	
-	return MIstatus::success;
+    m_mapMediumToName.clear();
+
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Register a Medium with *this Logger. 
-// Type:	Method.
-// Args:	vrMedium	- (R) The medium to register.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Register a Medium with *this Logger.
+// Type:    Method.
+// Args:    vrMedium    - (R) The medium to register.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::RegisterMedium( const IMedium & vrMedium )
+bool
+CMICmnLog::RegisterMedium(const IMedium &vrMedium)
 {
-	if( HaveMediumAlready( vrMedium ) )
-		return MIstatus::success;
+    if (HaveMediumAlready(vrMedium))
+        return MIstatus::success;
 
-	IMedium * pMedium = const_cast< IMedium * >( &vrMedium );
-	if( !pMedium->Initialize() )
-	{
-		const CMIUtilString & rStrMedName( pMedium->GetName() );
-		const CMIUtilString & rStrMedErr( pMedium->GetError() );
-		SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_LOG_MEDIUM_ERR_INIT ), rStrMedName.c_str(), rStrMedErr.c_str() ) );
-		return MIstatus::failure;
-	}
+    IMedium *pMedium = const_cast<IMedium *>(&vrMedium);
+    if (!pMedium->Initialize())
+    {
+        const CMIUtilString &rStrMedName(pMedium->GetName());
+        const CMIUtilString &rStrMedErr(pMedium->GetError());
+        SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_LOG_MEDIUM_ERR_INIT), rStrMedName.c_str(), rStrMedErr.c_str()));
+        return MIstatus::failure;
+    }
 
-	MapPairMediumToName_t pr( pMedium, pMedium->GetName() );
-	m_mapMediumToName.insert( pr );
+    MapPairMediumToName_t pr(pMedium, pMedium->GetName());
+    m_mapMediumToName.insert(pr);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Query the Logger to see if a medium is already registered.
-// Type:	Method.
-// Args:	vrMedium	- (R) The medium to query.
-// Return:	True - registered.
-//			False - not registered.
-// Throws:	None.
+// Details: Query the Logger to see if a medium is already registered.
+// Type:    Method.
+// Args:    vrMedium    - (R) The medium to query.
+// Return:  True - registered.
+//          False - not registered.
+// Throws:  None.
 //--
-bool CMICmnLog::HaveMediumAlready( const IMedium & vrMedium ) const
+bool
+CMICmnLog::HaveMediumAlready(const IMedium &vrMedium) const
 {
-	IMedium * pMedium = const_cast< IMedium * >( &vrMedium );
-	const MapMediumToName_t::const_iterator it = m_mapMediumToName.find( pMedium );
-	if( it != m_mapMediumToName.end() )
-		return true;
+    IMedium *pMedium = const_cast<IMedium *>(&vrMedium);
+    const MapMediumToName_t::const_iterator it = m_mapMediumToName.find(pMedium);
+    if (it != m_mapMediumToName.end())
+        return true;
 
-	return false;
+    return false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Unregister a medium from the Logger.
-// Type:	Method.
-// Args:	vrMedium	- (R) The medium to unregister.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Unregister a medium from the Logger.
+// Type:    Method.
+// Args:    vrMedium    - (R) The medium to unregister.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::UnregisterMedium( const IMedium & vrMedium )
+bool
+CMICmnLog::UnregisterMedium(const IMedium &vrMedium)
 {
-	IMedium * pMedium = const_cast< IMedium * >( &vrMedium );
-	m_mapMediumToName.erase( pMedium );
+    IMedium *pMedium = const_cast<IMedium *>(&vrMedium);
+    m_mapMediumToName.erase(pMedium);
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	The callee client uses this function to write to the Logger. The data to be
-//			written is given out to all the mediums registered. The verbosity type parameter 
-//			indicates to the medium(s) the type of data or message given to it. The medium has
-//			modes of verbosity and depending on the verbosity set determines which writes 
-//			go in to the logger.
-//			The logger must be initialized successfully before a write to any registered 
-//			can be carried out.
-// Type:	Method.
-// Args:	vData		- (R) The data to write to the logger.
-//			veType		- (R) Verbosity type.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: The callee client uses this function to write to the Logger. The data to be
+//          written is given out to all the mediums registered. The verbosity type parameter
+//          indicates to the medium(s) the type of data or message given to it. The medium has
+//          modes of verbosity and depending on the verbosity set determines which writes
+//          go in to the logger.
+//          The logger must be initialized successfully before a write to any registered
+//          can be carried out.
+// Type:    Method.
+// Args:    vData       - (R) The data to write to the logger.
+//          veType      - (R) Verbosity type.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::Write( const CMIUtilString & vData, const ELogVerbosity veType )
+bool
+CMICmnLog::Write(const CMIUtilString &vData, const ELogVerbosity veType)
 {
-	if( !m_bInitialized && !m_bInitializingATM )
-		return MIstatus::success;
-	if( m_bRecursiveDive )
-		return MIstatus::success;
-	if( !m_bEnabled )
-		return MIstatus::success;
+    if (!m_bInitialized && !m_bInitializingATM)
+        return MIstatus::success;
+    if (m_bRecursiveDive)
+        return MIstatus::success;
+    if (!m_bEnabled)
+        return MIstatus::success;
+
+    m_bRecursiveDive = true;
+
+    MIuint cnt = 0;
+    MIuint cntErr = 0;
+    {
+        MapMediumToName_t::const_iterator it = m_mapMediumToName.begin();
+        while (it != m_mapMediumToName.end())
+        {
+            IMedium *pMedium = (*it).first;
+            const CMIUtilString &rNameMedium = (*it).second;
+            MIunused(rNameMedium);
+            if (pMedium->Write(vData, veType))
+                cnt++;
+            else
+                cntErr++;
+
+            // Next
+            ++it;
+        }
+    }
 
-	m_bRecursiveDive = true;
-		
-	MIuint cnt = 0;
-	MIuint cntErr = 0;
-	{
-		MapMediumToName_t::const_iterator it = m_mapMediumToName.begin();
-		while( it != m_mapMediumToName.end() )
-		{
-			IMedium * pMedium = (*it).first;
-			const CMIUtilString & rNameMedium = (*it).second; MIunused( rNameMedium );
-			if( pMedium->Write( vData, veType ) )
-				cnt++;
-			else
-				cntErr++;
-			
-			// Next
-			++it;
-		}
-	}
+    bool bOk = MIstatus::success;
+    const MIuint mediumCnt = m_mapMediumToName.size();
+    if ((cnt == 0) && (mediumCnt > 0))
+    {
+        SetErrorDescription(MIRSRC(IDS_LOG_MEDIUM_ERR_WRITE_ANY));
+        bOk = MIstatus::failure;
+    }
+    if (bOk && (cntErr != 0))
+    {
+        SetErrorDescription(MIRSRC(IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL));
+        bOk = MIstatus::failure;
+    }
 
-	bool bOk = MIstatus::success;
-	const MIuint mediumCnt = m_mapMediumToName.size();
-	if( (cnt == 0) && (mediumCnt > 0) )
-	{
-		SetErrorDescription( MIRSRC( IDS_LOG_MEDIUM_ERR_WRITE_ANY ) );
-		bOk = MIstatus::failure;
-	}
-	if( bOk && (cntErr != 0) )
-	{
-		SetErrorDescription( MIRSRC( IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL ) );
-		bOk = MIstatus::failure;
-	}
-	
-	m_bRecursiveDive = false;
+    m_bRecursiveDive = false;
 
-	return bOk;
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Short cut function call to write only to the Log file.
-//			The logger must be initialized successfully before a write to any registered 
-//			can be carried out.
-// Type:	Static.
-// Args:	vData	- (R) The data to write to the logger.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Short cut function call to write only to the Log file.
+//          The logger must be initialized successfully before a write to any registered
+//          can be carried out.
+// Type:    Static.
+// Args:    vData   - (R) The data to write to the logger.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLog::WriteLog( const CMIUtilString & vData )
+bool
+CMICmnLog::WriteLog(const CMIUtilString &vData)
 {
-	return CMICmnLog::Instance().Write( vData, CMICmnLog::eLogVerbosity_Log );
+    return CMICmnLog::Instance().Write(vData, CMICmnLog::eLogVerbosity_Log);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve a string detailing the last error.
-// Type:	Method.
-// Args:	None,
-// Return:	CMIUtilString.
-// Throws:	None.
+// Details: Retrieve a string detailing the last error.
+// Type:    Method.
+// Args:    None,
+// Return:  CMIUtilString.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLog::GetErrorDescription( void ) const
+const CMIUtilString &
+CMICmnLog::GetErrorDescription(void) const
 {
-	return m_strMILastErrorDescription;
+    return m_strMILastErrorDescription;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the internal description of the last error.
-// Type:	Method.
-// Args:	(R)	String containing a description of the last error.
-// Return:	None.
-// Throws:	None.
+// Details: Set the internal description of the last error.
+// Type:    Method.
+// Args:    (R) String containing a description of the last error.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnLog::SetErrorDescription( const CMIUtilString & vrTxt ) const
+void
+CMICmnLog::SetErrorDescription(const CMIUtilString &vrTxt) const
 {
-	m_strMILastErrorDescription = vrTxt;
+    m_strMILastErrorDescription = vrTxt;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Clear the last error.
-// Type:	None.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: Clear the last error.
+// Type:    None.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnLog::ClrErrorDescription( void ) const
+void
+CMICmnLog::ClrErrorDescription(void) const
 {
-	m_strMILastErrorDescription = CMIUtilString( "" );
+    m_strMILastErrorDescription = CMIUtilString("");
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnLog.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLog.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLog.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLog.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLog.h
+// File:        MICmnLog.h
 //
-// Overview:	CMICmnLog interface.
+// Overview:    CMICmnLog interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -30,114 +30,114 @@
 #include "MIUtilSingletonBase.h"
 
 //++ ============================================================================
-// Details:	MI common code implementation class. Handle application trace 
-//			activity logging. Medium objects derived from the Medium abstract 
-///			class are registered with this loggor. The function Write is called 
-//			by a client callee to log information. That information is given to
-//			registered relevant mediums. The medium file is registered during 
-//			*this logs initialization so it will always have a file log for the
-//			application.
-//			Singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 01/02/2012.
-// Changes:	None.
+// Details: MI common code implementation class. Handle application trace
+//          activity logging. Medium objects derived from the Medium abstract
+///          class are registered with this loggor. The function Write is called
+//          by a client callee to log information. That information is given to
+//          registered relevant mediums. The medium file is registered during
+//          *this logs initialization so it will always have a file log for the
+//          application.
+//          Singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 01/02/2012.
+// Changes: None.
 //--
-class CMICmnLog : public MI::ISingleton< CMICmnLog >
+class CMICmnLog : public MI::ISingleton<CMICmnLog>
 {
-	friend MI::ISingleton< CMICmnLog >;
+    friend MI::ISingleton<CMICmnLog>;
 
-// Enumeration:
-public:
-	//++
-	// Description: Data given to the Logger can be of serveral types. The Logger can be
-	//				set at levels of verbosity. Can determine how data is sent to one or
-	//				mediums.
-	//--
-	enum ELogVerbosity
-	{											// Descriptions of what 'may' occur, depends ultimately on the medium itself. See the medium.
-		eLogVerbosity_FnTrace	= 0x00000004,	// Debug function stack call tracing
-		eLogVerbosity_DbgOp		= 0x00000008,	// Send a string to the debugguer for display (not implemented)
-		eLogVerbosity_ClientMsg	= 0x00000010,	// A client using MI can insert messages into the log (not implemented)
-		eLogVerbosity_Log		= 0x00000020	// Send to only the Log file.
-	};
-
-// Class:
-public:
-	//++
-	// Description: Register a medium derived from this interface which will be
-	//				called writing log trace data i.e. a file or a console. 
-	//				Medium objects registered are not owned by *this logger.
-	//--
-	class IMedium
-	{
-	public:
-		virtual bool					Initialize( void ) = 0;
-		virtual const CMIUtilString &	GetName( void ) const = 0;
-		virtual bool					Write( const CMIUtilString & vData, const ELogVerbosity veType ) = 0;
-		virtual const CMIUtilString &	GetError( void ) const = 0;
-		virtual bool					Shutdown( void ) = 0;
-
-		// Not part of the interface, ignore
-		//AD:	This virtual destructor seems to hit a bug in the stdlib
-		//		where vector delete is incorrectly called.  Workaround is
-		//		to comment this out while I investigate.
-		/* dtor */ virtual ~IMedium( void ) {}
-	};
-
-// Statics:
-public:
-	static	bool WriteLog( const CMIUtilString & vData );
-
-// Methods:
-public:
-	bool	RegisterMedium( const IMedium & vrMedium );
-	bool	UnregisterMedium( const IMedium & vrMedium ); 
-	bool	Write( const CMIUtilString & vData, const ELogVerbosity veType );
-	bool	SetEnabled( const bool vbYes );
-	bool	GetEnabled( void ) const;
-	
-	// MI common object handling - duplicate of CMICmnBase functions, necessary for LINUX build
-	// Done to stop locking on object construction init circular dependency.
-	const CMIUtilString &	GetErrorDescription( void ) const;
-	void					SetErrorDescription( const CMIUtilString & vrTxt ) const;
-	void					ClrErrorDescription( void ) const;
-
-// Overridden:
-public:
-	// From MI::ISingleton
-	virtual bool	Initialize( void );
-	virtual bool	Shutdown( void );
-
-// Methods:
-private:
-	/* ctor */	CMICmnLog( void );
-	/* ctor */	CMICmnLog( const CMICmnLog & );
-	void		operator=( const CMICmnLog & );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLog( void );
-
-// Typedef:
-private:
-	typedef std::map< IMedium *, CMIUtilString >	MapMediumToName_t;
-	typedef std::pair< IMedium *, CMIUtilString >	MapPairMediumToName_t;
-
-// Methods:
-private:
-	bool	HaveMediumAlready( const IMedium & vrMedium ) const;
-	bool	UnregisterMediumAll( void ); 
-	
-// Attributes:
-private:
-	bool				m_bRecursiveDive;				// True = yes recursive, false = no
-	MapMediumToName_t	m_mapMediumToName;
-	bool				m_bEnabled;						// True = Logger enabled for writing to mediums, false = medium not written to
-	bool				m_bInitializingATM;				// True = Yes in process of initing *this logger, false = not initing
-	//
-	// MI common object handling - duplicate of CMICmnBase functions, necessary for LINUX build
-	bool					m_bInitialized;					// True = yes successfully initialized, false = no yet or failed
-	mutable CMIUtilString	m_strMILastErrorDescription;
-	MIint					m_clientUsageRefCnt;			// Count of client using *this object so not shutdown() object to early
+    // Enumeration:
+  public:
+    //++
+    // Description: Data given to the Logger can be of serveral types. The Logger can be
+    //              set at levels of verbosity. Can determine how data is sent to one or
+    //              mediums.
+    //--
+    enum ELogVerbosity
+    {                                         // Descriptions of what 'may' occur, depends ultimately on the medium itself. See the medium.
+        eLogVerbosity_FnTrace = 0x00000004,   // Debug function stack call tracing
+        eLogVerbosity_DbgOp = 0x00000008,     // Send a string to the debugguer for display (not implemented)
+        eLogVerbosity_ClientMsg = 0x00000010, // A client using MI can insert messages into the log (not implemented)
+        eLogVerbosity_Log = 0x00000020        // Send to only the Log file.
+    };
+
+    // Class:
+  public:
+    //++
+    // Description: Register a medium derived from this interface which will be
+    //              called writing log trace data i.e. a file or a console.
+    //              Medium objects registered are not owned by *this logger.
+    //--
+    class IMedium
+    {
+      public:
+        virtual bool Initialize(void) = 0;
+        virtual const CMIUtilString &GetName(void) const = 0;
+        virtual bool Write(const CMIUtilString &vData, const ELogVerbosity veType) = 0;
+        virtual const CMIUtilString &GetError(void) const = 0;
+        virtual bool Shutdown(void) = 0;
+
+        // Not part of the interface, ignore
+        // AD:  This virtual destructor seems to hit a bug in the stdlib
+        //      where vector delete is incorrectly called.  Workaround is
+        //      to comment this out while I investigate.
+        /* dtor */ virtual ~IMedium(void) {}
+    };
+
+    // Statics:
+  public:
+    static bool WriteLog(const CMIUtilString &vData);
+
+    // Methods:
+  public:
+    bool RegisterMedium(const IMedium &vrMedium);
+    bool UnregisterMedium(const IMedium &vrMedium);
+    bool Write(const CMIUtilString &vData, const ELogVerbosity veType);
+    bool SetEnabled(const bool vbYes);
+    bool GetEnabled(void) const;
+
+    // MI common object handling - duplicate of CMICmnBase functions, necessary for LINUX build
+    // Done to stop locking on object construction init circular dependency.
+    const CMIUtilString &GetErrorDescription(void) const;
+    void SetErrorDescription(const CMIUtilString &vrTxt) const;
+    void ClrErrorDescription(void) const;
+
+    // Overridden:
+  public:
+    // From MI::ISingleton
+    virtual bool Initialize(void);
+    virtual bool Shutdown(void);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnLog(void);
+    /* ctor */ CMICmnLog(const CMICmnLog &);
+    void operator=(const CMICmnLog &);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLog(void);
+
+    // Typedef:
+  private:
+    typedef std::map<IMedium *, CMIUtilString> MapMediumToName_t;
+    typedef std::pair<IMedium *, CMIUtilString> MapPairMediumToName_t;
+
+    // Methods:
+  private:
+    bool HaveMediumAlready(const IMedium &vrMedium) const;
+    bool UnregisterMediumAll(void);
+
+    // Attributes:
+  private:
+    bool m_bRecursiveDive; // True = yes recursive, false = no
+    MapMediumToName_t m_mapMediumToName;
+    bool m_bEnabled;         // True = Logger enabled for writing to mediums, false = medium not written to
+    bool m_bInitializingATM; // True = Yes in process of initing *this logger, false = not initing
+    //
+    // MI common object handling - duplicate of CMICmnBase functions, necessary for LINUX build
+    bool m_bInitialized; // True = yes successfully initialized, false = no yet or failed
+    mutable CMIUtilString m_strMILastErrorDescription;
+    MIint m_clientUsageRefCnt; // Count of client using *this object so not shutdown() object to early
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp Mon Nov 17 12:06:21 2014
@@ -8,413 +8,433 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLogMediumFile.cpp
+// File:        MICmnLogMediumFile.cpp
 //
-// Overview:	CMICmnLogMediumFile implementation.
+// Overview:    CMICmnLogMediumFile implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
 #include "MICmnLogMediumFile.h"
 #include "MICmnResources.h"
-#if defined( _MSC_VER )
-	#include "MIUtilSystemWindows.h"
-#elif defined( __FreeBSD__ ) || defined( __linux__ )
-	#include "MIUtilSystemLinux.h"
-#elif defined( __APPLE__ )
-	#include "MIUtilSystemOsx.h"
+#if defined(_MSC_VER)
+#include "MIUtilSystemWindows.h"
+#elif defined(__FreeBSD__) || defined(__linux__)
+#include "MIUtilSystemLinux.h"
+#elif defined(__APPLE__)
+#include "MIUtilSystemOsx.h"
 #endif // defined( _MSC_VER )
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLogMediumFile constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLogMediumFile constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLogMediumFile::CMICmnLogMediumFile( void )
-:	m_constThisMediumName( MIRSRC( IDS_MEDIUMFILE_NAME ) )
-,	m_constMediumFileName( "lldb-mi-log.txt" )
-,	m_fileNamePath( MIRSRC( IDS_MEDIUMFILE_ERR_INVALID_PATH ) )
-,	m_eVerbosityType( CMICmnLog::eLogVerbosity_Log )
-,	m_strDate( CMIUtilDateTimeStd().GetDate() )
-,	m_fileHeaderTxt( MIRSRC( IDS_MEDIUMFILE_ERR_FILE_HEADER ) )
+CMICmnLogMediumFile::CMICmnLogMediumFile(void)
+    : m_constThisMediumName(MIRSRC(IDS_MEDIUMFILE_NAME))
+    , m_constMediumFileName("lldb-mi-log.txt")
+    , m_fileNamePath(MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH))
+    , m_eVerbosityType(CMICmnLog::eLogVerbosity_Log)
+    , m_strDate(CMIUtilDateTimeStd().GetDate())
+    , m_fileHeaderTxt(MIRSRC(IDS_MEDIUMFILE_ERR_FILE_HEADER))
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnLogMediumFile destructor.
-// Type:	Overridden.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnLogMediumFile destructor.
+// Type:    Overridden.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnLogMediumFile::~CMICmnLogMediumFile( void )
+CMICmnLogMediumFile::~CMICmnLogMediumFile(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Get the singleton instance of *this class.
-// Type:	Static.
-// Args:	None.
-// Return:	CMICmnLogMediumFile - Reference to *this object.
-// Throws:	None.
+// Details: Get the singleton instance of *this class.
+// Type:    Static.
+// Args:    None.
+// Return:  CMICmnLogMediumFile - Reference to *this object.
+// Throws:  None.
 //--
-CMICmnLogMediumFile & CMICmnLogMediumFile::Instance( void )
+CMICmnLogMediumFile &
+CMICmnLogMediumFile::Instance(void)
 {
-	static CMICmnLogMediumFile instance;
+    static CMICmnLogMediumFile instance;
 
-	return instance;
+    return instance;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize setup *this medium ready for use.
-// Type:	Overridden.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize setup *this medium ready for use.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::Initialize( void )
+bool
+CMICmnLogMediumFile::Initialize(void)
 {
-	m_bInitialized = FileFormFileNamePath();
-	
-	return m_bInitialized;
+    m_bInitialized = FileFormFileNamePath();
+
+    return m_bInitialized;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Unbind detach or release resources used by *this medium.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: Unbind detach or release resources used by *this medium.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::Shutdown( void )
+bool
+CMICmnLogMediumFile::Shutdown(void)
 {
-	if( m_bInitialized )
-	{
-		m_bInitialized = false;
-		m_file.Close();
-	}
-	return MIstatus::success;
+    if (m_bInitialized)
+    {
+        m_bInitialized = false;
+        m_file.Close();
+    }
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the name of *this medium.
-// Type:	Overridden.
-// Args:	None.
-// Return:	CMIUtilString - Text data.
-// Throws:	None.
+// Details: Retrieve the name of *this medium.
+// Type:    Overridden.
+// Args:    None.
+// Return:  CMIUtilString - Text data.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLogMediumFile::GetName( void ) const
+const CMIUtilString &
+CMICmnLogMediumFile::GetName(void) const
 {
-	return m_constThisMediumName;
+    return m_constThisMediumName;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	The callee client calls the write function on the Logger. The data to be
-//			written is given out to all the mediums registered. The verbosity type parameter 
-//			indicates to the medium the type of data or message given to it. The medium has
-//			modes of verbosity and depending on the verbosity set determines which data is
-//			sent to the medium's output.
-// Type:	Method.
-// Args:	vData		- (R) The data to write to the logger.
-//			veType		- (R) Verbosity type.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: The callee client calls the write function on the Logger. The data to be
+//          written is given out to all the mediums registered. The verbosity type parameter
+//          indicates to the medium the type of data or message given to it. The medium has
+//          modes of verbosity and depending on the verbosity set determines which data is
+//          sent to the medium's output.
+// Type:    Method.
+// Args:    vData       - (R) The data to write to the logger.
+//          veType      - (R) Verbosity type.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::Write( const CMIUtilString & vData, const CMICmnLog::ELogVerbosity veType )
+bool
+CMICmnLogMediumFile::Write(const CMIUtilString &vData, const CMICmnLog::ELogVerbosity veType)
 {
-	if( m_bInitialized && m_file.IsOk() )
-	{
-		const bool bDoWrite = (m_eVerbosityType & veType);
-		if( bDoWrite )
-		{
-			bool bNewCreated = false;
-			bool bOk = m_file.CreateWrite( m_fileNamePath, bNewCreated );
-			if( bOk )
-			{
-				if( bNewCreated )
-					bOk = FileWriteHeader();
-				bOk = bOk && FileWriteEnglish( MassagedData( vData, veType ) );
-			}
-			return bOk;
-		}
-	}
-	
-	return MIstatus::failure;
+    if (m_bInitialized && m_file.IsOk())
+    {
+        const bool bDoWrite = (m_eVerbosityType & veType);
+        if (bDoWrite)
+        {
+            bool bNewCreated = false;
+            bool bOk = m_file.CreateWrite(m_fileNamePath, bNewCreated);
+            if (bOk)
+            {
+                if (bNewCreated)
+                    bOk = FileWriteHeader();
+                bOk = bOk && FileWriteEnglish(MassagedData(vData, veType));
+            }
+            return bOk;
+        }
+    }
+
+    return MIstatus::failure;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve *this medium's last error condition.
-// Type:	Method.
-// Args:	None.
-// Return:	CString & -  Text description.
-// Throws:	None.
+// Details: Retrieve *this medium's last error condition.
+// Type:    Method.
+// Args:    None.
+// Return:  CString & -  Text description.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLogMediumFile::GetError( void ) const
+const CMIUtilString &
+CMICmnLogMediumFile::GetError(void) const
 {
-	return m_strMILastErrorDescription;
+    return m_strMILastErrorDescription;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the verbosity mode for this medium.
-// Type:	Method.
-// Args:	veType	- (R) Mask value.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Set the verbosity mode for this medium.
+// Type:    Method.
+// Args:    veType  - (R) Mask value.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::SetVerbosity( const MIuint veType )
+bool
+CMICmnLogMediumFile::SetVerbosity(const MIuint veType)
 {
-	m_eVerbosityType = veType;
-	return MIstatus::success;
+    m_eVerbosityType = veType;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Get the verbosity mode for this medium.
-// Type:	Method.
-// Args:	veType	- (R) Mask value.
-// Return:	CMICmnLog::ELogVerbosity - Mask value.
-// Throws:	None.
+// Details: Get the verbosity mode for this medium.
+// Type:    Method.
+// Args:    veType  - (R) Mask value.
+// Return:  CMICmnLog::ELogVerbosity - Mask value.
+// Throws:  None.
 //--
-MIuint CMICmnLogMediumFile::GetVerbosity( void ) const
+MIuint
+CMICmnLogMediumFile::GetVerbosity(void) const
 {
-	return m_eVerbosityType;
+    return m_eVerbosityType;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Write data to a file English font.
-// Type:	Method.
-// Args:	vData	- (R) The data to write to the logger.
-// Return:	None.
-// Throws:	None.
+// Details: Write data to a file English font.
+// Type:    Method.
+// Args:    vData   - (R) The data to write to the logger.
+// Return:  None.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::FileWriteEnglish( const CMIUtilString & vData )
+bool
+CMICmnLogMediumFile::FileWriteEnglish(const CMIUtilString &vData)
 {
-	return m_file.Write( vData );
+    return m_file.Write(vData);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine and form the medium file's directory path and name.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Determine and form the medium file's directory path and name.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::FileFormFileNamePath( void )
+bool
+CMICmnLogMediumFile::FileFormFileNamePath(void)
 {
-	ClrErrorDescription();
+    ClrErrorDescription();
 
-	m_fileNamePath = MIRSRC( IDS_MEDIUMFILE_ERR_INVALID_PATH );
+    m_fileNamePath = MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH);
 
-	CMIUtilString strPathName;
-	if( CMIUtilSystem().GetLogFilesPath( strPathName ) )
-	{
-		const CMIUtilString strPath = CMIUtilFileStd().StripOffFileName( strPathName );
+    CMIUtilString strPathName;
+    if (CMIUtilSystem().GetLogFilesPath(strPathName))
+    {
+        const CMIUtilString strPath = CMIUtilFileStd().StripOffFileName(strPathName);
 
-		// ToDo: Review this LINUX log file quick fix so not hidden
-        // AD: 
-        //      Linux was creating a log file here called '.\log.txt'.  The '.' on linux
-        //      signifies that this file is 'hidden' and not normally visible.  A quick fix
-        //      is to remove the path component all together.  Linux also normally uses '/'
-        //      as directory separators, again leading to the problem of the hidden log.
-#if defined ( _MSC_VER )
-        m_fileNamePath = CMIUtilString::Format( "%s\\%s", strPath.c_str(), m_constMediumFileName.c_str() );
+// ToDo: Review this LINUX log file quick fix so not hidden
+// AD:
+//      Linux was creating a log file here called '.\log.txt'.  The '.' on linux
+//      signifies that this file is 'hidden' and not normally visible.  A quick fix
+//      is to remove the path component all together.  Linux also normally uses '/'
+//      as directory separators, again leading to the problem of the hidden log.
+#if defined(_MSC_VER)
+        m_fileNamePath = CMIUtilString::Format("%s\\%s", strPath.c_str(), m_constMediumFileName.c_str());
 #else
-        m_fileNamePath = CMIUtilString::Format( "%s", m_constMediumFileName.c_str() );
+        m_fileNamePath = CMIUtilString::Format("%s", m_constMediumFileName.c_str());
 #endif // defined ( _MSC_VER )
 
-		return MIstatus::success;
-	}
+        return MIstatus::success;
+    }
+
+    SetErrorDescription(MIRSRC(IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS));
 
-	SetErrorDescription( MIRSRC( IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS ) );
-	
-	return MIstatus::failure;
+    return MIstatus::failure;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the medium file's directory path and name.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString & - File path.
-// Throws:	None.
+// Details: Retrieve the medium file's directory path and name.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - File path.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLogMediumFile::GetFileNamePath( void ) const
+const CMIUtilString &
+CMICmnLogMediumFile::GetFileNamePath(void) const
 {
-	return m_fileNamePath;
+    return m_fileNamePath;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the medium file's name.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString & - File name.
-// Throws:	None.
+// Details: Retrieve the medium file's name.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - File name.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLogMediumFile::GetFileName( void ) const
+const CMIUtilString &
+CMICmnLogMediumFile::GetFileName(void) const
 {
-	return m_constMediumFileName;
+    return m_constMediumFileName;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Massage the data to behave correct when submitted to file. Insert extra log
-//			specific text. The veType is there to allow in the future to parse the log and
-//			filter in out specific types of message to make viewing the log more manageable.
-// Type:	Method.
-// Args:	vData	- (R) Raw data.
-//			veType	- (R) Message type.
-// Return:	CMIUtilString - Massaged data.
-// Throws:	None.
+// Details: Massage the data to behave correct when submitted to file. Insert extra log
+//          specific text. The veType is there to allow in the future to parse the log and
+//          filter in out specific types of message to make viewing the log more manageable.
+// Type:    Method.
+// Args:    vData   - (R) Raw data.
+//          veType  - (R) Message type.
+// Return:  CMIUtilString - Massaged data.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLogMediumFile::MassagedData( const CMIUtilString & vData, const CMICmnLog::ELogVerbosity veType )
+CMIUtilString
+CMICmnLogMediumFile::MassagedData(const CMIUtilString &vData, const CMICmnLog::ELogVerbosity veType)
 {
-	const CMIUtilString strCr( "\n" );
-	CMIUtilString data;
-	const MIchar verbosityCode( ConvertLogVerbosityTypeToId( veType ) );
-	const CMIUtilString dt( CMIUtilString::Format( "%s %s", m_strDate.c_str(), m_dateTime.GetTime().c_str() ) );
-	
-	data = CMIUtilString::Format( "%c,%s,%s", verbosityCode, dt.c_str(), vData.c_str() );
-	data = ConvertCr( data );
+    const CMIUtilString strCr("\n");
+    CMIUtilString data;
+    const MIchar verbosityCode(ConvertLogVerbosityTypeToId(veType));
+    const CMIUtilString dt(CMIUtilString::Format("%s %s", m_strDate.c_str(), m_dateTime.GetTime().c_str()));
+
+    data = CMIUtilString::Format("%c,%s,%s", verbosityCode, dt.c_str(), vData.c_str());
+    data = ConvertCr(data);
+
+    // Look for EOL...
+    const MIint pos = vData.rfind(strCr);
+    if (pos == (MIint)vData.size())
+        return data;
+
+    // ... did not have an EOL so add one
+    data += GetLineReturn();
 
-	// Look for EOL...
-	const MIint pos = vData.rfind( strCr );
-	if( pos == (MIint) vData.size() )
-		return data;
-	
-	// ... did not have an EOL so add one
-	data += GetLineReturn();
-	
-	return data;
+    return data;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Convert the Log's verbosity type number into a single char character.
-// Type:	Method.
-// Args:	veType	- (R) Message type.
-// Return:	wchar_t - A letter.
-// Throws:	None.
+// Details: Convert the Log's verbosity type number into a single char character.
+// Type:    Method.
+// Args:    veType  - (R) Message type.
+// Return:  wchar_t - A letter.
+// Throws:  None.
 //--
-MIchar CMICmnLogMediumFile::ConvertLogVerbosityTypeToId( const CMICmnLog::ELogVerbosity veType ) const
+MIchar
+CMICmnLogMediumFile::ConvertLogVerbosityTypeToId(const CMICmnLog::ELogVerbosity veType) const
 {
-	MIchar c = 0;
-	if( veType != 0 )
-	{
-		MIuint cnt = 0;
-		MIuint number( veType );
-		while( 1 != number )
-		{
-			number = number >> 1;
-			++cnt;
-		}
-		c = 'A' + cnt;
-	}
-	else
-	{
-		c = '*';
-	}
+    MIchar c = 0;
+    if (veType != 0)
+    {
+        MIuint cnt = 0;
+        MIuint number(veType);
+        while (1 != number)
+        {
+            number = number >> 1;
+            ++cnt;
+        }
+        c = 'A' + cnt;
+    }
+    else
+    {
+        c = '*';
+    }
 
-	return c;
+    return c;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve state of whether the file medium is ok.
-// Type:	Method.
-// Args:	None.
-// Return:	True - file ok.
-//			False - file has a problem.
-// Throws:	None.
+// Details: Retrieve state of whether the file medium is ok.
+// Type:    Method.
+// Args:    None.
+// Return:  True - file ok.
+//          False - file has a problem.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::IsOk( void ) const
+bool
+CMICmnLogMediumFile::IsOk(void) const
 {
-	return m_file.IsOk();
+    return m_file.IsOk();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Status on the file log medium existing already.
-// Type:	Method.
-// Args:	None.
-// Return:	True - Exists.
-//			False - Not found.
-// Throws:	None.
+// Details: Status on the file log medium existing already.
+// Type:    Method.
+// Args:    None.
+// Return:  True - Exists.
+//          False - Not found.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::IsFileExist( void ) const
+bool
+CMICmnLogMediumFile::IsFileExist(void) const
 {
-	return m_file.IsFileExist( GetFileNamePath() );
+    return m_file.IsFileExist(GetFileNamePath());
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Write the header text the logger file.
-// Type:	Method.
-// Args:	vText	- (R) Text.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Write the header text the logger file.
+// Type:    Method.
+// Args:    vText   - (R) Text.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::FileWriteHeader( void )
+bool
+CMICmnLogMediumFile::FileWriteHeader(void)
 {
-	return FileWriteEnglish( ConvertCr( m_fileHeaderTxt ) );
+    return FileWriteEnglish(ConvertCr(m_fileHeaderTxt));
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Convert any carriage line returns to be compatible with the platform the
-//			Log fiel is being written to.
-// Type:	Method.
-// Args:	vData	- (R) Text data.
-// Return:	CMIUtilString - Converted string data.
-// Throws:	None.
+// Details: Convert any carriage line returns to be compatible with the platform the
+//          Log fiel is being written to.
+// Type:    Method.
+// Args:    vData   - (R) Text data.
+// Return:  CMIUtilString - Converted string data.
+// Throws:  None.
 //--
-CMIUtilString CMICmnLogMediumFile::ConvertCr( const CMIUtilString & vData ) const
+CMIUtilString
+CMICmnLogMediumFile::ConvertCr(const CMIUtilString &vData) const
 {
-	const CMIUtilString strCr( "\n" );
-	const CMIUtilString & rCrCmpat( GetLineReturn() );
+    const CMIUtilString strCr("\n");
+    const CMIUtilString &rCrCmpat(GetLineReturn());
 
-	if( strCr == rCrCmpat )
-		return vData;
+    if (strCr == rCrCmpat)
+        return vData;
 
-	const MIuint nSizeCmpat( rCrCmpat.size() );
-	const MIuint nSize( strCr.size() );
-	CMIUtilString strConv( vData );
-	MIint pos = strConv.find( strCr );
-	while( pos != (MIint) CMIUtilString::npos )
-	{
-		strConv.replace( pos, nSize, rCrCmpat );
-		pos = strConv.find( strCr, pos + nSizeCmpat );
-	}
+    const MIuint nSizeCmpat(rCrCmpat.size());
+    const MIuint nSize(strCr.size());
+    CMIUtilString strConv(vData);
+    MIint pos = strConv.find(strCr);
+    while (pos != (MIint)CMIUtilString::npos)
+    {
+        strConv.replace(pos, nSize, rCrCmpat);
+        pos = strConv.find(strCr, pos + nSizeCmpat);
+    }
 
-	return strConv;
+    return strConv;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Set the header text that is written to the logger file at the begining.
-// Type:	Method.
-// Args:	vText	- (R) Text.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Set the header text that is written to the logger file at the begining.
+// Type:    Method.
+// Args:    vText   - (R) Text.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnLogMediumFile::SetHeaderTxt( const CMIUtilString & vText )
+bool
+CMICmnLogMediumFile::SetHeaderTxt(const CMIUtilString &vText)
 {
-	m_fileHeaderTxt = vText;
+    m_fileHeaderTxt = vText;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the file current carriage line return characters used.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString & - Text.
-// Throws:	None.
+// Details: Retrieve the file current carriage line return characters used.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - Text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnLogMediumFile::GetLineReturn( void ) const
+const CMIUtilString &
+CMICmnLogMediumFile::GetLineReturn(void) const
 {
-	return m_file.GetLineReturn();
+    return m_file.GetLineReturn();
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.h Mon Nov 17 12:06:21 2014
@@ -8,89 +8,87 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnLogMediumFile.h
+// File:        MICmnLogMediumFile.h
 //
-// Overview:	CMICmnLogMediumFile interface.
+// Overview:    CMICmnLogMediumFile interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
 
 // In-house headers:
 #include "MIUtilFileStd.h"
-#include "MIUtilString.h"  
+#include "MIUtilString.h"
 #include "MICmnBase.h"
 #include "MICmnLog.h"
 #include "MIUtilDateTimeStd.h"
 
 //++ ============================================================================
-// Details:	MI common code implementation class. Logs application fn trace/message/
-//			error messages to a file. Used as part of the CMICmnLog Logger
-//			system. When instantiated *this object is register with the Logger
-//			which the Logger when given data to write to registered medium comes
-//			*this medium.
-//			Singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 30/01/2014.
-// Changes:	None.
+// Details: MI common code implementation class. Logs application fn trace/message/
+//          error messages to a file. Used as part of the CMICmnLog Logger
+//          system. When instantiated *this object is register with the Logger
+//          which the Logger when given data to write to registered medium comes
+//          *this medium.
+//          Singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 30/01/2014.
+// Changes: None.
 //--
-class CMICmnLogMediumFile
-:	public CMICmnBase
-,	public CMICmnLog::IMedium
+class CMICmnLogMediumFile : public CMICmnBase, public CMICmnLog::IMedium
 {
-// Statics:
-public:
-	static	CMICmnLogMediumFile &	Instance( void );
-
-// Methods:
-public:
-	bool					SetHeaderTxt( const CMIUtilString & vText );
-	bool					SetVerbosity( const MIuint veType );
-	MIuint					GetVerbosity( void ) const;
-	const CMIUtilString &	GetFileName( void ) const;
-	const CMIUtilString &	GetFileNamePath( void ) const;
-	bool					IsOk( void ) const;
-	bool					IsFileExist( void ) const;
-	const CMIUtilString &	GetLineReturn( void ) const;
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnLogMediumFile( void );
-	// From CMICmnLog::IMedium
-	virtual bool					Initialize( void );
-	virtual const CMIUtilString &	GetName( void ) const;
-	virtual bool					Write( const CMIUtilString & vData, const CMICmnLog::ELogVerbosity veType );
-	virtual const CMIUtilString &	GetError( void ) const;
-	virtual bool					Shutdown( void );
-
-// Methods:
-private:
-	/* ctor */	CMICmnLogMediumFile( void );
-	/* ctor */	CMICmnLogMediumFile( const CMICmnLogMediumFile & );
-	void		operator=( const CMICmnLogMediumFile & );
-	
-	bool			FileWriteEnglish( const CMIUtilString & vData );
-	bool			FileFormFileNamePath( void );
-	CMIUtilString	MassagedData( const CMIUtilString & vData, const CMICmnLog::ELogVerbosity veType );
-	bool			FileWriteHeader( void );
-	MIchar			ConvertLogVerbosityTypeToId( const CMICmnLog::ELogVerbosity veType ) const;
-	CMIUtilString	ConvertCr( const CMIUtilString & vData ) const;
-
-// Attributes:
-private:
-	const CMIUtilString	m_constThisMediumName;
-	const CMIUtilString	m_constMediumFileName;
-	//
-	CMIUtilString		m_fileNamePath;
-	MIuint				m_eVerbosityType;
-	CMIUtilString		m_strDate;
-	CMIUtilString		m_fileHeaderTxt;
-	CMIUtilFileStd		m_file;
-	CMIUtilDateTimeStd	m_dateTime;
+    // Statics:
+  public:
+    static CMICmnLogMediumFile &Instance(void);
+
+    // Methods:
+  public:
+    bool SetHeaderTxt(const CMIUtilString &vText);
+    bool SetVerbosity(const MIuint veType);
+    MIuint GetVerbosity(void) const;
+    const CMIUtilString &GetFileName(void) const;
+    const CMIUtilString &GetFileNamePath(void) const;
+    bool IsOk(void) const;
+    bool IsFileExist(void) const;
+    const CMIUtilString &GetLineReturn(void) const;
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnLogMediumFile(void);
+    // From CMICmnLog::IMedium
+    virtual bool Initialize(void);
+    virtual const CMIUtilString &GetName(void) const;
+    virtual bool Write(const CMIUtilString &vData, const CMICmnLog::ELogVerbosity veType);
+    virtual const CMIUtilString &GetError(void) const;
+    virtual bool Shutdown(void);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnLogMediumFile(void);
+    /* ctor */ CMICmnLogMediumFile(const CMICmnLogMediumFile &);
+    void operator=(const CMICmnLogMediumFile &);
+
+    bool FileWriteEnglish(const CMIUtilString &vData);
+    bool FileFormFileNamePath(void);
+    CMIUtilString MassagedData(const CMIUtilString &vData, const CMICmnLog::ELogVerbosity veType);
+    bool FileWriteHeader(void);
+    MIchar ConvertLogVerbosityTypeToId(const CMICmnLog::ELogVerbosity veType) const;
+    CMIUtilString ConvertCr(const CMIUtilString &vData) const;
+
+    // Attributes:
+  private:
+    const CMIUtilString m_constThisMediumName;
+    const CMIUtilString m_constMediumFileName;
+    //
+    CMIUtilString m_fileNamePath;
+    MIuint m_eVerbosityType;
+    CMIUtilString m_strDate;
+    CMIUtilString m_fileHeaderTxt;
+    CMIUtilFileStd m_file;
+    CMIUtilDateTimeStd m_dateTime;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIOutOfBandRecord.h
+// File:        MICmnMIOutOfBandRecord.h
 //
-// Overview:	CMICmnMIOutOfBandRecord implementation.
+// Overview:    CMICmnMIOutOfBandRecord implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,138 +24,136 @@
 #include "MICmnResources.h"
 
 // Instantiations:
-CMICmnMIOutOfBandRecord::MapOutOfBandToOutOfBandText_t ms_MapOutOfBandToOutOfBandText = 
-{
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Running, "running" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, "stopped" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, "breakpoint-created" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, "breakpoint-modified" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Thread, "" }, // "" Meant to be empty
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupAdded, "thread-group-added" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, "thread-group-exited" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupRemoved, "thread-group-removed" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, "thread-group-started" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, "thread-created" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, "thread-exited" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, "thread-selected" }
-};
-CMICmnMIOutOfBandRecord::MapOutOfBandToOutOfBandText_t ms_constMapAsyncRecordTextToToken = 
-{
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Running, "*" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, "*" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_Thread, "@" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupAdded, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupRemoved, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, "=" },
-	{ CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, "=" }
-};
-		
+CMICmnMIOutOfBandRecord::MapOutOfBandToOutOfBandText_t ms_MapOutOfBandToOutOfBandText = {
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Running, "running"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, "stopped"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, "breakpoint-created"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, "breakpoint-modified"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Thread, ""}, // "" Meant to be empty
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupAdded, "thread-group-added"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, "thread-group-exited"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupRemoved, "thread-group-removed"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, "thread-group-started"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, "thread-created"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, "thread-exited"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, "thread-selected"}};
+CMICmnMIOutOfBandRecord::MapOutOfBandToOutOfBandText_t ms_constMapAsyncRecordTextToToken = {
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Running, "*"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, "*"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_Thread, "@"},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupAdded, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupExited, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupRemoved, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadGroupStarted, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadCreated, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadExited, "="},
+    {CMICmnMIOutOfBandRecord::eOutOfBand_ThreadSelected, "="}};
+
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIOutOfBandRecord constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIOutOfBandRecord constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( void )
-:	m_strAsyncRecord( MIRSRC( IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION ) )
+CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord(void)
+    : m_strAsyncRecord(MIRSRC(IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION))
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIOutOfBandRecord constructor.
-// Type:	Method.
-// Args:	veType	- (R) A MI Out-of-Bound enumeration.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIOutOfBandRecord constructor.
+// Type:    Method.
+// Args:    veType      - (R) A MI Out-of-Bound enumeration.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( const OutOfBand_e veType )
-:	m_eResultAsyncRecordClass( veType )
-,	m_strAsyncRecord( MIRSRC( IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION ) )
+CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord(const OutOfBand_e veType)
+    : m_eResultAsyncRecordClass(veType)
+    , m_strAsyncRecord(MIRSRC(IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION))
 {
-	BuildAsyncRecord();
+    BuildAsyncRecord();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIOutOfBandRecord constructor.
-// Type:	Method.
-// Args:	veType		- (R) A MI Out-of-Bound enumeration.
-//			vMIResult	- (R) A MI result object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIOutOfBandRecord constructor.
+// Type:    Method.
+// Args:    veType      - (R) A MI Out-of-Bound enumeration.
+//          vMIResult   - (R) A MI result object.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( const OutOfBand_e veType, const CMICmnMIValueResult & vValue )
-:	m_eResultAsyncRecordClass( veType )
-,	m_strAsyncRecord( MIRSRC( IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION ) )
-,	m_partResult( vValue )	
+CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueResult &vValue)
+    : m_eResultAsyncRecordClass(veType)
+    , m_strAsyncRecord(MIRSRC(IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION))
+    , m_partResult(vValue)
 {
-	BuildAsyncRecord();
-	Add( m_partResult );
+    BuildAsyncRecord();
+    Add(m_partResult);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIOutOfBandRecord destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIOutOfBandRecord destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIOutOfBandRecord::~CMICmnMIOutOfBandRecord( void )
+CMICmnMIOutOfBandRecord::~CMICmnMIOutOfBandRecord(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the MI Out-of-band record as a string. The string is a direct result of
-//			work done on *this Out-of-band record so if not enough data is added then it is
-//			possible to return a malformed Out-of-band record. If nothing has been set or 
-//			added to *this MI Out-of-band record object then text "<Invalid>" will be returned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString &	- MI output text.
-// Throws:	None.
+// Details: Return the MI Out-of-band record as a string. The string is a direct result of
+//          work done on *this Out-of-band record so if not enough data is added then it is
+//          possible to return a malformed Out-of-band record. If nothing has been set or
+//          added to *this MI Out-of-band record object then text "<Invalid>" will be returned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - MI output text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnMIOutOfBandRecord::GetString( void ) const
+const CMIUtilString &
+CMICmnMIOutOfBandRecord::GetString(void) const
 {
-	return m_strAsyncRecord;
+    return m_strAsyncRecord;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the Out-of-band record's mandatory data part. The part up to the first
-//			(additional) result i.e. async-record ==>  "*" type.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the Out-of-band record's mandatory data part. The part up to the first
+//          (additional) result i.e. async-record ==>  "*" type.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIOutOfBandRecord::BuildAsyncRecord( void )
+bool
+CMICmnMIOutOfBandRecord::BuildAsyncRecord(void)
 {
-	const MIchar * pFormat = "%s%s";
-	const CMIUtilString & rStrAsyncRecord( ms_MapOutOfBandToOutOfBandText[ m_eResultAsyncRecordClass ] );
-	const CMIUtilString & rStrToken( ms_constMapAsyncRecordTextToToken[ m_eResultAsyncRecordClass ] );
-	m_strAsyncRecord = CMIUtilString::Format( pFormat, rStrToken.c_str(), rStrAsyncRecord.c_str() );
+    const MIchar *pFormat = "%s%s";
+    const CMIUtilString &rStrAsyncRecord(ms_MapOutOfBandToOutOfBandText[m_eResultAsyncRecordClass]);
+    const CMIUtilString &rStrToken(ms_constMapAsyncRecordTextToToken[m_eResultAsyncRecordClass]);
+    m_strAsyncRecord = CMIUtilString::Format(pFormat, rStrToken.c_str(), rStrAsyncRecord.c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add to *this Out-of-band record additional information.
-// Type:	Method.
-// Args:	vMIValue	- (R) A MI value derived object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add to *this Out-of-band record additional information.
+// Type:    Method.
+// Args:    vMIValue    - (R) A MI value derived object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIOutOfBandRecord::Add( const CMICmnMIValue & vMIValue )
+bool
+CMICmnMIOutOfBandRecord::Add(const CMICmnMIValue &vMIValue)
 {
-	m_strAsyncRecord += ",";
-	m_strAsyncRecord += vMIValue.GetString();	
+    m_strAsyncRecord += ",";
+    m_strAsyncRecord += vMIValue.GetString();
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIOutOfBandRecord.h
+// File:        MICmnMIOutOfBandRecord.h
 //
-// Overview:	CMICmnMIOutOfBandRecord interface.
+// Overview:    CMICmnMIOutOfBandRecord interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -30,81 +30,81 @@
 #include "MICmnMIValueResult.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Out-of-band (Async) Record class. A class that encapsulates 
-//			MI result record data and the forming/format of data added to it.
-//			Out-of-band records are used to notify the GDB/MI client of additional 
-//			changes that have occurred. Those changes can either be a consequence 
-//			of GDB/MI (e.g., a breakpoint modified) or a result of target activity 
-//			(e.g., target stopped). 
-//			The syntax is as follows:
-//			"*" type ( "," result )*
-//			type ==> running | stopped
+// Details: MI common code MI Out-of-band (Async) Record class. A class that encapsulates
+//          MI result record data and the forming/format of data added to it.
+//          Out-of-band records are used to notify the GDB/MI client of additional
+//          changes that have occurred. Those changes can either be a consequence
+//          of GDB/MI (e.g., a breakpoint modified) or a result of target activity
+//          (e.g., target stopped).
+//          The syntax is as follows:
+//          "*" type ( "," result )*
+//          type ==> running | stopped
 //
-//			The Out-of-band record can be retrieve at any time *this object is
-//			instantiated so unless work is done on *this Out-of-band record then it is
-//			possible to return a malformed Out-of-band record. If nothing has been set 
-//			or added to *this MI Out-of-band record object then text "<Invalid>" will 
-//			be returned.
+//          The Out-of-band record can be retrieve at any time *this object is
+//          instantiated so unless work is done on *this Out-of-band record then it is
+//          possible to return a malformed Out-of-band record. If nothing has been set
+//          or added to *this MI Out-of-band record object then text "<Invalid>" will
+//          be returned.
 //
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html// 
-//			Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html//
+//          Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIOutOfBandRecord : public CMICmnBase
 {
-// Enumerations:
-public:
-	//++
-	// Details:	Enumeration of the type of Out-of-band for *this Out-of-band record
-	//--
-	enum OutOfBand_e
-	{
-		eOutOfBand_Running	= 0,
-		eOutOfBand_Stopped,
-		eOutOfBand_BreakPointCreated,
-		eOutOfBand_BreakPointModified,
-		eOutOfBand_Thread,
-		eOutOfBand_ThreadGroupAdded,
-		eOutOfBand_ThreadGroupExited,
-		eOutOfBand_ThreadGroupRemoved,
-		eOutOfBand_ThreadGroupStarted,
-		eOutOfBand_ThreadCreated,
-		eOutOfBand_ThreadExited,
-		eOutOfBand_ThreadSelected,
-		eOutOfBand_count			// Always the last one
-	};
-
-// Typedefs:
-public:
-	typedef	std::map< OutOfBand_e, CMIUtilString >	MapOutOfBandToOutOfBandText_t;
-	typedef	std::map< OutOfBand_e, CMIUtilString >	MapOutOfBandToToken_t;
-
-// Methods:
-public:
-	/* ctor */	CMICmnMIOutOfBandRecord( void );
-	/* ctor */	CMICmnMIOutOfBandRecord( const OutOfBand_e veType );
-	/* ctor */	CMICmnMIOutOfBandRecord( const OutOfBand_e veType, const CMICmnMIValueResult & vValue );
-	//
-	const CMIUtilString &	GetString( void ) const;
-	bool					Add( const CMICmnMIValue & vMIValue );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIOutOfBandRecord( void );
-
-// Methods:
-private:
-	bool	BuildAsyncRecord( void );
-
-// Attributes:
-private:
-	static MapOutOfBandToOutOfBandText_t	ms_constMapOutOfBandToAsyncRecordText;
-	static MapOutOfBandToToken_t			ms_constMapOutOfBandTextToToken;
-	//
-	OutOfBand_e			m_eResultAsyncRecordClass;
-	CMIUtilString		m_strAsyncRecord;			// Holds the text version of the result record to date
-	CMICmnMIValueResult	m_partResult;
+    // Enumerations:
+  public:
+    //++
+    // Details: Enumeration of the type of Out-of-band for *this Out-of-band record
+    //--
+    enum OutOfBand_e
+    {
+        eOutOfBand_Running = 0,
+        eOutOfBand_Stopped,
+        eOutOfBand_BreakPointCreated,
+        eOutOfBand_BreakPointModified,
+        eOutOfBand_Thread,
+        eOutOfBand_ThreadGroupAdded,
+        eOutOfBand_ThreadGroupExited,
+        eOutOfBand_ThreadGroupRemoved,
+        eOutOfBand_ThreadGroupStarted,
+        eOutOfBand_ThreadCreated,
+        eOutOfBand_ThreadExited,
+        eOutOfBand_ThreadSelected,
+        eOutOfBand_count // Always the last one
+    };
+
+    // Typedefs:
+  public:
+    typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToOutOfBandText_t;
+    typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToToken_t;
+
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIOutOfBandRecord(void);
+    /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType);
+    /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueResult &vValue);
+    //
+    const CMIUtilString &GetString(void) const;
+    bool Add(const CMICmnMIValue &vMIValue);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIOutOfBandRecord(void);
+
+    // Methods:
+  private:
+    bool BuildAsyncRecord(void);
+
+    // Attributes:
+  private:
+    static MapOutOfBandToOutOfBandText_t ms_constMapOutOfBandToAsyncRecordText;
+    static MapOutOfBandToToken_t ms_constMapOutOfBandTextToToken;
+    //
+    OutOfBand_e m_eResultAsyncRecordClass;
+    CMIUtilString m_strAsyncRecord; // Holds the text version of the result record to date
+    CMICmnMIValueResult m_partResult;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIResultRecord.h
+// File:        MICmnMIResultRecord.h
 //
-// Overview:	CMICmnMIResultRecord implementation.
+// Overview:    CMICmnMIResultRecord implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,119 +24,121 @@
 #include "MICmnResources.h"
 
 // Instantiations:
-CMICmnMIResultRecord::MapResultClassToResultClassText_t ms_MapResultClassToResultClassText = 
-{
-	{ CMICmnMIResultRecord::eResultClass_Done, "done" },
-	{ CMICmnMIResultRecord::eResultClass_Running, "running" },
-	{ CMICmnMIResultRecord::eResultClass_Connected, "connected" },
-	{ CMICmnMIResultRecord::eResultClass_Error, "error" },
-	{ CMICmnMIResultRecord::eResultClass_Exit, "exit" }
-};
-const CMIUtilString CMICmnMIResultRecord::ms_constStrResultRecordHat( "^");
+CMICmnMIResultRecord::MapResultClassToResultClassText_t ms_MapResultClassToResultClassText = {
+    {CMICmnMIResultRecord::eResultClass_Done, "done"},
+    {CMICmnMIResultRecord::eResultClass_Running, "running"},
+    {CMICmnMIResultRecord::eResultClass_Connected, "connected"},
+    {CMICmnMIResultRecord::eResultClass_Error, "error"},
+    {CMICmnMIResultRecord::eResultClass_Exit, "exit"}};
+const CMIUtilString CMICmnMIResultRecord::ms_constStrResultRecordHat("^");
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIResultRecord constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIResultRecord constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIResultRecord::CMICmnMIResultRecord( void )
-:	m_strResultRecord( MIRSRC( IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION ) )
+CMICmnMIResultRecord::CMICmnMIResultRecord(void)
+    : m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION))
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIResultRecord constructor.
-// Type:	Method.
-// Args:	vrToken	- (R) The command's transaction ID or token.
-//			veType	- (R) A MI result class enumeration.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIResultRecord constructor.
+// Type:    Method.
+// Args:    vrToken - (R) The command's transaction ID or token.
+//          veType  - (R) A MI result class enumeration.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIResultRecord::CMICmnMIResultRecord( const CMIUtilString & vrToken, const ResultClass_e veType )
-:	m_strResultRecordToken( vrToken )
-,	m_eResultRecordResultClass( veType )
-,	m_strResultRecord( MIRSRC( IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION ) )
+CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType)
+    : m_strResultRecordToken(vrToken)
+    , m_eResultRecordResultClass(veType)
+    , m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION))
 {
-	BuildResultRecord();
+    BuildResultRecord();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIResultRecord constructor.
-// Type:	Method.
-// Args:	vrToken		- (R) The command's transaction ID or token.
-//			veType		- (R) A MI result class enumeration.
-//			vMIResult	- (R) A MI result object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIResultRecord constructor.
+// Type:    Method.
+// Args:    vrToken     - (R) The command's transaction ID or token.
+//          veType      - (R) A MI result class enumeration.
+//          vMIResult   - (R) A MI result object.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIResultRecord::CMICmnMIResultRecord( const CMIUtilString & vrToken, const ResultClass_e veType, const CMICmnMIValueResult & vValue )
-:	m_strResultRecordToken( vrToken )
-,	m_eResultRecordResultClass( veType )
-,	m_strResultRecord( MIRSRC( IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION ) )
-,	m_partResult( vValue )	
+CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType, const CMICmnMIValueResult &vValue)
+    : m_strResultRecordToken(vrToken)
+    , m_eResultRecordResultClass(veType)
+    , m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION))
+    , m_partResult(vValue)
 {
-	BuildResultRecord();
-	Add( m_partResult );
+    BuildResultRecord();
+    Add(m_partResult);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIResultRecord destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIResultRecord destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIResultRecord::~CMICmnMIResultRecord( void )
+CMICmnMIResultRecord::~CMICmnMIResultRecord(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the MI result record as a string. The string is a direct result of
-//			work done on *this result record so if not enough data is added then it is
-//			possible to return a malformed result record. If nothing has been set or 
-//			added to *this MI result record object then text "<Invalid>" will be returned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString &	- MI output text.
-// Throws:	None.
+// Details: Return the MI result record as a string. The string is a direct result of
+//          work done on *this result record so if not enough data is added then it is
+//          possible to return a malformed result record. If nothing has been set or
+//          added to *this MI result record object then text "<Invalid>" will be returned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - MI output text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnMIResultRecord::GetString( void ) const
+const CMIUtilString &
+CMICmnMIResultRecord::GetString(void) const
 {
-	return m_strResultRecord;
+    return m_strResultRecord;
 }
-	
+
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the result record's mandatory data part. The part up to the first
-//			(additional) result i.e. result-record ==>  [ token ] "^" result-class.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the result record's mandatory data part. The part up to the first
+//          (additional) result i.e. result-record ==>  [ token ] "^" result-class.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIResultRecord::BuildResultRecord( void )
+bool
+CMICmnMIResultRecord::BuildResultRecord(void)
 {
-	const MIchar * pFormat = "%s%s%s";
-	const CMIUtilString & rStrResultRecord( ms_MapResultClassToResultClassText[ m_eResultRecordResultClass ] );
-	m_strResultRecord = CMIUtilString::Format( pFormat, m_strResultRecordToken.c_str(), ms_constStrResultRecordHat.c_str(), rStrResultRecord.c_str() );
+    const MIchar *pFormat = "%s%s%s";
+    const CMIUtilString &rStrResultRecord(ms_MapResultClassToResultClassText[m_eResultRecordResultClass]);
+    m_strResultRecord =
+        CMIUtilString::Format(pFormat, m_strResultRecordToken.c_str(), ms_constStrResultRecordHat.c_str(), rStrResultRecord.c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add to *this result record additional information.
-// Type:	Method.
-// Args:	vMIValue	- (R) A MI value derived object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add to *this result record additional information.
+// Type:    Method.
+// Args:    vMIValue    - (R) A MI value derived object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIResultRecord::Add( const CMICmnMIValue & vMIValue )
+bool
+CMICmnMIResultRecord::Add(const CMICmnMIValue &vMIValue)
 {
-	m_strResultRecord += ",";
-	m_strResultRecord += vMIValue.GetString();	
+    m_strResultRecord += ",";
+    m_strResultRecord += vMIValue.GetString();
 
-	return MIstatus::success;
+    return MIstatus::success;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIResultRecord.h
+// File:        MICmnMIResultRecord.h
 //
-// Overview:	CMICmnMIResultRecord interface.
+// Overview:    CMICmnMIResultRecord interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -30,77 +30,77 @@
 #include "MICmnMIValueResult.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result Record class. A class that encapsulates 
-//			MI result record data and the forming/format of data added to it.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content) i.e. "all" inc quotes
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]" 
+// Details: MI common code MI Result Record class. A class that encapsulates
+//          MI result record data and the forming/format of data added to it.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content) i.e. "all" inc quotes
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
 //
-//			The result record can be retrieve at any time *this object is
-//			instantiated so unless work is done on *this result record then it is
-//			possible to return a malformed result record. If nothing has been set 
-//			or added to *this MI result record object then text "<Invalid>" will 
-//			be returned.
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+//          The result record can be retrieve at any time *this object is
+//          instantiated so unless work is done on *this result record then it is
+//          possible to return a malformed result record. If nothing has been set
+//          or added to *this MI result record object then text "<Invalid>" will
+//          be returned.
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIResultRecord : public CMICmnBase
 {
-// Enumerations:
-public:
-	//++
-	// Details:	Enumeration of the result class for *this result record
-	//--
-	enum ResultClass_e
-	{
-		eResultClass_Done	= 0,
-		eResultClass_Running,
-		eResultClass_Connected,
-		eResultClass_Error,
-		eResultClass_Exit,
-		eResultClass_count	// Always the last one
-	};
-
-// Typedefs:
-public:
-	typedef	std::map< ResultClass_e, CMIUtilString >	MapResultClassToResultClassText_t;
-
-// Methods:
-public:
-	/* ctor */	CMICmnMIResultRecord( void );
-	/* ctor */	CMICmnMIResultRecord( const CMIUtilString & vrToken, const ResultClass_e veType );
-	/* ctor */	CMICmnMIResultRecord( const CMIUtilString & vrToken, const ResultClass_e veType, const CMICmnMIValueResult & vValue );
-	//
-	const CMIUtilString &	GetString( void ) const;
-	bool					Add( const CMICmnMIValue & vMIValue );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIResultRecord( void );
-
-// Methods:
-private:
-	bool	BuildResultRecord( void );
-
-// Attributes:
-private:
-	static const CMIUtilString					ms_constStrResultRecordHat;
-	static MapResultClassToResultClassText_t	ms_constMapResultClassToResultClassText;
-	//
-	CMIUtilString		m_strResultRecordToken;
-	ResultClass_e		m_eResultRecordResultClass;
-	CMIUtilString		m_strResultRecord;			// Holds the text version of the result record to date
-	CMICmnMIValueResult	m_partResult;
+    // Enumerations:
+  public:
+    //++
+    // Details: Enumeration of the result class for *this result record
+    //--
+    enum ResultClass_e
+    {
+        eResultClass_Done = 0,
+        eResultClass_Running,
+        eResultClass_Connected,
+        eResultClass_Error,
+        eResultClass_Exit,
+        eResultClass_count // Always the last one
+    };
+
+    // Typedefs:
+  public:
+    typedef std::map<ResultClass_e, CMIUtilString> MapResultClassToResultClassText_t;
+
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIResultRecord(void);
+    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType);
+    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType, const CMICmnMIValueResult &vValue);
+    //
+    const CMIUtilString &GetString(void) const;
+    bool Add(const CMICmnMIValue &vMIValue);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIResultRecord(void);
+
+    // Methods:
+  private:
+    bool BuildResultRecord(void);
+
+    // Attributes:
+  private:
+    static const CMIUtilString ms_constStrResultRecordHat;
+    static MapResultClassToResultClassText_t ms_constMapResultClassToResultClassText;
+    //
+    CMIUtilString m_strResultRecordToken;
+    ResultClass_e m_eResultRecordResultClass;
+    CMIUtilString m_strResultRecord; // Holds the text version of the result record to date
+    CMICmnMIValueResult m_partResult;
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValue.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValue.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValue.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValue.h
+// File:        MICmnMIValue.h
 //
-// Overview:	CMICmnMIValue implementation.
+// Overview:    CMICmnMIValue implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,41 +24,41 @@
 #include "MICmnResources.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValue constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValue constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValue::CMICmnMIValue( void )
-:	m_strValue( MIRSRC( IDS_WORD_INVALIDBRKTS ) )
-,	m_bJustConstructed( true )
+CMICmnMIValue::CMICmnMIValue(void)
+    : m_strValue(MIRSRC(IDS_WORD_INVALIDBRKTS))
+    , m_bJustConstructed(true)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValue destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValue destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValue::~CMICmnMIValue( void )
+CMICmnMIValue::~CMICmnMIValue(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Return the MI value as a string. The string is a direct result of
-//			work done on *this value so if not enough data is added then it is
-//			possible to return a malformed value. If nothing has been set or 
-//			added to *this MI value object then text "<Invalid>" will be returned.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString &	- MI output text.
-// Throws:	None.
+// Details: Return the MI value as a string. The string is a direct result of
+//          work done on *this value so if not enough data is added then it is
+//          possible to return a malformed value. If nothing has been set or
+//          added to *this MI value object then text "<Invalid>" will be returned.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString & - MI output text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnMIValue::GetString( void ) const
+const CMIUtilString &
+CMICmnMIValue::GetString(void) const
 {
-	return m_strValue;
+    return m_strValue;
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValue.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValue.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValue.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValue.h
+// File:        MICmnMIValue.h
 //
-// Overview:	CMICmnMIValue interface.
+// Overview:    CMICmnMIValue interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,40 +25,40 @@
 #include "MICmnBase.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result class. Part of the CMICmnMIValueRecord
-//			set of objects.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content)
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"  
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+// Details: MI common code MI Result class. Part of the CMICmnMIValueRecord
+//          set of objects.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content)
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIValue : public CMICmnBase
 {
-// Methods:
-public:
-	/* ctor */	CMICmnMIValue( void );
-	//
-	const CMIUtilString &	GetString( void ) const;
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIValue( void );
-
-// Attributes:
-protected:
-	CMIUtilString	m_strValue;
-	bool			m_bJustConstructed;	// True = *this just constructed with no value, false = *this has had value added to it
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIValue(void);
+    //
+    const CMIUtilString &GetString(void) const;
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIValue(void);
+
+    // Attributes:
+  protected:
+    CMIUtilString m_strValue;
+    bool m_bJustConstructed; // True = *this just constructed with no value, false = *this has had value added to it
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueConst.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueConst.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueConst.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueConst.cpp Mon Nov 17 12:06:21 2014
@@ -8,91 +8,92 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueConst.h
+// File:        MICmnMIValueConst.h
 //
-// Overview:	CMICmnMIValueConst implementation.
+// Overview:    CMICmnMIValueConst implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
 #include "MICmnMIValueConst.h"
 
 // Instantiations:
-const CMIUtilString CMICmnMIValueConst::ms_constStrDblQuote( "\"" );
+const CMIUtilString CMICmnMIValueConst::ms_constStrDblQuote("\"");
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueConst constructor.
-// Type:	Method.
-// Args:	vString	- (R) MI Const c-string value.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueConst constructor.
+// Type:    Method.
+// Args:    vString - (R) MI Const c-string value.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueConst::CMICmnMIValueConst( const CMIUtilString & vString )
-:	m_strPartConst( vString )
-,	m_bNoQuotes( false )
+CMICmnMIValueConst::CMICmnMIValueConst(const CMIUtilString &vString)
+    : m_strPartConst(vString)
+    , m_bNoQuotes(false)
 {
-	BuildConst();
+    BuildConst();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueConst constructor.
-// Type:	Method.
-// Args:	vString		- (R) MI Const c-string value.
-//			vbNoQuotes	- (R) True = return string not surrounded with quotes, false = use quotes.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueConst constructor.
+// Type:    Method.
+// Args:    vString     - (R) MI Const c-string value.
+//          vbNoQuotes  - (R) True = return string not surrounded with quotes, false = use quotes.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueConst::CMICmnMIValueConst( const CMIUtilString & vString, const bool vbNoQuotes )
-:	m_strPartConst( vString )
-,	m_bNoQuotes( vbNoQuotes )
+CMICmnMIValueConst::CMICmnMIValueConst(const CMIUtilString &vString, const bool vbNoQuotes)
+    : m_strPartConst(vString)
+    , m_bNoQuotes(vbNoQuotes)
 {
-	BuildConst();
+    BuildConst();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueConst destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueConst destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueConst::~CMICmnMIValueConst( void )
+CMICmnMIValueConst::~CMICmnMIValueConst(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the Value Const data. 
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the Value Const data.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueConst::BuildConst( void )
+bool
+CMICmnMIValueConst::BuildConst(void)
 {
-	if( m_strPartConst.length() != 0 )
-	{
-		const CMIUtilString strValue( m_strPartConst.StripCREndOfLine() );
-		if( m_bNoQuotes )
-		{
-			m_strValue = strValue;
-		}
-		else
-		{
-			const MIchar * pFormat = "%s%s%s";
-			m_strValue = CMIUtilString::Format( pFormat, ms_constStrDblQuote.c_str(), strValue.c_str(), ms_constStrDblQuote.c_str() );
-		}
-	}
-	else
-	{
-		const MIchar * pFormat = "%s%s";
-		m_strValue = CMIUtilString::Format( pFormat, ms_constStrDblQuote.c_str(), ms_constStrDblQuote.c_str() );
-	}
+    if (m_strPartConst.length() != 0)
+    {
+        const CMIUtilString strValue(m_strPartConst.StripCREndOfLine());
+        if (m_bNoQuotes)
+        {
+            m_strValue = strValue;
+        }
+        else
+        {
+            const MIchar *pFormat = "%s%s%s";
+            m_strValue = CMIUtilString::Format(pFormat, ms_constStrDblQuote.c_str(), strValue.c_str(), ms_constStrDblQuote.c_str());
+        }
+    }
+    else
+    {
+        const MIchar *pFormat = "%s%s";
+        m_strValue = CMIUtilString::Format(pFormat, ms_constStrDblQuote.c_str(), ms_constStrDblQuote.c_str());
+    }
 
-	return MIstatus::success;
-}
\ No newline at end of file
+    return MIstatus::success;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueConst.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueConst.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueConst.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueConst.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueConst.h
+// File:        MICmnMIValueConst.h
 //
-// Overview:	CMICmnMIValueConst interface.
+// Overview:    CMICmnMIValueConst interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,48 +25,48 @@
 #include "MICmnMIValue.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result class. Part of the CMICmnMIValueConstRecord
-//			set of objects.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content)
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"  
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Details: MI common code MI Result class. Part of the CMICmnMIValueConstRecord
+//          set of objects.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content)
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
 //
-//			The text formed in *this Result class is stripped of any '\n' characters.
+//          The text formed in *this Result class is stripped of any '\n' characters.
 //
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
-class CMICmnMIValueConst : public CMICmnMIValue 
+class CMICmnMIValueConst : public CMICmnMIValue
 {
-// Methods:
-public:
-	/* ctor */	CMICmnMIValueConst( const CMIUtilString & vString );
-	/* ctor */	CMICmnMIValueConst( const CMIUtilString & vString, const bool vbNoQuotes );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIValueConst( void );
-
-// Methods:
-private:
-	bool BuildConst( void );
-	
-// Attributes:
-private:
-	static const CMIUtilString	ms_constStrDblQuote;
-	//
-	CMIUtilString	m_strPartConst;
-	bool			m_bNoQuotes;		// True = return string not surrounded with quotes, false = use quotes
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIValueConst(const CMIUtilString &vString);
+    /* ctor */ CMICmnMIValueConst(const CMIUtilString &vString, const bool vbNoQuotes);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIValueConst(void);
+
+    // Methods:
+  private:
+    bool BuildConst(void);
+
+    // Attributes:
+  private:
+    static const CMIUtilString ms_constStrDblQuote;
+    //
+    CMIUtilString m_strPartConst;
+    bool m_bNoQuotes; // True = return string not surrounded with quotes, false = use quotes
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueList.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueList.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueList.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueList.h
+// File:        MICmnMIValueList.h
 //
-// Overview:	CMICmnMIValueList implementation.
+// Overview:    CMICmnMIValueList implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,180 +24,186 @@
 #include "MICmnResources.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueList constructor.
-// Type:	Method.
-// Args:	vbValueTypeList	- (R) True = yes value type list, false = result type list.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueList constructor.
+// Type:    Method.
+// Args:    vbValueTypeList - (R) True = yes value type list, false = result type list.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueList::CMICmnMIValueList( const bool vbValueTypeList )
+CMICmnMIValueList::CMICmnMIValueList(const bool vbValueTypeList)
 {
-	m_strValue = "[]";
+    m_strValue = "[]";
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueList constructor.
-//			Construct a results only list.
-//			return MIstatus::failure.
-// Type:	Method.
-// Args:	vResult	- (R) MI result object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueList constructor.
+//          Construct a results only list.
+//          return MIstatus::failure.
+// Type:    Method.
+// Args:    vResult - (R) MI result object.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueList::CMICmnMIValueList( const CMICmnMIValueResult & vResult )
+CMICmnMIValueList::CMICmnMIValueList(const CMICmnMIValueResult &vResult)
 {
-	m_strValue = vResult.GetString();
-	BuildList();
-	m_bJustConstructed = false;
+    m_strValue = vResult.GetString();
+    BuildList();
+    m_bJustConstructed = false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueList constructor.
-//			Construct a value only list.
-// Type:	Method.
-// Args:	vValue	- (R) MI value object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueList constructor.
+//          Construct a value only list.
+// Type:    Method.
+// Args:    vValue  - (R) MI value object.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueList::CMICmnMIValueList( const CMICmnMIValue & vValue )
+CMICmnMIValueList::CMICmnMIValueList(const CMICmnMIValue &vValue)
 {
-	m_strValue = vValue.GetString();
-	BuildList();
-	m_bJustConstructed = false;
+    m_strValue = vValue.GetString();
+    BuildList();
+    m_bJustConstructed = false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueList destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueList destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueList::~CMICmnMIValueList( void )
+CMICmnMIValueList::~CMICmnMIValueList(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the result value's mandatory data part, one tuple
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the result value's mandatory data part, one tuple
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueList::BuildList( void )
+bool
+CMICmnMIValueList::BuildList(void)
 {
-	const MIchar * pFormat = "[%s]";
-	m_strValue = CMIUtilString::Format( pFormat, m_strValue.c_str() );
-	
-	return MIstatus::success;
+    const MIchar *pFormat = "[%s]";
+    m_strValue = CMIUtilString::Format(pFormat, m_strValue.c_str());
+
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI result object to  the value list's of list is results. 
-//			Only result obejcts can be added to a list of result otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vResult	- (R) The MI result object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI result object to  the value list's of list is results.
+//          Only result obejcts can be added to a list of result otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vResult - (R) The MI result object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueList::Add( const CMICmnMIValueResult & vResult )
+bool
+CMICmnMIValueList::Add(const CMICmnMIValueResult &vResult)
 {
-	return BuildList( vResult );
+    return BuildList(vResult);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI value object to  the value list's of list is values.
-//			Only values objects can be added to a list of values otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vValue	- (R) The MI value object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI value object to  the value list's of list is values.
+//          Only values objects can be added to a list of values otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vValue  - (R) The MI value object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueList::Add( const CMICmnMIValue & vValue )
+bool
+CMICmnMIValueList::Add(const CMICmnMIValue &vValue)
 {
-	return BuildList( vValue );
+    return BuildList(vValue);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI result object to  the value list's of list is results. 
-//			Only result obejcts can be added to a list of result otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vResult	- (R) The MI result object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI result object to  the value list's of list is results.
+//          Only result obejcts can be added to a list of result otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vResult - (R) The MI result object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueList::BuildList( const CMICmnMIValueResult & vResult )
+bool
+CMICmnMIValueList::BuildList(const CMICmnMIValueResult &vResult)
 {
-	// Clear out the default "<Invalid>" text
-	if( m_bJustConstructed )
-	{
-		m_bJustConstructed = false;
-		m_strValue = vResult.GetString();
-		return BuildList();
-	}
+    // Clear out the default "<Invalid>" text
+    if (m_bJustConstructed)
+    {
+        m_bJustConstructed = false;
+        m_strValue = vResult.GetString();
+        return BuildList();
+    }
 
-	const CMIUtilString data( ExtractContentNoBrackets() );
-	const MIchar * pFormat = "[%s,%s]";
-	m_strValue = CMIUtilString::Format( pFormat, data.c_str(), vResult.GetString().c_str() );
+    const CMIUtilString data(ExtractContentNoBrackets());
+    const MIchar *pFormat = "[%s,%s]";
+    m_strValue = CMIUtilString::Format(pFormat, data.c_str(), vResult.GetString().c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI value object to  the value list's of list is values.
-//			Only values objects can be added to a list of values otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vValue	- (R) The MI value object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI value object to  the value list's of list is values.
+//          Only values objects can be added to a list of values otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vValue  - (R) The MI value object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueList::BuildList( const CMICmnMIValue & vValue )
+bool
+CMICmnMIValueList::BuildList(const CMICmnMIValue &vValue)
 {
-	// Clear out the default "<Invalid>" text
-	if( m_bJustConstructed )
-	{
-		m_bJustConstructed = false;
-		m_strValue = vValue.GetString();
-		return BuildList();
-	}
+    // Clear out the default "<Invalid>" text
+    if (m_bJustConstructed)
+    {
+        m_bJustConstructed = false;
+        m_strValue = vValue.GetString();
+        return BuildList();
+    }
 
-	const MIchar * pFormat = "[%s,%s]";
-	m_strValue = m_strValue.FindAndReplace( "[", "" );
-	m_strValue = m_strValue.FindAndReplace( "]", "" );	
-	m_strValue = CMIUtilString::Format( pFormat, m_strValue.c_str(), vValue.GetString().c_str() );
+    const MIchar *pFormat = "[%s,%s]";
+    m_strValue = m_strValue.FindAndReplace("[", "");
+    m_strValue = m_strValue.FindAndReplace("]", "");
+    m_strValue = CMIUtilString::Format(pFormat, m_strValue.c_str(), vValue.GetString().c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the contents of *this value object but without the outer most 
-//			brackets.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString - Data within the object.
-// Throws:	None.
+// Details: Retrieve the contents of *this value object but without the outer most
+//          brackets.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString - Data within the object.
+// Throws:  None.
 //--
-CMIUtilString CMICmnMIValueList::ExtractContentNoBrackets( void ) const
+CMIUtilString
+CMICmnMIValueList::ExtractContentNoBrackets(void) const
 {
-	CMIUtilString data( m_strValue );
+    CMIUtilString data(m_strValue);
+
+    if (data[0] == '[')
+    {
+        data = data.substr(1, data.length() - 1);
+    }
+    if (data[data.size() - 1] == ']')
+    {
+        data = data.substr(0, data.length() - 1);
+    }
 
-	if( data[ 0 ] == '[' )
-	{
-		data = data.substr( 1, data.length() - 1 );
-	}
-	if( data[ data.size() - 1 ] == ']' )
-	{
-		data = data.substr( 0, data.length() - 1 );
-	}
-		
-	return data;
+    return data;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueList.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueList.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueList.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueList.h
+// File:        MICmnMIValueList.h
 //
-// Overview:	CMICmnMIValueList interface.
+// Overview:    CMICmnMIValueList interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -26,45 +26,45 @@
 #include "MICmnMIValueResult.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result class. Part of the CMICmnMIValueListRecord
-//			set of objects.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content)
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"  
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+// Details: MI common code MI Result class. Part of the CMICmnMIValueListRecord
+//          set of objects.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content)
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIValueList : public CMICmnMIValue
 {
-// Methods:
-public:
-	/* ctor */	CMICmnMIValueList( const bool vbValueTypeList );
-	/* ctor */	CMICmnMIValueList( const CMICmnMIValueResult & vResult );
-	/* ctor */	CMICmnMIValueList( const CMICmnMIValue & vValue );
-	//
-	bool			Add( const CMICmnMIValueResult & vResult );
-	bool			Add( const CMICmnMIValue & vValue );
-	CMIUtilString	ExtractContentNoBrackets( void ) const; 
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIValueList( void );
-
-// Methods:
-private:
-	bool BuildList( void );
-	bool BuildList( const CMICmnMIValueResult & vResult );
-	bool BuildList( const CMICmnMIValue & vResult );
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIValueList(const bool vbValueTypeList);
+    /* ctor */ CMICmnMIValueList(const CMICmnMIValueResult &vResult);
+    /* ctor */ CMICmnMIValueList(const CMICmnMIValue &vValue);
+    //
+    bool Add(const CMICmnMIValueResult &vResult);
+    bool Add(const CMICmnMIValue &vValue);
+    CMIUtilString ExtractContentNoBrackets(void) const;
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIValueList(void);
+
+    // Methods:
+  private:
+    bool BuildList(void);
+    bool BuildList(const CMICmnMIValueResult &vResult);
+    bool BuildList(const CMICmnMIValue &vResult);
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueResult.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueResult.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueResult.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIResult.h
+// File:        MICmnMIResult.h
 //
-// Overview:	CMICmnMIValueResult implementation.
+// Overview:    CMICmnMIValueResult implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -24,118 +24,121 @@
 #include "MICmnResources.h"
 
 // Instantiations:
-const CMIUtilString CMICmnMIValueResult::ms_constStrEqual( "=" );
+const CMIUtilString CMICmnMIValueResult::ms_constStrEqual("=");
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueResult constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueResult constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueResult::CMICmnMIValueResult( void )
-:	m_bEmptyConstruction( true )
+CMICmnMIValueResult::CMICmnMIValueResult(void)
+    : m_bEmptyConstruction(true)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueResult constructor.
-// Type:	Method.
-// Args:	vrVariable	- (R) MI value's name.
-//			vrValue		- (R) The MI value.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueResult constructor.
+// Type:    Method.
+// Args:    vrVariable  - (R) MI value's name.
+//          vrValue     - (R) The MI value.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueResult::CMICmnMIValueResult( const CMIUtilString & vrVariable, const CMICmnMIValue & vrValue )
-:	m_strPartVariable( vrVariable )
-,	m_partMIValue( vrValue )
-,	m_bEmptyConstruction( false )
-,	m_bUseSpacing( false )
+CMICmnMIValueResult::CMICmnMIValueResult(const CMIUtilString &vrVariable, const CMICmnMIValue &vrValue)
+    : m_strPartVariable(vrVariable)
+    , m_partMIValue(vrValue)
+    , m_bEmptyConstruction(false)
+    , m_bUseSpacing(false)
 {
-	BuildResult();
+    BuildResult();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueResult constructor.
-// Type:	Method.
-// Args:	vrVariable		- (R) MI value's name.
-//			vrValue			- (R) The MI value.
-//			vbUseSpacing	- (R) True = put space seperators into the string, false = no spaces used.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueResult constructor.
+// Type:    Method.
+// Args:    vrVariable      - (R) MI value's name.
+//          vrValue         - (R) The MI value.
+//          vbUseSpacing    - (R) True = put space seperators into the string, false = no spaces used.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueResult::CMICmnMIValueResult( const CMIUtilString & vrVariable, const CMICmnMIValue & vrValue, const bool vbUseSpacing )
-:	m_strPartVariable( vrVariable )
-,	m_partMIValue( vrValue )
-,	m_bEmptyConstruction( false )
-,	m_bUseSpacing( vbUseSpacing )
+CMICmnMIValueResult::CMICmnMIValueResult(const CMIUtilString &vrVariable, const CMICmnMIValue &vrValue, const bool vbUseSpacing)
+    : m_strPartVariable(vrVariable)
+    , m_partMIValue(vrValue)
+    , m_bEmptyConstruction(false)
+    , m_bUseSpacing(vbUseSpacing)
 {
-	BuildResult();
+    BuildResult();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueResult destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueResult destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueResult::~CMICmnMIValueResult( void )
+CMICmnMIValueResult::~CMICmnMIValueResult(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the MI value result string.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the MI value result string.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueResult::BuildResult( void )
+bool
+CMICmnMIValueResult::BuildResult(void)
 {
-	const MIchar * pFormat = m_bUseSpacing ? "%s %s %s" : "%s%s%s";
-	m_strValue = CMIUtilString::Format( pFormat, m_strPartVariable.c_str(), ms_constStrEqual.c_str(), m_partMIValue.GetString().c_str() );
+    const MIchar *pFormat = m_bUseSpacing ? "%s %s %s" : "%s%s%s";
+    m_strValue = CMIUtilString::Format(pFormat, m_strPartVariable.c_str(), ms_constStrEqual.c_str(), m_partMIValue.GetString().c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the MI value result string.
-// Type:	Method.
-// Args:	vrVariable	- (R) MI value's name.
-//			vrValue		- (R) The MI value.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the MI value result string.
+// Type:    Method.
+// Args:    vrVariable  - (R) MI value's name.
+//          vrValue     - (R) The MI value.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueResult::BuildResult( const CMIUtilString & vVariable, const CMICmnMIValue & vValue )
+bool
+CMICmnMIValueResult::BuildResult(const CMIUtilString &vVariable, const CMICmnMIValue &vValue)
 {
-	const MIchar * pFormat =  m_bUseSpacing ? "%s, %s %s %s" : "%s,%s%s%s";
-	m_strValue = CMIUtilString::Format( pFormat, m_strValue.c_str(), vVariable.c_str(), ms_constStrEqual.c_str(), vValue.GetString().c_str() );
+    const MIchar *pFormat = m_bUseSpacing ? "%s, %s %s %s" : "%s,%s%s%s";
+    m_strValue =
+        CMIUtilString::Format(pFormat, m_strValue.c_str(), vVariable.c_str(), ms_constStrEqual.c_str(), vValue.GetString().c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Append another MI value object to *this MI value result.
-// Type:	Method.
-// Args:	vrVariable	- (R) MI value's name.
-//			vrValue		- (R) The MI value.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Append another MI value object to *this MI value result.
+// Type:    Method.
+// Args:    vrVariable  - (R) MI value's name.
+//          vrValue     - (R) The MI value.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueResult::Add( const CMIUtilString & vrVariable, const CMICmnMIValue & vrValue )
+bool
+CMICmnMIValueResult::Add(const CMIUtilString &vrVariable, const CMICmnMIValue &vrValue)
 {
-	if( !m_bEmptyConstruction )
-		return BuildResult( vrVariable, vrValue );
-	else
-	{
-		m_bEmptyConstruction = false;
-		m_strPartVariable = vrVariable;
-		m_partMIValue = vrValue;
-		return BuildResult();
-	}	
+    if (!m_bEmptyConstruction)
+        return BuildResult(vrVariable, vrValue);
+    else
+    {
+        m_bEmptyConstruction = false;
+        m_strPartVariable = vrVariable;
+        m_partMIValue = vrValue;
+        return BuildResult();
+    }
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIResult.h
+// File:        MICmnMIResult.h
 //
-// Overview:	CMICmnMIValueResult interface.
+// Overview:    CMICmnMIValueResult interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -25,51 +25,51 @@
 #include "MICmnMIValue.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result class. Part of the CMICmnMIValueResultRecord
-//			set of objects.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content)
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"  
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+// Details: MI common code MI Result class. Part of the CMICmnMIValueResultRecord
+//          set of objects.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content)
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIValueResult : public CMICmnMIValue
 {
-// Methods:
-public:
-	/* ctor */	CMICmnMIValueResult( void );
-	/* ctor */	CMICmnMIValueResult( const CMIUtilString & vVariable, const CMICmnMIValue & vValue );
-	/* ctor */	CMICmnMIValueResult( const CMIUtilString & vVariable, const CMICmnMIValue & vValue, const bool vbUseSpacing );
-	//
-	bool	Add( const CMIUtilString & vVariable, const CMICmnMIValue & vValue );
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIValueResult( void );
-
-// Methods:
-private:
-	bool	BuildResult( void );
-	bool	BuildResult( const CMIUtilString & vVariable, const CMICmnMIValue & vValue );
-
-// Attributes:
-private:
-	static const CMIUtilString	ms_constStrEqual;
-	//
-	CMIUtilString	m_strPartVariable;
-	CMICmnMIValue	m_partMIValue;
-	bool			m_bEmptyConstruction;	// True = *this object used constructor with no parameters, false = constructor with parameters
-	bool			m_bUseSpacing;			// True = put space seperators into the string, false = no spaces used
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIValueResult(void);
+    /* ctor */ CMICmnMIValueResult(const CMIUtilString &vVariable, const CMICmnMIValue &vValue);
+    /* ctor */ CMICmnMIValueResult(const CMIUtilString &vVariable, const CMICmnMIValue &vValue, const bool vbUseSpacing);
+    //
+    bool Add(const CMIUtilString &vVariable, const CMICmnMIValue &vValue);
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIValueResult(void);
+
+    // Methods:
+  private:
+    bool BuildResult(void);
+    bool BuildResult(const CMIUtilString &vVariable, const CMICmnMIValue &vValue);
+
+    // Attributes:
+  private:
+    static const CMIUtilString ms_constStrEqual;
+    //
+    CMIUtilString m_strPartVariable;
+    CMICmnMIValue m_partMIValue;
+    bool m_bEmptyConstruction; // True = *this object used constructor with no parameters, false = constructor with parameters
+    bool m_bUseSpacing;        // True = put space seperators into the string, false = no spaces used
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.cpp Mon Nov 17 12:06:21 2014
@@ -8,220 +8,225 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueTuple.h
+// File:        MICmnMIValueTuple.h
 //
-// Overview:	CMICmnMIValueTuple implementation.
+// Overview:    CMICmnMIValueTuple implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
 #include "MICmnMIValueTuple.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueTuple constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueTuple constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueTuple::CMICmnMIValueTuple( void )
-:	m_bSpaceAfterComma( false )
+CMICmnMIValueTuple::CMICmnMIValueTuple(void)
+    : m_bSpaceAfterComma(false)
 {
-	m_strValue = "{}";
+    m_strValue = "{}";
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueTuple constructor.
-// Type:	Method.
-// Args:	vResult	- (R) MI result object.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueTuple constructor.
+// Type:    Method.
+// Args:    vResult - (R) MI result object.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueTuple::CMICmnMIValueTuple( const CMICmnMIValueResult & vResult )
-:	m_bSpaceAfterComma( false )
+CMICmnMIValueTuple::CMICmnMIValueTuple(const CMICmnMIValueResult &vResult)
+    : m_bSpaceAfterComma(false)
 {
-	m_strValue = vResult.GetString();
-	BuildTuple();
-	m_bJustConstructed = false;
+    m_strValue = vResult.GetString();
+    BuildTuple();
+    m_bJustConstructed = false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueTuple constructor.
-// Type:	Method.
-// Args:	vResult			- (R) MI result object.
-//			vbUseSpacing	- (R) True = put space seperators into the string, false = no spaces used.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueTuple constructor.
+// Type:    Method.
+// Args:    vResult         - (R) MI result object.
+//          vbUseSpacing    - (R) True = put space seperators into the string, false = no spaces used.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueTuple::CMICmnMIValueTuple( const CMICmnMIValueResult & vResult, const bool vbUseSpacing )
-:	m_bSpaceAfterComma( vbUseSpacing )
+CMICmnMIValueTuple::CMICmnMIValueTuple(const CMICmnMIValueResult &vResult, const bool vbUseSpacing)
+    : m_bSpaceAfterComma(vbUseSpacing)
 {
-	m_strValue = vResult.GetString();
-	BuildTuple();
-	m_bJustConstructed = false;
+    m_strValue = vResult.GetString();
+    BuildTuple();
+    m_bJustConstructed = false;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnMIValueTuple destructor.
-// Type:	Overrideable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnMIValueTuple destructor.
+// Type:    Overrideable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnMIValueTuple::~CMICmnMIValueTuple( void )
+CMICmnMIValueTuple::~CMICmnMIValueTuple(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Build the result value's mandatory data part, one tuple
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Build the result value's mandatory data part, one tuple
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::BuildTuple( void )
+bool
+CMICmnMIValueTuple::BuildTuple(void)
 {
-	const MIchar * pFormat = "{%s}";
-	m_strValue = CMIUtilString::Format( pFormat, m_strValue.c_str() );
-		
-	return MIstatus::success;
+    const MIchar *pFormat = "{%s}";
+    m_strValue = CMIUtilString::Format(pFormat, m_strValue.c_str());
+
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI result object to the value's list of tuples. 
-// Type:	Method.
-// Args:	vResult	- (R) The MI result object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI result object to the value's list of tuples.
+// Type:    Method.
+// Args:    vResult - (R) The MI result object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::BuildTuple( const CMICmnMIValueResult & vResult )
+bool
+CMICmnMIValueTuple::BuildTuple(const CMICmnMIValueResult &vResult)
 {
-	// Clear out the default "<Invalid>" text
-	if( m_bJustConstructed )
-	{
-		m_bJustConstructed = false;
-		m_strValue = vResult.GetString();
-		return BuildTuple();
-	}
+    // Clear out the default "<Invalid>" text
+    if (m_bJustConstructed)
+    {
+        m_bJustConstructed = false;
+        m_strValue = vResult.GetString();
+        return BuildTuple();
+    }
+
+    if (m_strValue[0] == '{')
+    {
+        m_strValue = m_strValue.substr(1, m_strValue.size() - 1);
+    }
+    if (m_strValue[m_strValue.size() - 1] == '}')
+    {
+        m_strValue = m_strValue.substr(0, m_strValue.size() - 1);
+    }
 
-	if( m_strValue[ 0 ] == '{' )
-	{
-		m_strValue = m_strValue.substr( 1, m_strValue.size() - 1 );
-	}
-	if( m_strValue[ m_strValue.size() - 1 ] == '}' )
-	{
-		m_strValue = m_strValue.substr( 0, m_strValue.size() - 1 );
-	}
-	
-	const MIchar * pFormat = m_bSpaceAfterComma ? "{%s, %s}" : "{%s,%s}";
-	m_strValue = CMIUtilString::Format( pFormat, m_strValue.c_str(), vResult.GetString().c_str() );
+    const MIchar *pFormat = m_bSpaceAfterComma ? "{%s, %s}" : "{%s,%s}";
+    m_strValue = CMIUtilString::Format(pFormat, m_strValue.c_str(), vResult.GetString().c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add string value to the value's list of tuples. 
-// Type:	Method.
-// Args:	vValue	- (R) The string object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add string value to the value's list of tuples.
+// Type:    Method.
+// Args:    vValue  - (R) The string object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::BuildTuple( const CMIUtilString & vValue )
+bool
+CMICmnMIValueTuple::BuildTuple(const CMIUtilString &vValue)
 {
-	// Clear out the default "<Invalid>" text
-	if( m_bJustConstructed )
-	{
-		m_bJustConstructed = false;
-		m_strValue = vValue;
-		return BuildTuple();
-	}
+    // Clear out the default "<Invalid>" text
+    if (m_bJustConstructed)
+    {
+        m_bJustConstructed = false;
+        m_strValue = vValue;
+        return BuildTuple();
+    }
 
-	const CMIUtilString data( ExtractContentNoBrackets() );
-	const MIchar * pFormat = m_bSpaceAfterComma ? "{%s, %s}" : "{%s,%s}";
-	m_strValue = CMIUtilString::Format( pFormat, data.c_str(), vValue.c_str() );
+    const CMIUtilString data(ExtractContentNoBrackets());
+    const MIchar *pFormat = m_bSpaceAfterComma ? "{%s, %s}" : "{%s,%s}";
+    m_strValue = CMIUtilString::Format(pFormat, data.c_str(), vValue.c_str());
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI value object to  the value list's of list is values.
-//			Only values objects can be added to a list of values otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vValue	- (R) The MI value object.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI value object to  the value list's of list is values.
+//          Only values objects can be added to a list of values otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vValue  - (R) The MI value object.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::Add( const CMICmnMIValueResult & vResult )
+bool
+CMICmnMIValueTuple::Add(const CMICmnMIValueResult &vResult)
 {
-	return BuildTuple( vResult );
+    return BuildTuple(vResult);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI value object to  the value list's of list is values.
-//			Only values objects can be added to a list of values otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vValue			- (R) The MI value object.
-//			vbUseSpacing	- (R) True = put space seperators into the string, false = no spaces used.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI value object to  the value list's of list is values.
+//          Only values objects can be added to a list of values otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vValue          - (R) The MI value object.
+//          vbUseSpacing    - (R) True = put space seperators into the string, false = no spaces used.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::Add( const CMICmnMIValueResult & vResult, const bool vbUseSpacing )
+bool
+CMICmnMIValueTuple::Add(const CMICmnMIValueResult &vResult, const bool vbUseSpacing)
 {
-	m_bSpaceAfterComma = vbUseSpacing;
-	return BuildTuple( vResult );
+    m_bSpaceAfterComma = vbUseSpacing;
+    return BuildTuple(vResult);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Add another MI value object to  the value list's of list is values.
-//			Only values objects can be added to a list of values otherwise this function 
-//			will return MIstatus::failure.
-// Type:	Method.
-// Args:	vValue			- (R) The MI value object.
-//			vbUseSpacing	- (R) True = put space seperators into the string, false = no spaces used.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Add another MI value object to  the value list's of list is values.
+//          Only values objects can be added to a list of values otherwise this function
+//          will return MIstatus::failure.
+// Type:    Method.
+// Args:    vValue          - (R) The MI value object.
+//          vbUseSpacing    - (R) True = put space seperators into the string, false = no spaces used.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnMIValueTuple::Add( const CMICmnMIValueConst & vValue, const bool vbUseSpacing )
+bool
+CMICmnMIValueTuple::Add(const CMICmnMIValueConst &vValue, const bool vbUseSpacing)
 {
-	m_bSpaceAfterComma = vbUseSpacing;
-	return BuildTuple( vValue.GetString() );
+    m_bSpaceAfterComma = vbUseSpacing;
+    return BuildTuple(vValue.GetString());
 }
 
-
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the contents of *this value object but without the outer most 
-//			brackets.
-// Type:	Method.
-// Args:	None.
-// Return:	CMIUtilString - Data within the object.
-// Throws:	None.
+// Details: Retrieve the contents of *this value object but without the outer most
+//          brackets.
+// Type:    Method.
+// Args:    None.
+// Return:  CMIUtilString - Data within the object.
+// Throws:  None.
 //--
-CMIUtilString CMICmnMIValueTuple::ExtractContentNoBrackets( void ) const
+CMIUtilString
+CMICmnMIValueTuple::ExtractContentNoBrackets(void) const
 {
-	CMIUtilString data( m_strValue );
+    CMIUtilString data(m_strValue);
 
-	if( data[ 0 ] == '{' )
-	{
-		data = data.substr( 1, data.length() - 1 );
-	}
-	if( data[ data.size() - 1 ] == '}' )
-	{
-		data = data.substr( 0, data.length() - 1 );
-	}
-		
-	return data;
-}
+    if (data[0] == '{')
+    {
+        data = data.substr(1, data.length() - 1);
+    }
+    if (data[data.size() - 1] == '}')
+    {
+        data = data.substr(0, data.length() - 1);
+    }
 
+    return data;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnMIValueTuple.h
+// File:        MICmnMIValueTuple.h
 //
-// Overview:	CMICmnMIValueTuple interface.
+// Overview:    CMICmnMIValueTuple interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -27,50 +27,50 @@
 #include "MICmnMIValueConst.h"
 
 //++ ============================================================================
-// Details:	MI common code MI Result class. Part of the CMICmnMIValueTupleRecord
-//			set of objects.
-//			The syntax is as follows:
-//			result-record ==>  [ token ] "^" result-class ( "," result )* nl 
-//			token = any sequence of digits
-//			* = 0 to many
-//			nl = CR | CR_LF
-//			result-class ==> "done" | "running" | "connected" | "error" | "exit" 
-//			result ==> variable "=" value
-//			value ==> const | tuple | list  
-//			const ==> c-string (7 bit iso c string content)
-//			tuple ==>  "{}" | "{" result ( "," result )* "}"  
-//			list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"  
-//			More information see: 
-//			http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
-// Gotchas:	None.
-// Authors:	Illya Rudkin 24/02/2014.
-// Changes:	None.
+// Details: MI common code MI Result class. Part of the CMICmnMIValueTupleRecord
+//          set of objects.
+//          The syntax is as follows:
+//          result-record ==>  [ token ] "^" result-class ( "," result )* nl
+//          token = any sequence of digits
+//          * = 0 to many
+//          nl = CR | CR_LF
+//          result-class ==> "done" | "running" | "connected" | "error" | "exit"
+//          result ==> variable "=" value
+//          value ==> const | tuple | list
+//          const ==> c-string (7 bit iso c string content)
+//          tuple ==>  "{}" | "{" result ( "," result )* "}"
+//          list ==>  "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+//          More information see:
+//          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html
+// Gotchas: None.
+// Authors: Illya Rudkin 24/02/2014.
+// Changes: None.
 //--
 class CMICmnMIValueTuple : public CMICmnMIValue
 {
-// Methods:
-public:
-	/* ctor */	CMICmnMIValueTuple( void );
-	/* ctor */	CMICmnMIValueTuple( const CMICmnMIValueResult & vResult );
-	/* ctor */	CMICmnMIValueTuple( const CMICmnMIValueResult & vResult, const bool vbUseSpacing );
-	//
-	bool			Add( const CMICmnMIValueResult & vResult );
-	bool			Add( const CMICmnMIValueResult & vResult, const bool vbUseSpacing );
-	bool			Add( const CMICmnMIValueConst & vValue, const bool vbUseSpacing );
-	CMIUtilString	ExtractContentNoBrackets( void ) const; 
-
-// Overridden:
-public:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnMIValueTuple( void );
-
-// Methods:
-private:
-	bool BuildTuple( void );
-	bool BuildTuple( const CMICmnMIValueResult & vResult );
-	bool BuildTuple( const CMIUtilString & vValue );
-
-// Attributes:
-private:
-	bool m_bSpaceAfterComma;	// True = put space seperators into the string, false = no spaces used
+    // Methods:
+  public:
+    /* ctor */ CMICmnMIValueTuple(void);
+    /* ctor */ CMICmnMIValueTuple(const CMICmnMIValueResult &vResult);
+    /* ctor */ CMICmnMIValueTuple(const CMICmnMIValueResult &vResult, const bool vbUseSpacing);
+    //
+    bool Add(const CMICmnMIValueResult &vResult);
+    bool Add(const CMICmnMIValueResult &vResult, const bool vbUseSpacing);
+    bool Add(const CMICmnMIValueConst &vValue, const bool vbUseSpacing);
+    CMIUtilString ExtractContentNoBrackets(void) const;
+
+    // Overridden:
+  public:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnMIValueTuple(void);
+
+    // Methods:
+  private:
+    bool BuildTuple(void);
+    bool BuildTuple(const CMICmnMIValueResult &vResult);
+    bool BuildTuple(const CMIUtilString &vValue);
+
+    // Attributes:
+  private:
+    bool m_bSpaceAfterComma; // True = put space seperators into the string, false = no spaces used
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnResources.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnResources.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnResources.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnResources.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnResources.cpp
+// File:        MICmnResources.cpp
 //
-// Overview:	CMICmnResources implementation.
+// Overview:    CMICmnResources implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third party headers
@@ -26,384 +26,411 @@
 #include "MICmnResources.h"
 
 // Instantiations:
-const CMICmnResources::SRsrcTextData	CMICmnResources::ms_pResourceId2TextData[] = 
-{
-	{ IDS_PROJNAME,								"LLDB Machine Interface Driver (MI) All rights reserved" },
-	{ IDS_MI_VERSION_DESCRIPTION_DEBUG,			"Version: 1.0.0.9 (Debug)" }, // See version history in MIDriverMain.cpp
-	{ IDS_MI_VERSION_DESCRIPTION,				"Version: 1.0.0.9" },
-	{ IDS_MI_APPNAME_SHORT,						"MI" },
-	{ IDS_MI_APPNAME_LONG,						"Machine Interface Driver" },
-	{ IDS_MI_APP_FILEPATHNAME,					"Application: %s" },
-	{ IDS_MI_APP_ARGS,							"Command line args: " },
-	{ IDE_MI_VERSION_GDB,						"Version: GNU gdb (GDB) 7.4 \n(This is a MI stub on top of LLDB and not GDB)\nAll rights reserved.\n" }, // *** Eclipse needs this exactly!!
-	{ IDS_UTIL_FILE_ERR_INVALID_PATHNAME,		"File Handler. Invalid file name path" },
-	{ IDS_UTIL_FILE_ERR_OPENING_FILE,			"File Handler. Error %s opening '%s'" },
-	{ IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN,	"File Handler. Unknown error opening '%s'" },
-	{ IDE_UTIL_FILE_ERR_WRITING_FILE,			"File Handler. Error %s writing '%s'" },
-	{ IDE_UTIL_FILE_ERR_WRITING_NOTOPEN,		"File Handler. File '%s' not open for write" },
-	{ IDS_RESOURCES_ERR_STRING_NOT_FOUND,		"Resources. String (%d) not found in resources" },
-	{ IDS_RESOURCES_ERR_STRING_TABLE_INVALID,	"Resources. String resource table is not set up" },
-	{ IDS_MI_CLIENT_MSG,						"Client message: \"%s\"" },
-	{ IDS_LOG_MSG_CREATION_DATE,				"Creation date %s time %s%s" },
-	{ IDS_LOG_MSG_FILE_LOGGER_PATH,				"File logger path: %s%s" },	
-	{ IDS_LOG_MSG_VERSION,						"Version: %s%s" },
-	{ IDS_LOG_ERR_FILE_LOGGER_DISABLED,			"Log. File logger temporarily disabled due to file error '%s'" },
-	{ IDS_LOG_MEDIUM_ERR_INIT,					"Log. Medium '%s' initialise failed. %s" },
-	{ IDS_LOG_MEDIUM_ERR_WRITE_ANY,				"Log. Failed to write log data to any medium." },
-	{ IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL,		"Log. One or mediums failed writing log data." },
-	{ IDS_MEDIUMFILE_NAME,						"File" },
-	{ IDS_MEDIUMFILE_ERR_INVALID_PATH,			"<Invalid - not set>" },
-	{ IDS_MEDIUMFILE_ERR_FILE_HEADER,			"<Invalid - header not set>" },
-	{ IDS_MEDIUMFILE_NAME_LOG,					"File medium. %s" },
-	{ IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS,	"File Medium. Failed to retrieve the system/executable path for the Log file" },
-	{ IDE_OS_ERR_UNKNOWN,						"Unknown OS error" },
-	{ IDE_OS_ERR_RETRIEVING,					"Unabled to retrieve OS error message" },
-	{ IDS_DRIVERMGR_DRIVER_ERR_INIT,			"Driver Manager. Driver '%s' (ID:'%s') initialise failed. %s" },
-	{ IDE_MEDIUMSTDERR_NAME,					"Stderr" },
-	{ IDE_MEDIUMSTDOUT_NAME,					"Stdout" },
-	{ IDE_MI_APP_EXIT_OK,						"Program exited OK" },
-	{ IDE_MI_APP_EXIT_WITH_PROBLEM,				"Program exited with a problem, see '%s' file" },	
-	{ IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG,		"Program exited with a problem, the application's log file '%s' was disabled" },	
-	{ IDE_MI_APP_DESCRIPTION,					"Description:\nThe Machine Interface Driver (MI Driver) is a stand alone executable\nthat either be used via a client i.e. Eclipse or directly from the command\nline. It processes MI commands, actions those commands using the internal\ndebugger then forms MI response formatted text which is returned to the\nclient." },		
-	{ IDE_MI_APP_INFORMATION,					"Information:\nCurrent limitations. The MI Driver currently only handles remote target\ndebugging. Local debugging has not been implemented. The MI Driver has\nbeen designed primarily to be used with Eclipse Juno and a custom plugin.\nThe custom plugin is not necessary to operate the MI Driver." },		
-	{ IDE_MI_APP_ARG_USAGE,						"\nMI driver usage:\n\n\tlldb-mi [--longOption] [-s hortOption] [executeable]\n\n[] = optional argument." },
-	{ IDE_MI_APP_ARG_HELP,						"-h\n--help\n\tPrints out usage information for the MI debugger. Exit the MI\n\tDriver immediately." },
-	{ IDE_MI_APP_ARG_VERSION,					"--version\n\tPrints out GNU (gdb) version information. Exit the MI Driver\n\timmediately." },
-	{ IDE_MI_APP_ARG_VERSION_LONG,				"--versionLong\n\tPrints out MI Driver version information. Exit the MI Driver\n\timmediately." },
-	{ IDE_MI_APP_ARG_INTERPRETER,				"--interpreter\n\tUse the MI Driver for the debugger (MI mode)(Default is the\n\tLLDB driver). Any LLDB command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. (Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified by the driver client i.e. Eclipse.\n\tCannot specify an executable with this option, use --executable." },
-	{ IDE_MI_APP_ARG_EXECUTEABLE,				"--executable\n\tUse the MI Driver in MI mode for the debugging the specified\n\texecutable. Any LLDB command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. (Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified from the command line." },
-	{ IDE_MI_APP_ARG_NO_APP_LOG,				"--noLog\n\tUse this argument to tell the MI Driver not to update it's log\n\tfile '%s'." },
-	{ IDE_MI_APP_ARG_EXAMPLE,					"Example MI command:\n\t3-info-gdb-mi-command gdb-set\n\t3^done,command={exists=\"true\"}" },
-	{ IDE_MI_APP_ARG_EXECUTABLE,				"executable (NOT IMPLEMENTED)\n\tThe file path to the executable i.e. '\"C:\\My Dev\\foo.exe\"'." },
-	{ IDS_STDIN_ERR_INVALID_PROMPT,				"Stdin. Invalid prompt description '%s'" },
-	{ IDS_STDIN_ERR_THREAD_CREATION_FAILED,		"Stdin. Thread creation failed '%s'" },
-	{ IDS_STDIN_ERR_THREAD_DELETE,				"Stdin. Thread failed to delete '%s'" },
-	{ IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE,		"Stdin. Peeking on stdin stream '%s'" },
-	{ IDS_STDIN_INPUT_CTRL_CHARS,				"Stdin. Receive characters not handled as a command: " },	
-	{ IDS_CMD_QUIT_HELP,						"MI Driver Command: quit\n\tExit the MI Driver application." },
-	{ IDS_THREADMGR_ERR_THREAD_ID_INVALID,		"Thread Mgr. Thread ID '%s' is not valid" },
-	{ IDS_THREADMGR_ERR_THREAD_FAIL_CREATE,		"Thread Mgr: Failed to create thread '%s'" },
-	{ IDS_THREADMGR_ERR_THREAD_ID_NOT_FOUND,	"Thread Mgr: Thread with ID '%s' not found" },
-	{ IDS_THREADMGR_ERR_THREAD_STILL_ALIVE,     "Thread Mgr: The thread(s) are still alive at Thread Mgr shutdown: %s" },
-	{ IDS_FALLTHRU_DRIVER_CMD_RECEIVED,			"Fall Thru Driver. Received command '%s'. Is was %shandled" },	
-	{ IDS_CMDFACTORY_ERR_INVALID_CMD_NAME,		"Command factory. MI command name '%s' is invalid" },	
-	{ IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN,		"Command factory. Command creation function invalid for command '%s'. Does function exist? Pointer assigned to it?" },	
-	{ IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED,	"Command factory. Command '%s' not registered" },
-	{ IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED,		"Command factory. Command '%s' by that name already registered" },
-	{ IDS_CMDMGR_ERR_CMD_FAILED_CREATE,			"Command manager. Command creation failed. %s" },
-	{ IDS_CMDMGR_ERR_CMD_INVOKER,				"Command manager. %s " },
-	{ IDS_PROCESS_SIGNAL_RECEIVED,				"Process signal. Application received signal '%s' (%d)" },
-	{ IDS_MI_INIT_ERR_LOG,						"Log. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_RESOURCES,				"Resources. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_INIT,						"Driver. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_STREAMSTDIN,				"Stdin. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER,	"Stdin. The OS specific stdin stream handler has not been specified for this OS" },
-	{ IDS_MI_INIT_ERR_OS_STDIN_HANDLER,			"Stdin handler. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_STREAMSTDOUT,				"Stdout. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_STREAMSTDERR,				"Stderr. Error occurred during initialisation %s" },
-	{ IDS_MI_INIT_ERR_FALLTHRUDRIVER,			"Fall Through Driver. Error occurred during initialisation %s" },		
-	{ IDS_MI_INIT_ERR_THREADMGR,				"Thread Mgr. Error occurred during initialisation %s" },		
-	{ IDS_MI_INIT_ERR_CMDINTERPRETER,			"Command interpreter. %s" },
-	{ IDS_MI_INIT_ERR_CMDMGR,					"Command manager. %s" },
-	{ IDS_MI_INIT_ERR_CMDFACTORY,				"Command factory. %s" },
-	{ IDS_MI_INIT_ERR_CMDINVOKER,				"Command invoker. %s" },
-	{ IDS_MI_INIT_ERR_CMDMONITOR,				"Command monitor. %s" },
-	{ IDS_MI_INIT_ERR_LLDBDEBUGGER,				"LLDB Debugger. %s" },
-	{ IDS_MI_INIT_ERR_DRIVERMGR,				"Driver manager. %s" },
-	{ IDS_MI_INIT_ERR_DRIVER,					"Driver. %s" },
-	{ IDS_MI_INIT_ERR_OUTOFBANDHANDLER,			"Out-of-band handler. %s " },		
-	{ IDS_MI_INIT_ERR_DEBUGSESSIONINFO,			"LLDB debug session info. %s " },
-	{ IDS_MI_INIT_ERR_THREADMANAGER,			"Unable to init thread manager." },
-	{ IDS_MI_INIT_ERR_CLIENT_USING_DRIVER,		"Initialising the client to this driver failed." },
-	{ IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION,      "Initialising a local debug session failed." }, 
-	{ IDS_CODE_ERR_INVALID_PARAMETER_VALUE,		"Code. Invalid parameter passed to function '%s'" },
-	{ IDS_CODE_ERR_INVALID_PARAM_NULL_POINTER,	"Code. NULL pointer passes as a parameter to function '%s'" },
-	{ IDS_CODE_ERR_INVALID_ENUMERATION_VALUE,	"Code. Invalid enumeration value encountered in function '%s'" },
-	{ IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER,		"LLDB Debugger. LLDB Listener is not valid", },
-	{ IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER,		"LLDB Debugger. LLDB Debugger is not valid", },
-	{ IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER,		"LLDB Debugger. CMIDriverBase derived driver needs to be set prior to CMICmnLLDBDDebugger initialisation" },
-	{ IDS_LLDBDEBUGGER_ERR_STARTLISTENER,		"LLDB Debugger. Starting listening events for '%s' failed" },
-	{ IDS_LLDBDEBUGGER_ERR_THREADCREATIONFAIL,	"LLDB Debugger. Thread creation failed '%s'" },
-	{ IDS_LLDBDEBUGGER_ERR_THREAD_DELETE,		"LLDB Debugger. Thread failed to delete '%s'" },
-	{ IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER,	"LLDB Debugger. Invalid SB broadcaster class name '%s' " },
-	{ IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME,	"LLDB Debugger. Invalid client name '%s' " },
-	{ IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD,	"LLDB Debugger. Client name '%s' not registered for listening events" },
-	{ IDS_LLDBDEBUGGER_ERR_STOPLISTENER,		"LLDB Debugger. Failure occurred stopping event for client '%s' SBBroadcaster '%s'" },
-	{ IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME,	"LLDB Debugger. Broardcaster's name '%s' is not valid" },
-	{ IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT,		"LLDB Debugger. Unhandled event '%s'" },
-	{ IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT,		"LLDB Out-of-band. Handling event for '%s', an event enumeration '%d' not recognised" },
-	{ IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID,	"LLDB Out-of-band. Invalid '%s' in '%s'" },
-	{ IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND,		"LLDB Out-of-band. %s. Breakpoint information for breakpoint ID %d not found" },
-	{ IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET,		"LLDB Out-of-band. %s. Failed to retrieve breakpoint information for for breakpoint ID %d" },
-	{ IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET,		"LLDB Out-of-band. %s. Failed to set breakpoint information for for breakpoint ID %d" },
-	{ IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE,	"LLDB Out-of-band. %s. Failed to form the MI Out-of-band response" },
-	{ IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET,		"LLDB Out-of-band. %s. Failed to retrieve frame information" },
-	{ IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE,  "LLDB Out-of-band. %s. Event handler tried to set new MI Driver running state and failed. %s" },
-	{ IDS_LLDBOUTOFBAND_ERR_BRKPT_CNT_EXCEEDED,	"LLDB Out-of-band. '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint with ID %d" },
-	{ IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE,	"LLDB debug session info. Release some or all of the data shared across command instances failed" },
-	{ IDS_DBGSESSION_ERR_SHARED_DATA_ADD,		"LLDB debug session info. Failed to add '%s' data to the shared data command container" },
-	{ IDS_MI_SHTDWN_ERR_LOG,					"Log. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHUTDOWN_ERR,						"Server shutdown failure. %s" },
-	{ IDE_MI_SHTDWN_ERR_RESOURCES,				"Resources. Error occurred during shutdown. %s" },
-	{ IDE_MI_SHTDWN_ERR_STREAMSTDIN,			"Stdin. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER,		"Stdin handler. Error occurred during shutdown. %s" },
-    { IDS_MI_SHTDWN_ERR_STREAMSTDOUT,			"Stdout. Error occurred during shutdown. %s" },	
-	{ IDS_MI_SHTDWN_ERR_STREAMSTDERR,			"Stderr. Error occurred during shutdown. %s" },	
-	{ IDS_MI_SHTDWN_ERR_THREADMGR,				"Thread Mgr. Error occurred during shutdown. %s" },			
-	{ IDS_MI_SHTDWN_ERR_CMDINTERPRETER,			"Command interpreter. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_CMDMGR,					"Command manager. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_CMDFACTORY,				"Command factory. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_CMDMONITOR,				"Command invoker. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_CMDINVOKER,				"Command monitor. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_LLDBDEBUGGER,			"LLDB Debugger. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_DRIVERMGR,				"Driver manager. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_DRIVER,					"Driver. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_OUTOFBANDHANDLER,		"Out-of-band handler. Error occurred during shutdown. %s" },
-	{ IDS_MI_SHTDWN_ERR_DEBUGSESSIONINFO,		"LLDB debug session info. Error occurred during shutdown. %s" },
-	{ IDE_MI_SHTDWN_ERR_THREADMANAGER,			"Unable to shutdown thread manager" },
-	{ IDS_DRIVER_ERR_PARSE_ARGS,				"Driver. Driver '%s'. Parse args error '%s'" },
-	{ IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN,		"Driver. Driver '%s'. Parse args error unknown" },	
-	{ IDS_DRIVER_ERR_CURRENT_NOT_SET,			"Driver. Current working driver has not been set. Call CMIDriverMgr::SetUseThisDriverToDoWork()" },
-	{ IDS_DRIVER_ERR_NON_REGISTERED,			"Driver. No suitable drivers registered with the CMIDriverMgr to do work" },	
-	{ IDS_DRIVER_SAY_DRIVER_USING,				"Driver. Using driver '%s' internally" },	
-	{ IDS_DRIVER_ERR_ID_INVALID,				"Driver. Driver '%s' invalid ID '%s'" },
-	{ IDS_DRIVER_ERR_FALLTHRU_DRIVER_ERR,		"Driver. Fall through driver '%s' (ID:'%s') error '%s'" },	
-	{ IDS_DRIVER_CMD_RECEIVED,					"Driver. Received command '%s'. It was %shandled%s" },	
-	{ IDS_DRIVER_CMD_NOT_IN_FACTORY,			". Command '%s' not in Command Factory" },	
-	{ IDS_DRIVER_ERR_DRIVER_STATE_ERROR,		"Driver. Driver running state error. Cannot go to next state from present state as not allowed", },	
-	{ IDS_DRIVER_WAITING_STDIN_DATA,			"Driver. Main thread suspended waiting on Stdin Monitor to resume main thread" },
-	{ IDS_DRIVER_ERR_MAINLOOP,					"Driver. Error in do main loop. %s" },				
-	{ IDS_DRIVER_ERR_LOCAL_DEBUG_NOT_IMPL,		"Driver. --executable argument given. Local debugging is not implemented." },	
-	{ IDS_DRIVER_ERR_LOCAL_DEBUG_INIT,			"Driver. --executable argument given. Initialising local debugging failed." },	
-	{ IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN,		"Stdout. Not all data was written to stream. The data '%s'" },
-	{ IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN,		"Stderr. Not all data was written to stream. The data '%s'" },
-	{ IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED,		"Command Args. Missing options, %d or more required" },
-	{ IDS_CMD_ARGS_ERR_OPTION_NOT_FOUND,		"Command Args. Option '%s' not found" },
-	{ IDS_CMD_ARGS_ERR_VALIDATION_MANDATORY,	"Mandatory args not found: %s" },
-	{ IDS_CMD_ARGS_ERR_VALIDATION_INVALID,		"Invalid args: %s" },
-	{ IDS_CMD_ARGS_ERR_VALIDATION_MAN_INVALID,  "Mandatory args not found: %s. Invalid args: %s" },
-	{ IDS_CMD_ARGS_ERR_VALIDATION_MISSING_INF,  "Args missing additional information: %s" },
-	{ IDS_CMD_ARGS_ERR_CONTEXT_NOT_ALL_EATTEN,	"Not all arguments or options were recognised: %s" },
-	{ IDS_CMD_ARGS_ERR_PREFIX_MSG,				"Command Args. Validation failed. " },
-	{ IDS_VARIANT_ERR_USED_BASECLASS,			"Variant container: Variant object used the base class. See CMIUtilVariant" },
-	{ IDS_VARIANT_ERR_MAP_KEY_INVALID,			"Variant container: Invalid ID '%s'" },
-	{ IDS_WORD_INVALIDBRKTS,					"<Invalid>" },
-	{ IDS_WORD_NONE,							"None" },
-	{ IDS_WORD_NOT,								"not" },
-	{ IDS_WORD_INVALIDEMPTY,					"<empty>" },
-	{ IDS_WORD_INVALIDNULLPTR,					"<NULL ptr>" },
-	{ IDS_WORD_UNKNOWNBRKTS,					"<unknown>" },
-	{ IDS_WORD_NOT_IMPLEMENTED,					"Not implemented" },	
-	{ IDS_WORD_NOT_IMPLEMENTED_BRKTS,			"<not implemented>" },
-	{ IDS_WORD_UNKNOWNTYPE_BRKTS,				"<unknowntype>" },
-	{ IDS_WORD_ERR_MSG_NOT_IMPLEMENTED_BRKTS,	"<error message not implemented>" },
-	{ IDS_CMD_ERR_N_OPTIONS_REQUIRED,			"Command '%s'. Missing options, %d required" },
-	{ IDS_CMD_ERR_OPTION_NOT_FOUND,				"Command '%s'. Option '%s' not found" },
-	{ IDS_CMD_ERR_ARGS,							"Command '%s'. %s" },
-	{ IDS_CMD_WRN_ARGS_NOT_HANDLED,				"Command '%s'. Warning the following options not handled by the command: %s" },
-	{ IDS_CMD_ERR_FNFAILED,						"Command '%s'. Fn '%s' failed" },
-	{ IDS_CMD_ERR_SHARED_DATA_NOT_FOUND,		"Command '%s'. Shared data '%s' not found" },
-	{ IDS_CMD_ERR_LLDBPROCESS_DETACH,			"Command '%s'. Process detach failed. '%s'"	},
-	{ IDS_CMD_ERR_SETWKDIR,						"Command '%s'. Failed to set working directory '%s'" },
-	{ IDS_CMD_ERR_INVALID_TARGET,				"Command '%s'. Target binary '%s' is invalid. %s" },	
-	{ IDS_CMD_ERR_INVALID_TARGET_CURRENT,		"Command '%s'. Current SBTarget is invalid" },
-	{ IDS_CMD_ERR_INVALID_TARGET_TYPE,			"Command '%s'. Target type '%s' is not recognised" },
-	{ IDS_CMD_ERR_INVALID_TARGET_PLUGIN,		"Command '%s'. Target plugin is invalid. %s" },
-	{ IDS_CMD_ERR_CONNECT_TO_TARGET,			"Command '%s'. Error connecting to target: '%s'" },
-	{ IDS_CMD_ERR_INVALID_TARGETPLUGINCURRENT,	"Command '%s'. Current target plugin is invalid" },
-	{ IDS_CMD_ERR_NOT_IMPLEMENTED, 				"Command '%s'. Command not implemented" },
-	{ IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED, 	"Command '%s'. Command not implemented as it has been deprecated" },
-	{ IDS_CMD_ERR_CREATE_TARGET,				"Command '%s'. Create target failed: %s" },
-	{ IDS_CMD_ERR_BRKPT_LOCATION_FORMAT,		"Command '%s'. Incorrect format for breakpoint location '%s'" },
-	{ IDS_CMD_ERR_BRKPT_INVALID,				"Command '%s'. Breakpoint '%s' invalid" },
-	{ IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,			"Command '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint '%s'" },
-	{ IDS_CMD_ERR_SOME_ERROR,					"Command '%s'. Error: %s" },
-	{ IDS_CMD_ERR_THREAD_INVALID,				"Command '%s'. Thread ID invalid" },
-	{ IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,	"Command '%s'. Thread frame range invalid" },
-	{ IDS_CMD_ERR_FRAME_INVALID,				"Command '%s'. Frame ID invalid" },
-	{ IDS_CMD_ERR_VARIABLE_DOESNOTEXIST,		"Command '%s'. Variable '%s' does not exist" },
-	{ IDS_CMD_ERR_VARIABLE_ENUM_INVALID,		"Command '%s'. Invalid enumeration for variable '%s' formatted string '%s'" },
-	{ IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH,		"Command '%s'. Failed to get expression for variable '%s'" },
-	{ IDS_CMD_ERR_VARIABLE_CREATION_FAILED,		"Failed to create variable object for '%s'" },
-	{ IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION,		"<Error: Command run but command did not do anything useful. No MI response formed>" },
-	{ IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION,  "<Error: Command run and event caught, did nothing useful. No MI Out-of-Bound formed>"},
-	{ IDS_CMD_ERR_DISASM_ADDR_START_INVALID,	"Command '%s'. Invalid start value '%s'" },
-	{ IDS_CMD_ERR_DISASM_ADDR_END_INVALID,		"Command '%s'. Invalid end value '%s'" },
-	{ IDS_CMD_ERR_MEMORY_ALLOC_FAILURE,			"Command '%s'. Failed to allocate memory %d bytes" },
-	{ 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_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 " },	
-	{ IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK,	"Command '%s'. LLDB unable to write entire memory block of %u bytes at address 0x%08x" },
-	{ IDS_CMD_ERR_SET_NEW_DRIVER_STATE,			"Command '%s'. Command tried to set new MI Driver running state and failed. %s" },
-	{ IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,		"The request '%s' was not recogised, not implemented" },
-	{ IDS_CMD_ERR_INFO_PRINTFN_FAILED,			"The request '%s' failed." },
-	{ IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,   "'solib-search-path' requires at least one argument" }
-	};
+const CMICmnResources::SRsrcTextData CMICmnResources::ms_pResourceId2TextData[] = {
+    {IDS_PROJNAME, "LLDB Machine Interface Driver (MI) All rights reserved"},
+    {IDS_MI_VERSION_DESCRIPTION_DEBUG, "Version: 1.0.0.9 (Debug)"}, // See version history in MIDriverMain.cpp
+    {IDS_MI_VERSION_DESCRIPTION, "Version: 1.0.0.9"},
+    {IDS_MI_APPNAME_SHORT, "MI"},
+    {IDS_MI_APPNAME_LONG, "Machine Interface Driver"},
+    {IDS_MI_APP_FILEPATHNAME, "Application: %s"},
+    {IDS_MI_APP_ARGS, "Command line args: "},
+    {IDE_MI_VERSION_GDB,
+     "Version: GNU gdb (GDB) 7.4 \n(This is a MI stub on top of LLDB and not GDB)\nAll rights reserved.\n"}, // *** Eclipse needs this
+                                                                                                             // exactly!!
+    {IDS_UTIL_FILE_ERR_INVALID_PATHNAME, "File Handler. Invalid file name path"},
+    {IDS_UTIL_FILE_ERR_OPENING_FILE, "File Handler. Error %s opening '%s'"},
+    {IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN, "File Handler. Unknown error opening '%s'"},
+    {IDE_UTIL_FILE_ERR_WRITING_FILE, "File Handler. Error %s writing '%s'"},
+    {IDE_UTIL_FILE_ERR_WRITING_NOTOPEN, "File Handler. File '%s' not open for write"},
+    {IDS_RESOURCES_ERR_STRING_NOT_FOUND, "Resources. String (%d) not found in resources"},
+    {IDS_RESOURCES_ERR_STRING_TABLE_INVALID, "Resources. String resource table is not set up"},
+    {IDS_MI_CLIENT_MSG, "Client message: \"%s\""},
+    {IDS_LOG_MSG_CREATION_DATE, "Creation date %s time %s%s"},
+    {IDS_LOG_MSG_FILE_LOGGER_PATH, "File logger path: %s%s"},
+    {IDS_LOG_MSG_VERSION, "Version: %s%s"},
+    {IDS_LOG_ERR_FILE_LOGGER_DISABLED, "Log. File logger temporarily disabled due to file error '%s'"},
+    {IDS_LOG_MEDIUM_ERR_INIT, "Log. Medium '%s' initialise failed. %s"},
+    {IDS_LOG_MEDIUM_ERR_WRITE_ANY, "Log. Failed to write log data to any medium."},
+    {IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL, "Log. One or mediums failed writing log data."},
+    {IDS_MEDIUMFILE_NAME, "File"},
+    {IDS_MEDIUMFILE_ERR_INVALID_PATH, "<Invalid - not set>"},
+    {IDS_MEDIUMFILE_ERR_FILE_HEADER, "<Invalid - header not set>"},
+    {IDS_MEDIUMFILE_NAME_LOG, "File medium. %s"},
+    {IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS, "File Medium. Failed to retrieve the system/executable path for the Log file"},
+    {IDE_OS_ERR_UNKNOWN, "Unknown OS error"},
+    {IDE_OS_ERR_RETRIEVING, "Unabled to retrieve OS error message"},
+    {IDS_DRIVERMGR_DRIVER_ERR_INIT, "Driver Manager. Driver '%s' (ID:'%s') initialise failed. %s"},
+    {IDE_MEDIUMSTDERR_NAME, "Stderr"},
+    {IDE_MEDIUMSTDOUT_NAME, "Stdout"},
+    {IDE_MI_APP_EXIT_OK, "Program exited OK"},
+    {IDE_MI_APP_EXIT_WITH_PROBLEM, "Program exited with a problem, see '%s' file"},
+    {IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG, "Program exited with a problem, the application's log file '%s' was disabled"},
+    {IDE_MI_APP_DESCRIPTION, "Description:\nThe Machine Interface Driver (MI Driver) is a stand alone executable\nthat either be used via "
+                             "a client i.e. Eclipse or directly from the command\nline. It processes MI commands, actions those commands "
+                             "using the internal\ndebugger then forms MI response formatted text which is returned to the\nclient."},
+    {IDE_MI_APP_INFORMATION, "Information:\nCurrent limitations. The MI Driver currently only handles remote target\ndebugging. Local "
+                             "debugging has not been implemented. The MI Driver has\nbeen designed primarily to be used with Eclipse Juno "
+                             "and a custom plugin.\nThe custom plugin is not necessary to operate the MI Driver."},
+    {IDE_MI_APP_ARG_USAGE, "\nMI driver usage:\n\n\tlldb-mi [--longOption] [-s hortOption] [executeable]\n\n[] = optional argument."},
+    {IDE_MI_APP_ARG_HELP, "-h\n--help\n\tPrints out usage information for the MI debugger. Exit the MI\n\tDriver immediately."},
+    {IDE_MI_APP_ARG_VERSION, "--version\n\tPrints out GNU (gdb) version information. Exit the MI Driver\n\timmediately."},
+    {IDE_MI_APP_ARG_VERSION_LONG, "--versionLong\n\tPrints out MI Driver version information. Exit the MI Driver\n\timmediately."},
+    {IDE_MI_APP_ARG_INTERPRETER, "--interpreter\n\tUse the MI Driver for the debugger (MI mode)(Default is the\n\tLLDB driver). Any LLDB "
+                                 "command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. "
+                                 "(Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified by the driver client "
+                                 "i.e. Eclipse.\n\tCannot specify an executable with this option, use --executable."},
+    {IDE_MI_APP_ARG_EXECUTEABLE, "--executable\n\tUse the MI Driver in MI mode for the debugging the specified\n\texecutable. Any LLDB "
+                                 "command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. "
+                                 "(Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified from the command line."},
+    {IDE_MI_APP_ARG_NO_APP_LOG, "--noLog\n\tUse this argument to tell the MI Driver not to update it's log\n\tfile '%s'."},
+    {IDE_MI_APP_ARG_EXAMPLE, "Example MI command:\n\t3-info-gdb-mi-command gdb-set\n\t3^done,command={exists=\"true\"}"},
+    {IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file path to the executable i.e. '\"C:\\My Dev\\foo.exe\"'."},
+    {IDS_STDIN_ERR_INVALID_PROMPT, "Stdin. Invalid prompt description '%s'"},
+    {IDS_STDIN_ERR_THREAD_CREATION_FAILED, "Stdin. Thread creation failed '%s'"},
+    {IDS_STDIN_ERR_THREAD_DELETE, "Stdin. Thread failed to delete '%s'"},
+    {IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE, "Stdin. Peeking on stdin stream '%s'"},
+    {IDS_STDIN_INPUT_CTRL_CHARS, "Stdin. Receive characters not handled as a command: "},
+    {IDS_CMD_QUIT_HELP, "MI Driver Command: quit\n\tExit the MI Driver application."},
+    {IDS_THREADMGR_ERR_THREAD_ID_INVALID, "Thread Mgr. Thread ID '%s' is not valid"},
+    {IDS_THREADMGR_ERR_THREAD_FAIL_CREATE, "Thread Mgr: Failed to create thread '%s'"},
+    {IDS_THREADMGR_ERR_THREAD_ID_NOT_FOUND, "Thread Mgr: Thread with ID '%s' not found"},
+    {IDS_THREADMGR_ERR_THREAD_STILL_ALIVE, "Thread Mgr: The thread(s) are still alive at Thread Mgr shutdown: %s"},
+    {IDS_FALLTHRU_DRIVER_CMD_RECEIVED, "Fall Thru Driver. Received command '%s'. Is was %shandled"},
+    {IDS_CMDFACTORY_ERR_INVALID_CMD_NAME, "Command factory. MI command name '%s' is invalid"},
+    {IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN,
+     "Command factory. Command creation function invalid for command '%s'. Does function exist? Pointer assigned to it?"},
+    {IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED, "Command factory. Command '%s' not registered"},
+    {IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED, "Command factory. Command '%s' by that name already registered"},
+    {IDS_CMDMGR_ERR_CMD_FAILED_CREATE, "Command manager. Command creation failed. %s"},
+    {IDS_CMDMGR_ERR_CMD_INVOKER, "Command manager. %s "},
+    {IDS_PROCESS_SIGNAL_RECEIVED, "Process signal. Application received signal '%s' (%d)"},
+    {IDS_MI_INIT_ERR_LOG, "Log. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_RESOURCES, "Resources. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_INIT, "Driver. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_STREAMSTDIN, "Stdin. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER, "Stdin. The OS specific stdin stream handler has not been specified for this OS"},
+    {IDS_MI_INIT_ERR_OS_STDIN_HANDLER, "Stdin handler. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_STREAMSTDOUT, "Stdout. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_STREAMSTDERR, "Stderr. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_FALLTHRUDRIVER, "Fall Through Driver. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_THREADMGR, "Thread Mgr. Error occurred during initialisation %s"},
+    {IDS_MI_INIT_ERR_CMDINTERPRETER, "Command interpreter. %s"},
+    {IDS_MI_INIT_ERR_CMDMGR, "Command manager. %s"},
+    {IDS_MI_INIT_ERR_CMDFACTORY, "Command factory. %s"},
+    {IDS_MI_INIT_ERR_CMDINVOKER, "Command invoker. %s"},
+    {IDS_MI_INIT_ERR_CMDMONITOR, "Command monitor. %s"},
+    {IDS_MI_INIT_ERR_LLDBDEBUGGER, "LLDB Debugger. %s"},
+    {IDS_MI_INIT_ERR_DRIVERMGR, "Driver manager. %s"},
+    {IDS_MI_INIT_ERR_DRIVER, "Driver. %s"},
+    {IDS_MI_INIT_ERR_OUTOFBANDHANDLER, "Out-of-band handler. %s "},
+    {IDS_MI_INIT_ERR_DEBUGSESSIONINFO, "LLDB debug session info. %s "},
+    {IDS_MI_INIT_ERR_THREADMANAGER, "Unable to init thread manager."},
+    {IDS_MI_INIT_ERR_CLIENT_USING_DRIVER, "Initialising the client to this driver failed."},
+    {IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION, "Initialising a local debug session failed."},
+    {IDS_CODE_ERR_INVALID_PARAMETER_VALUE, "Code. Invalid parameter passed to function '%s'"},
+    {IDS_CODE_ERR_INVALID_PARAM_NULL_POINTER, "Code. NULL pointer passes as a parameter to function '%s'"},
+    {IDS_CODE_ERR_INVALID_ENUMERATION_VALUE, "Code. Invalid enumeration value encountered in function '%s'"},
+    {
+     IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER, "LLDB Debugger. LLDB Listener is not valid",
+    },
+    {
+     IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER, "LLDB Debugger. LLDB Debugger is not valid",
+    },
+    {IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER,
+     "LLDB Debugger. CMIDriverBase derived driver needs to be set prior to CMICmnLLDBDDebugger initialisation"},
+    {IDS_LLDBDEBUGGER_ERR_STARTLISTENER, "LLDB Debugger. Starting listening events for '%s' failed"},
+    {IDS_LLDBDEBUGGER_ERR_THREADCREATIONFAIL, "LLDB Debugger. Thread creation failed '%s'"},
+    {IDS_LLDBDEBUGGER_ERR_THREAD_DELETE, "LLDB Debugger. Thread failed to delete '%s'"},
+    {IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER, "LLDB Debugger. Invalid SB broadcaster class name '%s' "},
+    {IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME, "LLDB Debugger. Invalid client name '%s' "},
+    {IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD, "LLDB Debugger. Client name '%s' not registered for listening events"},
+    {IDS_LLDBDEBUGGER_ERR_STOPLISTENER, "LLDB Debugger. Failure occurred stopping event for client '%s' SBBroadcaster '%s'"},
+    {IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME, "LLDB Debugger. Broardcaster's name '%s' is not valid"},
+    {IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT, "LLDB Debugger. Unhandled event '%s'"},
+    {IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT, "LLDB Out-of-band. Handling event for '%s', an event enumeration '%d' not recognised"},
+    {IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID, "LLDB Out-of-band. Invalid '%s' in '%s'"},
+    {IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND, "LLDB Out-of-band. %s. Breakpoint information for breakpoint ID %d not found"},
+    {IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET, "LLDB Out-of-band. %s. Failed to retrieve breakpoint information for for breakpoint ID %d"},
+    {IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET, "LLDB Out-of-band. %s. Failed to set breakpoint information for for breakpoint ID %d"},
+    {IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE, "LLDB Out-of-band. %s. Failed to form the MI Out-of-band response"},
+    {IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET, "LLDB Out-of-band. %s. Failed to retrieve frame information"},
+    {IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE,
+     "LLDB Out-of-band. %s. Event handler tried to set new MI Driver running state and failed. %s"},
+    {IDS_LLDBOUTOFBAND_ERR_BRKPT_CNT_EXCEEDED,
+     "LLDB Out-of-band. '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint with ID %d"},
+    {IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE,
+     "LLDB debug session info. Release some or all of the data shared across command instances failed"},
+    {IDS_DBGSESSION_ERR_SHARED_DATA_ADD, "LLDB debug session info. Failed to add '%s' data to the shared data command container"},
+    {IDS_MI_SHTDWN_ERR_LOG, "Log. Error occurred during shutdown. %s"},
+    {IDS_MI_SHUTDOWN_ERR, "Server shutdown failure. %s"},
+    {IDE_MI_SHTDWN_ERR_RESOURCES, "Resources. Error occurred during shutdown. %s"},
+    {IDE_MI_SHTDWN_ERR_STREAMSTDIN, "Stdin. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, "Stdin handler. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_STREAMSTDOUT, "Stdout. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_STREAMSTDERR, "Stderr. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_THREADMGR, "Thread Mgr. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_CMDINTERPRETER, "Command interpreter. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_CMDMGR, "Command manager. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_CMDFACTORY, "Command factory. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_CMDMONITOR, "Command invoker. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_CMDINVOKER, "Command monitor. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_LLDBDEBUGGER, "LLDB Debugger. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_DRIVERMGR, "Driver manager. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_DRIVER, "Driver. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_OUTOFBANDHANDLER, "Out-of-band handler. Error occurred during shutdown. %s"},
+    {IDS_MI_SHTDWN_ERR_DEBUGSESSIONINFO, "LLDB debug session info. Error occurred during shutdown. %s"},
+    {IDE_MI_SHTDWN_ERR_THREADMANAGER, "Unable to shutdown thread manager"},
+    {IDS_DRIVER_ERR_PARSE_ARGS, "Driver. Driver '%s'. Parse args error '%s'"},
+    {IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN, "Driver. Driver '%s'. Parse args error unknown"},
+    {IDS_DRIVER_ERR_CURRENT_NOT_SET, "Driver. Current working driver has not been set. Call CMIDriverMgr::SetUseThisDriverToDoWork()"},
+    {IDS_DRIVER_ERR_NON_REGISTERED, "Driver. No suitable drivers registered with the CMIDriverMgr to do work"},
+    {IDS_DRIVER_SAY_DRIVER_USING, "Driver. Using driver '%s' internally"},
+    {IDS_DRIVER_ERR_ID_INVALID, "Driver. Driver '%s' invalid ID '%s'"},
+    {IDS_DRIVER_ERR_FALLTHRU_DRIVER_ERR, "Driver. Fall through driver '%s' (ID:'%s') error '%s'"},
+    {IDS_DRIVER_CMD_RECEIVED, "Driver. Received command '%s'. It was %shandled%s"},
+    {IDS_DRIVER_CMD_NOT_IN_FACTORY, ". Command '%s' not in Command Factory"},
+    {
+     IDS_DRIVER_ERR_DRIVER_STATE_ERROR, "Driver. Driver running state error. Cannot go to next state from present state as not allowed",
+    },
+    {IDS_DRIVER_WAITING_STDIN_DATA, "Driver. Main thread suspended waiting on Stdin Monitor to resume main thread"},
+    {IDS_DRIVER_ERR_MAINLOOP, "Driver. Error in do main loop. %s"},
+    {IDS_DRIVER_ERR_LOCAL_DEBUG_NOT_IMPL, "Driver. --executable argument given. Local debugging is not implemented."},
+    {IDS_DRIVER_ERR_LOCAL_DEBUG_INIT, "Driver. --executable argument given. Initialising local debugging failed."},
+    {IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN, "Stdout. Not all data was written to stream. The data '%s'"},
+    {IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN, "Stderr. Not all data was written to stream. The data '%s'"},
+    {IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED, "Command Args. Missing options, %d or more required"},
+    {IDS_CMD_ARGS_ERR_OPTION_NOT_FOUND, "Command Args. Option '%s' not found"},
+    {IDS_CMD_ARGS_ERR_VALIDATION_MANDATORY, "Mandatory args not found: %s"},
+    {IDS_CMD_ARGS_ERR_VALIDATION_INVALID, "Invalid args: %s"},
+    {IDS_CMD_ARGS_ERR_VALIDATION_MAN_INVALID, "Mandatory args not found: %s. Invalid args: %s"},
+    {IDS_CMD_ARGS_ERR_VALIDATION_MISSING_INF, "Args missing additional information: %s"},
+    {IDS_CMD_ARGS_ERR_CONTEXT_NOT_ALL_EATTEN, "Not all arguments or options were recognised: %s"},
+    {IDS_CMD_ARGS_ERR_PREFIX_MSG, "Command Args. Validation failed. "},
+    {IDS_VARIANT_ERR_USED_BASECLASS, "Variant container: Variant object used the base class. See CMIUtilVariant"},
+    {IDS_VARIANT_ERR_MAP_KEY_INVALID, "Variant container: Invalid ID '%s'"},
+    {IDS_WORD_INVALIDBRKTS, "<Invalid>"},
+    {IDS_WORD_NONE, "None"},
+    {IDS_WORD_NOT, "not"},
+    {IDS_WORD_INVALIDEMPTY, "<empty>"},
+    {IDS_WORD_INVALIDNULLPTR, "<NULL ptr>"},
+    {IDS_WORD_UNKNOWNBRKTS, "<unknown>"},
+    {IDS_WORD_NOT_IMPLEMENTED, "Not implemented"},
+    {IDS_WORD_NOT_IMPLEMENTED_BRKTS, "<not implemented>"},
+    {IDS_WORD_UNKNOWNTYPE_BRKTS, "<unknowntype>"},
+    {IDS_WORD_ERR_MSG_NOT_IMPLEMENTED_BRKTS, "<error message not implemented>"},
+    {IDS_CMD_ERR_N_OPTIONS_REQUIRED, "Command '%s'. Missing options, %d required"},
+    {IDS_CMD_ERR_OPTION_NOT_FOUND, "Command '%s'. Option '%s' not found"},
+    {IDS_CMD_ERR_ARGS, "Command '%s'. %s"},
+    {IDS_CMD_WRN_ARGS_NOT_HANDLED, "Command '%s'. Warning the following options not handled by the command: %s"},
+    {IDS_CMD_ERR_FNFAILED, "Command '%s'. Fn '%s' failed"},
+    {IDS_CMD_ERR_SHARED_DATA_NOT_FOUND, "Command '%s'. Shared data '%s' not found"},
+    {IDS_CMD_ERR_LLDBPROCESS_DETACH, "Command '%s'. Process detach failed. '%s'"},
+    {IDS_CMD_ERR_SETWKDIR, "Command '%s'. Failed to set working directory '%s'"},
+    {IDS_CMD_ERR_INVALID_TARGET, "Command '%s'. Target binary '%s' is invalid. %s"},
+    {IDS_CMD_ERR_INVALID_TARGET_CURRENT, "Command '%s'. Current SBTarget is invalid"},
+    {IDS_CMD_ERR_INVALID_TARGET_TYPE, "Command '%s'. Target type '%s' is not recognised"},
+    {IDS_CMD_ERR_INVALID_TARGET_PLUGIN, "Command '%s'. Target plugin is invalid. %s"},
+    {IDS_CMD_ERR_CONNECT_TO_TARGET, "Command '%s'. Error connecting to target: '%s'"},
+    {IDS_CMD_ERR_INVALID_TARGETPLUGINCURRENT, "Command '%s'. Current target plugin is invalid"},
+    {IDS_CMD_ERR_NOT_IMPLEMENTED, "Command '%s'. Command not implemented"},
+    {IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED, "Command '%s'. Command not implemented as it has been deprecated"},
+    {IDS_CMD_ERR_CREATE_TARGET, "Command '%s'. Create target failed: %s"},
+    {IDS_CMD_ERR_BRKPT_LOCATION_FORMAT, "Command '%s'. Incorrect format for breakpoint location '%s'"},
+    {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
+    {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint '%s'"},
+    {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
+    {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
+    {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range invalid"},
+    {IDS_CMD_ERR_FRAME_INVALID, "Command '%s'. Frame ID invalid"},
+    {IDS_CMD_ERR_VARIABLE_DOESNOTEXIST, "Command '%s'. Variable '%s' does not exist"},
+    {IDS_CMD_ERR_VARIABLE_ENUM_INVALID, "Command '%s'. Invalid enumeration for variable '%s' formatted string '%s'"},
+    {IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH, "Command '%s'. Failed to get expression for variable '%s'"},
+    {IDS_CMD_ERR_VARIABLE_CREATION_FAILED, "Failed to create variable object for '%s'"},
+    {IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION, "<Error: Command run but command did not do anything useful. No MI response formed>"},
+    {IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION, "<Error: Command run and event caught, did nothing useful. No MI Out-of-Bound formed>"},
+    {IDS_CMD_ERR_DISASM_ADDR_START_INVALID, "Command '%s'. Invalid start value '%s'"},
+    {IDS_CMD_ERR_DISASM_ADDR_END_INVALID, "Command '%s'. Invalid end value '%s'"},
+    {IDS_CMD_ERR_MEMORY_ALLOC_FAILURE, "Command '%s'. Failed to allocate memory %d bytes"},
+    {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_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 "},
+    {IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK, "Command '%s'. LLDB unable to write entire memory block of %u bytes at address 0x%08x"},
+    {IDS_CMD_ERR_SET_NEW_DRIVER_STATE, "Command '%s'. Command tried to set new MI Driver running state and failed. %s"},
+    {IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND, "The request '%s' was not recogised, not implemented"},
+    {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
+    {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH, "'solib-search-path' requires at least one argument"}};
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnResources constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnResources constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnResources::CMICmnResources( void )
-:	m_nResourceId2TextDataSize( 0 )
+CMICmnResources::CMICmnResources(void)
+    : m_nResourceId2TextDataSize(0)
 {
-	// Do not use this constructor, use Initialize()
+    // Do not use this constructor, use Initialize()
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnResources destructor.
-// Type:	Overridden.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnResources destructor.
+// Type:    Overridden.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnResources::~CMICmnResources( void )
+CMICmnResources::~CMICmnResources(void)
 {
-	// Do not use this destructor, use Shutdown()
+    // Do not use this destructor, use Shutdown()
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize the resources and set locality for the server.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize the resources and set locality for the server.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnResources::Initialize( void )
+bool
+CMICmnResources::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = ReadResourceStringData();
+    m_bInitialized = ReadResourceStringData();
 
-	return m_bInitialized;
+    return m_bInitialized;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this object.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this object.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnResources::Shutdown( void )
+bool
+CMICmnResources::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
+
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	// Tear down resource explicitly
-	m_mapRscrIdToTextData.clear();
+    // Tear down resource explicitly
+    m_mapRscrIdToTextData.clear();
 
-	m_bInitialized = false;
+    m_bInitialized = false;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize the resources and set locality for the server.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize the resources and set locality for the server.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnResources::ReadResourceStringData( void )
+bool
+CMICmnResources::ReadResourceStringData(void)
 {
-	m_nResourceId2TextDataSize = sizeof ms_pResourceId2TextData / sizeof ms_pResourceId2TextData[ 0 ];
-	for( MIuint i = 0; i < m_nResourceId2TextDataSize; i++ )
-	{
-		const SRsrcTextData * pRscrData = &ms_pResourceId2TextData[ i ];
-		MapPairRscrIdToTextData_t pr( pRscrData->id, pRscrData->pTextData );
-		m_mapRscrIdToTextData.insert( pr );
-	}
-	
-	return MIstatus::success;
+    m_nResourceId2TextDataSize = sizeof ms_pResourceId2TextData / sizeof ms_pResourceId2TextData[0];
+    for (MIuint i = 0; i < m_nResourceId2TextDataSize; i++)
+    {
+        const SRsrcTextData *pRscrData = &ms_pResourceId2TextData[i];
+        MapPairRscrIdToTextData_t pr(pRscrData->id, pRscrData->pTextData);
+        m_mapRscrIdToTextData.insert(pr);
+    }
+
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the corresponding text assigned to the resource ID.
-// Type:	Method.
-// Args:	vResourceId	- (R) MI resource ID.
-// Return:	CMIUtilString - Resource text.
-// Throws:	None.
+// Details: Retrieve the corresponding text assigned to the resource ID.
+// Type:    Method.
+// Args:    vResourceId - (R) MI resource ID.
+// Return:  CMIUtilString - Resource text.
+// Throws:  None.
 //--
-CMIUtilString CMICmnResources::GetString( const MIuint vResourceId ) const
+CMIUtilString
+CMICmnResources::GetString(const MIuint vResourceId) const
 {
-	CMIUtilString str;
-	const bool bFound = GetStringFromResource( vResourceId, str );  MIunused( bFound );
-	assert( bFound );
+    CMIUtilString str;
+    const bool bFound = GetStringFromResource(vResourceId, str);
+    MIunused(bFound);
+    assert(bFound);
 
-	return str;
+    return str;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine the MI resource ID existings.
-// Type:	Method.
-// Args:	vResourceId	- (R) MI resource ID.
-// Return:	True - Exists.
-//			False - Not found.
-// Throws:	None.
+// Details: Determine the MI resource ID existings.
+// Type:    Method.
+// Args:    vResourceId - (R) MI resource ID.
+// Return:  True - Exists.
+//          False - Not found.
+// Throws:  None.
 //--
-bool CMICmnResources::HasString( const MIuint vResourceId ) const
+bool
+CMICmnResources::HasString(const MIuint vResourceId) const
 {
-	CMIUtilString str;
-	return GetStringFromResource( vResourceId, str );
+    CMIUtilString str;
+    return GetStringFromResource(vResourceId, str);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the resource text data for the given resource ID. If a resourse ID
-//			cannot be found and error is given returning the ID of the resource that 
-//			cannot be located.
-// Type:	Method.
-// Args:	vResourceId			- (R) MI resource ID.
-//			vrwResourceString	- (W) Text.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Retrieve the resource text data for the given resource ID. If a resourse ID
+//          cannot be found and error is given returning the ID of the resource that
+//          cannot be located.
+// Type:    Method.
+// Args:    vResourceId         - (R) MI resource ID.
+//          vrwResourceString   - (W) Text.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnResources::GetStringFromResource( const MIuint vResourceId, CMIUtilString & vrwResourceString ) const
+bool
+CMICmnResources::GetStringFromResource(const MIuint vResourceId, CMIUtilString &vrwResourceString) const
 {
-	MapRscrIdToTextData_t::const_iterator it = m_mapRscrIdToTextData.find( vResourceId );
-	if( it == m_mapRscrIdToTextData.end() )
-	{
-		// Check this is a static variable init that needs this before we are ready 
-		if( !m_bInitialized )
-		{	
-			(const_cast< CMICmnResources * >( this ))->Initialize();
-			it = m_mapRscrIdToTextData.find( vResourceId );
-			if( it == m_mapRscrIdToTextData.end() )
-			{
-				vrwResourceString = MIRSRC( IDS_RESOURCES_ERR_STRING_TABLE_INVALID );
-				return MIstatus::failure;
-			}
-		}
-
-		if( it == m_mapRscrIdToTextData.end() )
-		{	
-			vrwResourceString = CMIUtilString::Format( MIRSRC( IDS_RESOURCES_ERR_STRING_NOT_FOUND ), vResourceId );
-			return MIstatus::failure;
-		}
-	}
-
-	const MIuint nRsrcId( (*it).first ); MIunused( nRsrcId );
-	const MIchar * pRsrcData( (*it).second );
+    MapRscrIdToTextData_t::const_iterator it = m_mapRscrIdToTextData.find(vResourceId);
+    if (it == m_mapRscrIdToTextData.end())
+    {
+        // Check this is a static variable init that needs this before we are ready
+        if (!m_bInitialized)
+        {
+            (const_cast<CMICmnResources *>(this))->Initialize();
+            it = m_mapRscrIdToTextData.find(vResourceId);
+            if (it == m_mapRscrIdToTextData.end())
+            {
+                vrwResourceString = MIRSRC(IDS_RESOURCES_ERR_STRING_TABLE_INVALID);
+                return MIstatus::failure;
+            }
+        }
+
+        if (it == m_mapRscrIdToTextData.end())
+        {
+            vrwResourceString = CMIUtilString::Format(MIRSRC(IDS_RESOURCES_ERR_STRING_NOT_FOUND), vResourceId);
+            return MIstatus::failure;
+        }
+    }
+
+    const MIuint nRsrcId((*it).first);
+    MIunused(nRsrcId);
+    const MIchar *pRsrcData((*it).second);
 
-	// Return result
-	vrwResourceString = pRsrcData;
+    // Return result
+    vrwResourceString = pRsrcData;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
-	

Modified: lldb/trunk/tools/lldb-mi/MICmnResources.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnResources.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnResources.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnResources.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnResources.h
+// File:        MICmnResources.h
 //
-// Overview:	CMICmnResources interface.
+// Overview:    CMICmnResources interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -26,326 +26,323 @@
 
 // In-house headers:
 #include "MIUtilSingletonBase.h"
-#include "MIUtilString.h"  
+#include "MIUtilString.h"
 #include "MICmnBase.h"
 
 //++ ============================================================================
 // Details: MI string test data resource definitions. These IDs match up with
-//			actual string data in a map internal to CMICmnResources.
-//			*** Be sure to update ms_pResourceId2TextData[] array ****
+//          actual string data in a map internal to CMICmnResources.
+//          *** Be sure to update ms_pResourceId2TextData[] array ****
 enum
 {
-    IDS_PROJNAME							= 1,
-    IDS_MI_VERSION_DESCRIPTION_DEBUG		,
-    IDS_MI_VERSION_DESCRIPTION				,
-    IDS_MI_APPNAME_SHORT					,
-    IDS_MI_APPNAME_LONG						,
-    IDS_MI_APP_FILEPATHNAME					,
-    IDS_MI_APP_ARGS							,
-    IDE_MI_VERSION_GDB						,
-
-    IDS_UTIL_FILE_ERR_INVALID_PATHNAME		,
-    IDS_UTIL_FILE_ERR_OPENING_FILE			,
-    IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN	,
-    IDE_UTIL_FILE_ERR_WRITING_FILE			,
-    IDE_UTIL_FILE_ERR_WRITING_NOTOPEN		,
-	
-    IDS_RESOURCES_ERR_STRING_NOT_FOUND		,
-    IDS_RESOURCES_ERR_STRING_TABLE_INVALID	,
-
-    IDS_MI_CLIENT_MSG						,
-
-    IDS_LOG_MSG_CREATION_DATE				,
-    IDS_LOG_MSG_FILE_LOGGER_PATH			,
-    IDS_LOG_MSG_VERSION						,
-    IDS_LOG_ERR_FILE_LOGGER_DISABLED		,
-    IDS_LOG_MEDIUM_ERR_INIT					,
-    IDS_LOG_MEDIUM_ERR_WRITE_ANY			,
-    IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL		,
-	IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS,
-
-    IDS_MEDIUMFILE_NAME						,
-    IDS_MEDIUMFILE_ERR_INVALID_PATH			,
-    IDS_MEDIUMFILE_ERR_FILE_HEADER			,
-    IDS_MEDIUMFILE_NAME_LOG					,
-
-    IDE_OS_ERR_UNKNOWN						,
-    IDE_OS_ERR_RETRIEVING					,
-
-    IDS_DRIVERMGR_DRIVER_ERR_INIT			,
-
-    IDE_MEDIUMSTDERR_NAME					,
-    IDE_MEDIUMSTDOUT_NAME					,
-
-    IDE_MI_APP_EXIT_OK						,
-    IDE_MI_APP_EXIT_WITH_PROBLEM			,
-	IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG		,
-
-    IDE_MI_APP_DESCRIPTION					,
-    IDE_MI_APP_INFORMATION					,
-    IDE_MI_APP_ARG_USAGE					,
-	IDE_MI_APP_ARG_HELP						,
-    IDE_MI_APP_ARG_VERSION					,
-    IDE_MI_APP_ARG_VERSION_LONG				,
-    IDE_MI_APP_ARG_INTERPRETER				,
-	IDE_MI_APP_ARG_EXECUTEABLE				,
-	IDE_MI_APP_ARG_NO_APP_LOG				,
-    IDE_MI_APP_ARG_EXAMPLE					,
-	IDE_MI_APP_ARG_EXECUTABLE				,
-
-    IDS_STDIN_ERR_INVALID_PROMPT			,
-    IDS_STDIN_ERR_THREAD_CREATION_FAILED	,
-    IDS_STDIN_ERR_THREAD_DELETE				,
-    IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE		,
-	IDS_STDIN_INPUT_CTRL_CHARS				,				
-
-    IDS_CMD_QUIT_HELP						,
-
-    IDS_THREADMGR_ERR_THREAD_ID_INVALID		,
-    IDS_THREADMGR_ERR_THREAD_FAIL_CREATE	,
-    IDS_THREADMGR_ERR_THREAD_ID_NOT_FOUND	,
-    IDS_THREADMGR_ERR_THREAD_STILL_ALIVE	,
-
-    IDS_FALLTHRU_DRIVER_CMD_RECEIVED		,
-
-    IDS_CMDFACTORY_ERR_INVALID_CMD_NAME		,
-    IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN	,
-    IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED	,
-    IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED	,
-
-    IDS_CMDMGR_ERR_CMD_FAILED_CREATE		,
-    IDS_CMDMGR_ERR_CMD_INVOKER				,
-
-    IDS_PROCESS_SIGNAL_RECEIVED				,
-
-	IDS_MI_INIT_ERR_LOG						,
-    IDS_MI_INIT_ERR_RESOURCES				,
-    IDS_MI_INIT_ERR_INIT					,
-    IDS_MI_INIT_ERR_STREAMSTDIN				,
-    IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER	,
-	IDS_MI_INIT_ERR_OS_STDIN_HANDLER		,
-    IDS_MI_INIT_ERR_STREAMSTDOUT			,
-    IDS_MI_INIT_ERR_STREAMSTDERR			,
-    IDS_MI_INIT_ERR_FALLTHRUDRIVER			,
-    IDS_MI_INIT_ERR_THREADMGR				,
-    IDS_MI_INIT_ERR_CMDINTERPRETER			,
-    IDS_MI_INIT_ERR_CMDMGR					,
-    IDS_MI_INIT_ERR_CMDFACTORY				,
-    IDS_MI_INIT_ERR_CMDINVOKER				,
-    IDS_MI_INIT_ERR_CMDMONITOR				,
-    IDS_MI_INIT_ERR_LLDBDEBUGGER			,
-    IDS_MI_INIT_ERR_DRIVERMGR				,
-    IDS_MI_INIT_ERR_DRIVER					,
-    IDS_MI_INIT_ERR_OUTOFBANDHANDLER		,
-    IDS_MI_INIT_ERR_DEBUGSESSIONINFO		,
-    IDS_MI_INIT_ERR_THREADMANAGER			,
-	IDS_MI_INIT_ERR_CLIENT_USING_DRIVER		,
-	IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION		,
-
-    IDS_CODE_ERR_INVALID_PARAMETER_VALUE	,
-    IDS_CODE_ERR_INVALID_PARAM_NULL_POINTER	,
-    IDS_CODE_ERR_INVALID_ENUMERATION_VALUE	,
-
-    IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER	,
-    IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER	,
-    IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER		,
-    IDS_LLDBDEBUGGER_ERR_STARTLISTENER		,
-    IDS_LLDBDEBUGGER_ERR_THREADCREATIONFAIL	,
-    IDS_LLDBDEBUGGER_ERR_THREAD_DELETE		,
-    IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER	,
-    IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME	,
-    IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD ,
-    IDS_LLDBDEBUGGER_ERR_STOPLISTENER		,
-    IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME	,
-    IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT		,
-
-    IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT		,
-	IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID	,
-	IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND	,
-	IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET	,
-	IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET	,
-	IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE	,
-	IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET	,
-	IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE	,
-	IDS_LLDBOUTOFBAND_ERR_BRKPT_CNT_EXCEEDED,
-
-
-	IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE	,
-	IDS_DBGSESSION_ERR_SHARED_DATA_ADD		,
-    
-    IDS_MI_SHTDWN_ERR_LOG					,
-    IDS_MI_SHUTDOWN_ERR						,
-    IDE_MI_SHTDWN_ERR_RESOURCES				,
-    IDE_MI_SHTDWN_ERR_STREAMSTDIN			,
-    IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER		,
-    IDS_MI_SHTDWN_ERR_STREAMSTDOUT			,
-    IDS_MI_SHTDWN_ERR_STREAMSTDERR			,
-    IDS_MI_SHTDWN_ERR_THREADMGR				,
-    IDS_MI_SHTDWN_ERR_CMDINTERPRETER		,
-    IDS_MI_SHTDWN_ERR_CMDMGR				,
-    IDS_MI_SHTDWN_ERR_CMDFACTORY			,
-    IDS_MI_SHTDWN_ERR_CMDINVOKER			,
-    IDS_MI_SHTDWN_ERR_CMDMONITOR			,
-    IDS_MI_SHTDWN_ERR_LLDBDEBUGGER			,
-    IDS_MI_SHTDWN_ERR_DRIVERMGR				,
-    IDS_MI_SHTDWN_ERR_DRIVER				,
-    IDS_MI_SHTDWN_ERR_OUTOFBANDHANDLER		,
-    IDS_MI_SHTDWN_ERR_DEBUGSESSIONINFO		,
-    IDE_MI_SHTDWN_ERR_THREADMANAGER			,
-
-    IDS_DRIVER_ERR_PARSE_ARGS				,
-    IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN		,
-    IDS_DRIVER_ERR_CURRENT_NOT_SET			,
-    IDS_DRIVER_ERR_NON_REGISTERED			,
-    IDS_DRIVER_SAY_DRIVER_USING				,
-    IDS_DRIVER_ERR_ID_INVALID				,
-    IDS_DRIVER_ERR_FALLTHRU_DRIVER_ERR		,
-    IDS_DRIVER_CMD_RECEIVED					,
-    IDS_DRIVER_CMD_NOT_IN_FACTORY			,
-	IDS_DRIVER_ERR_DRIVER_STATE_ERROR		,
-	IDS_DRIVER_ERR_MAINLOOP					,
-	IDS_DRIVER_ERR_LOCAL_DEBUG_NOT_IMPL		,
-	IDS_DRIVER_ERR_LOCAL_DEBUG_INIT			,
-
-    IDS_DRIVER_WAITING_STDIN_DATA			,
-
-    IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN		,
-	IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN		,
-
-	IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED		,
-    IDS_CMD_ARGS_ERR_OPTION_NOT_FOUND		,			
-    IDS_CMD_ARGS_ERR_VALIDATION_MANDATORY	,
-	IDS_CMD_ARGS_ERR_VALIDATION_INVALID		,
-	IDS_CMD_ARGS_ERR_VALIDATION_MAN_INVALID	,
-	IDS_CMD_ARGS_ERR_VALIDATION_MISSING_INF	,
-	IDS_CMD_ARGS_ERR_CONTEXT_NOT_ALL_EATTEN	,
-	IDS_CMD_ARGS_ERR_PREFIX_MSG				,
-
-	IDS_VARIANT_ERR_USED_BASECLASS			,
-	IDS_VARIANT_ERR_MAP_KEY_INVALID,
-
-	IDS_WORD_INVALIDBRKTS					,
-    IDS_WORD_NONE							,
-    IDS_WORD_NOT							,
-    IDS_WORD_INVALIDEMPTY					,
-    IDS_WORD_INVALIDNULLPTR					,
-    IDS_WORD_UNKNOWNBRKTS					,
-	IDS_WORD_NOT_IMPLEMENTED				,
-	IDS_WORD_NOT_IMPLEMENTED_BRKTS			,
-	IDS_WORD_UNKNOWNTYPE_BRKTS				,
-	IDS_WORD_ERR_MSG_NOT_IMPLEMENTED_BRKTS	,
-
-    IDS_CMD_ERR_N_OPTIONS_REQUIRED			,
-    IDS_CMD_ERR_OPTION_NOT_FOUND			,			
-	IDS_CMD_ERR_ARGS						,	
-	IDS_CMD_WRN_ARGS_NOT_HANDLED			,
-	IDS_CMD_ERR_FNFAILED					,
-    IDS_CMD_ERR_SHARED_DATA_NOT_FOUND		,
-    IDS_CMD_ERR_LLDBPROCESS_DETACH			,
-    IDS_CMD_ERR_SETWKDIR					,
-    IDS_CMD_ERR_INVALID_TARGET				,
-    IDS_CMD_ERR_INVALID_TARGET_CURRENT		,
-    IDS_CMD_ERR_INVALID_TARGET_TYPE			,
-    IDS_CMD_ERR_INVALID_TARGET_PLUGIN		,
-    IDS_CMD_ERR_CONNECT_TO_TARGET			,
-    IDS_CMD_ERR_INVALID_TARGETPLUGINCURRENT	,
-    IDS_CMD_ERR_NOT_IMPLEMENTED				,
-    IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED	,
-    IDS_CMD_ERR_CREATE_TARGET				,
-    IDS_CMD_ERR_BRKPT_LOCATION_FORMAT		,
-    IDS_CMD_ERR_BRKPT_INVALID				,
-    IDS_CMD_ERR_BRKPT_CNT_EXCEEDED			,
-    IDS_CMD_ERR_SOME_ERROR					,
-	IDS_CMD_ERR_THREAD_INVALID				,
-	IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID	,				
-	IDS_CMD_ERR_FRAME_INVALID				,
-	IDS_CMD_ERR_VARIABLE_DOESNOTEXIST		,
-	IDS_CMD_ERR_VARIABLE_ENUM_INVALID		,
-	IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH		,
-	IDS_CMD_ERR_VARIABLE_CREATION_FAILED	,	
-	IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION		,	
-	IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION	,
-	IDS_CMD_ERR_DISASM_ADDR_START_INVALID	,
-	IDS_CMD_ERR_DISASM_ADDR_END_INVALID		,
-	IDS_CMD_ERR_MEMORY_ALLOC_FAILURE		,
-	IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK	,	
-	IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES		,
-	IDS_CMD_ERR_INVALID_PROCESS				,
-	IDS_CMD_ERR_INVALID_FORMAT_TYPE			,
-	IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND	,	
-	IDS_CMD_ERR_LLDB_ERR_WRITE_MEM_BYTES	,	
-	IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK	,
-	IDS_CMD_ERR_SET_NEW_DRIVER_STATE		,
-	IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND		,
-	IDS_CMD_ERR_INFO_PRINTFN_FAILED			,
-	IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH
+    IDS_PROJNAME = 1,
+    IDS_MI_VERSION_DESCRIPTION_DEBUG,
+    IDS_MI_VERSION_DESCRIPTION,
+    IDS_MI_APPNAME_SHORT,
+    IDS_MI_APPNAME_LONG,
+    IDS_MI_APP_FILEPATHNAME,
+    IDS_MI_APP_ARGS,
+    IDE_MI_VERSION_GDB,
+
+    IDS_UTIL_FILE_ERR_INVALID_PATHNAME,
+    IDS_UTIL_FILE_ERR_OPENING_FILE,
+    IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN,
+    IDE_UTIL_FILE_ERR_WRITING_FILE,
+    IDE_UTIL_FILE_ERR_WRITING_NOTOPEN,
+
+    IDS_RESOURCES_ERR_STRING_NOT_FOUND,
+    IDS_RESOURCES_ERR_STRING_TABLE_INVALID,
+
+    IDS_MI_CLIENT_MSG,
+
+    IDS_LOG_MSG_CREATION_DATE,
+    IDS_LOG_MSG_FILE_LOGGER_PATH,
+    IDS_LOG_MSG_VERSION,
+    IDS_LOG_ERR_FILE_LOGGER_DISABLED,
+    IDS_LOG_MEDIUM_ERR_INIT,
+    IDS_LOG_MEDIUM_ERR_WRITE_ANY,
+    IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL,
+    IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS,
+
+    IDS_MEDIUMFILE_NAME,
+    IDS_MEDIUMFILE_ERR_INVALID_PATH,
+    IDS_MEDIUMFILE_ERR_FILE_HEADER,
+    IDS_MEDIUMFILE_NAME_LOG,
+
+    IDE_OS_ERR_UNKNOWN,
+    IDE_OS_ERR_RETRIEVING,
+
+    IDS_DRIVERMGR_DRIVER_ERR_INIT,
+
+    IDE_MEDIUMSTDERR_NAME,
+    IDE_MEDIUMSTDOUT_NAME,
+
+    IDE_MI_APP_EXIT_OK,
+    IDE_MI_APP_EXIT_WITH_PROBLEM,
+    IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG,
+
+    IDE_MI_APP_DESCRIPTION,
+    IDE_MI_APP_INFORMATION,
+    IDE_MI_APP_ARG_USAGE,
+    IDE_MI_APP_ARG_HELP,
+    IDE_MI_APP_ARG_VERSION,
+    IDE_MI_APP_ARG_VERSION_LONG,
+    IDE_MI_APP_ARG_INTERPRETER,
+    IDE_MI_APP_ARG_EXECUTEABLE,
+    IDE_MI_APP_ARG_NO_APP_LOG,
+    IDE_MI_APP_ARG_EXAMPLE,
+    IDE_MI_APP_ARG_EXECUTABLE,
+
+    IDS_STDIN_ERR_INVALID_PROMPT,
+    IDS_STDIN_ERR_THREAD_CREATION_FAILED,
+    IDS_STDIN_ERR_THREAD_DELETE,
+    IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE,
+    IDS_STDIN_INPUT_CTRL_CHARS,
+
+    IDS_CMD_QUIT_HELP,
+
+    IDS_THREADMGR_ERR_THREAD_ID_INVALID,
+    IDS_THREADMGR_ERR_THREAD_FAIL_CREATE,
+    IDS_THREADMGR_ERR_THREAD_ID_NOT_FOUND,
+    IDS_THREADMGR_ERR_THREAD_STILL_ALIVE,
+
+    IDS_FALLTHRU_DRIVER_CMD_RECEIVED,
+
+    IDS_CMDFACTORY_ERR_INVALID_CMD_NAME,
+    IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN,
+    IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED,
+    IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED,
+
+    IDS_CMDMGR_ERR_CMD_FAILED_CREATE,
+    IDS_CMDMGR_ERR_CMD_INVOKER,
+
+    IDS_PROCESS_SIGNAL_RECEIVED,
+
+    IDS_MI_INIT_ERR_LOG,
+    IDS_MI_INIT_ERR_RESOURCES,
+    IDS_MI_INIT_ERR_INIT,
+    IDS_MI_INIT_ERR_STREAMSTDIN,
+    IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER,
+    IDS_MI_INIT_ERR_OS_STDIN_HANDLER,
+    IDS_MI_INIT_ERR_STREAMSTDOUT,
+    IDS_MI_INIT_ERR_STREAMSTDERR,
+    IDS_MI_INIT_ERR_FALLTHRUDRIVER,
+    IDS_MI_INIT_ERR_THREADMGR,
+    IDS_MI_INIT_ERR_CMDINTERPRETER,
+    IDS_MI_INIT_ERR_CMDMGR,
+    IDS_MI_INIT_ERR_CMDFACTORY,
+    IDS_MI_INIT_ERR_CMDINVOKER,
+    IDS_MI_INIT_ERR_CMDMONITOR,
+    IDS_MI_INIT_ERR_LLDBDEBUGGER,
+    IDS_MI_INIT_ERR_DRIVERMGR,
+    IDS_MI_INIT_ERR_DRIVER,
+    IDS_MI_INIT_ERR_OUTOFBANDHANDLER,
+    IDS_MI_INIT_ERR_DEBUGSESSIONINFO,
+    IDS_MI_INIT_ERR_THREADMANAGER,
+    IDS_MI_INIT_ERR_CLIENT_USING_DRIVER,
+    IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION,
+
+    IDS_CODE_ERR_INVALID_PARAMETER_VALUE,
+    IDS_CODE_ERR_INVALID_PARAM_NULL_POINTER,
+    IDS_CODE_ERR_INVALID_ENUMERATION_VALUE,
+
+    IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER,
+    IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER,
+    IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER,
+    IDS_LLDBDEBUGGER_ERR_STARTLISTENER,
+    IDS_LLDBDEBUGGER_ERR_THREADCREATIONFAIL,
+    IDS_LLDBDEBUGGER_ERR_THREAD_DELETE,
+    IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER,
+    IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME,
+    IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD,
+    IDS_LLDBDEBUGGER_ERR_STOPLISTENER,
+    IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME,
+    IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT,
+
+    IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT,
+    IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID,
+    IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND,
+    IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET,
+    IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET,
+    IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE,
+    IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET,
+    IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE,
+    IDS_LLDBOUTOFBAND_ERR_BRKPT_CNT_EXCEEDED,
+
+    IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE,
+    IDS_DBGSESSION_ERR_SHARED_DATA_ADD,
+
+    IDS_MI_SHTDWN_ERR_LOG,
+    IDS_MI_SHUTDOWN_ERR,
+    IDE_MI_SHTDWN_ERR_RESOURCES,
+    IDE_MI_SHTDWN_ERR_STREAMSTDIN,
+    IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER,
+    IDS_MI_SHTDWN_ERR_STREAMSTDOUT,
+    IDS_MI_SHTDWN_ERR_STREAMSTDERR,
+    IDS_MI_SHTDWN_ERR_THREADMGR,
+    IDS_MI_SHTDWN_ERR_CMDINTERPRETER,
+    IDS_MI_SHTDWN_ERR_CMDMGR,
+    IDS_MI_SHTDWN_ERR_CMDFACTORY,
+    IDS_MI_SHTDWN_ERR_CMDINVOKER,
+    IDS_MI_SHTDWN_ERR_CMDMONITOR,
+    IDS_MI_SHTDWN_ERR_LLDBDEBUGGER,
+    IDS_MI_SHTDWN_ERR_DRIVERMGR,
+    IDS_MI_SHTDWN_ERR_DRIVER,
+    IDS_MI_SHTDWN_ERR_OUTOFBANDHANDLER,
+    IDS_MI_SHTDWN_ERR_DEBUGSESSIONINFO,
+    IDE_MI_SHTDWN_ERR_THREADMANAGER,
+
+    IDS_DRIVER_ERR_PARSE_ARGS,
+    IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN,
+    IDS_DRIVER_ERR_CURRENT_NOT_SET,
+    IDS_DRIVER_ERR_NON_REGISTERED,
+    IDS_DRIVER_SAY_DRIVER_USING,
+    IDS_DRIVER_ERR_ID_INVALID,
+    IDS_DRIVER_ERR_FALLTHRU_DRIVER_ERR,
+    IDS_DRIVER_CMD_RECEIVED,
+    IDS_DRIVER_CMD_NOT_IN_FACTORY,
+    IDS_DRIVER_ERR_DRIVER_STATE_ERROR,
+    IDS_DRIVER_ERR_MAINLOOP,
+    IDS_DRIVER_ERR_LOCAL_DEBUG_NOT_IMPL,
+    IDS_DRIVER_ERR_LOCAL_DEBUG_INIT,
+
+    IDS_DRIVER_WAITING_STDIN_DATA,
+
+    IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN,
+    IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN,
+
+    IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED,
+    IDS_CMD_ARGS_ERR_OPTION_NOT_FOUND,
+    IDS_CMD_ARGS_ERR_VALIDATION_MANDATORY,
+    IDS_CMD_ARGS_ERR_VALIDATION_INVALID,
+    IDS_CMD_ARGS_ERR_VALIDATION_MAN_INVALID,
+    IDS_CMD_ARGS_ERR_VALIDATION_MISSING_INF,
+    IDS_CMD_ARGS_ERR_CONTEXT_NOT_ALL_EATTEN,
+    IDS_CMD_ARGS_ERR_PREFIX_MSG,
+
+    IDS_VARIANT_ERR_USED_BASECLASS,
+    IDS_VARIANT_ERR_MAP_KEY_INVALID,
+
+    IDS_WORD_INVALIDBRKTS,
+    IDS_WORD_NONE,
+    IDS_WORD_NOT,
+    IDS_WORD_INVALIDEMPTY,
+    IDS_WORD_INVALIDNULLPTR,
+    IDS_WORD_UNKNOWNBRKTS,
+    IDS_WORD_NOT_IMPLEMENTED,
+    IDS_WORD_NOT_IMPLEMENTED_BRKTS,
+    IDS_WORD_UNKNOWNTYPE_BRKTS,
+    IDS_WORD_ERR_MSG_NOT_IMPLEMENTED_BRKTS,
+
+    IDS_CMD_ERR_N_OPTIONS_REQUIRED,
+    IDS_CMD_ERR_OPTION_NOT_FOUND,
+    IDS_CMD_ERR_ARGS,
+    IDS_CMD_WRN_ARGS_NOT_HANDLED,
+    IDS_CMD_ERR_FNFAILED,
+    IDS_CMD_ERR_SHARED_DATA_NOT_FOUND,
+    IDS_CMD_ERR_LLDBPROCESS_DETACH,
+    IDS_CMD_ERR_SETWKDIR,
+    IDS_CMD_ERR_INVALID_TARGET,
+    IDS_CMD_ERR_INVALID_TARGET_CURRENT,
+    IDS_CMD_ERR_INVALID_TARGET_TYPE,
+    IDS_CMD_ERR_INVALID_TARGET_PLUGIN,
+    IDS_CMD_ERR_CONNECT_TO_TARGET,
+    IDS_CMD_ERR_INVALID_TARGETPLUGINCURRENT,
+    IDS_CMD_ERR_NOT_IMPLEMENTED,
+    IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED,
+    IDS_CMD_ERR_CREATE_TARGET,
+    IDS_CMD_ERR_BRKPT_LOCATION_FORMAT,
+    IDS_CMD_ERR_BRKPT_INVALID,
+    IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,
+    IDS_CMD_ERR_SOME_ERROR,
+    IDS_CMD_ERR_THREAD_INVALID,
+    IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,
+    IDS_CMD_ERR_FRAME_INVALID,
+    IDS_CMD_ERR_VARIABLE_DOESNOTEXIST,
+    IDS_CMD_ERR_VARIABLE_ENUM_INVALID,
+    IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH,
+    IDS_CMD_ERR_VARIABLE_CREATION_FAILED,
+    IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION,
+    IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION,
+    IDS_CMD_ERR_DISASM_ADDR_START_INVALID,
+    IDS_CMD_ERR_DISASM_ADDR_END_INVALID,
+    IDS_CMD_ERR_MEMORY_ALLOC_FAILURE,
+    IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK,
+    IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES,
+    IDS_CMD_ERR_INVALID_PROCESS,
+    IDS_CMD_ERR_INVALID_FORMAT_TYPE,
+    IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND,
+    IDS_CMD_ERR_LLDB_ERR_WRITE_MEM_BYTES,
+    IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK,
+    IDS_CMD_ERR_SET_NEW_DRIVER_STATE,
+    IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
+    IDS_CMD_ERR_INFO_PRINTFN_FAILED,
+    IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH
 };
 
 //++ ============================================================================
-// Details:	MI common code implementation class. Handle application resources
-//			and locality. 
-//			Singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 29/01/2014.
-// Changes:	None.
+// Details: MI common code implementation class. Handle application resources
+//          and locality.
+//          Singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 29/01/2014.
+// Changes: None.
 //--
-class CMICmnResources
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmnResources >
+class CMICmnResources : public CMICmnBase, public MI::ISingleton<CMICmnResources>
 {
-	friend class MI::ISingleton< CMICmnResources >;
-	
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	
-	CMIUtilString	GetString( const MIuint vResourceId ) const;
-	bool			HasString( const MIuint vResourceId ) const;
-		
-// Typedef:
-private:
-	typedef std::map< MIuint, const MIchar * >	MapRscrIdToTextData_t;
-	typedef std::pair< MIuint, const MIchar * >	MapPairRscrIdToTextData_t;
-
-// Enumerations:
-private:
-	enum Buffer_e
-	{
-		eBufferSize = 2048
-	};
-
-// Structs:
-private:
-	struct SRsrcTextData
-	{
-			  MIuint	id;
-		const MIchar *	pTextData;		
-	};
-
-// Methods:
-private:
-	/* ctor */	CMICmnResources( void );
-	/* ctor */	CMICmnResources( const CMICmnResources & );
-	void		operator=( const CMICmnResources & );
-	
-	bool	GetStringFromResource( const MIuint vResourceId, CMIUtilString & vrwResourceString ) const;
-	bool	ReadResourceStringData( void );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnResources( void );
-
-// Attributes:
-private:
-	static const SRsrcTextData	ms_pResourceId2TextData[];
-	//
-	MIuint						m_nResourceId2TextDataSize;
-	MapRscrIdToTextData_t		m_mapRscrIdToTextData;
+    friend class MI::ISingleton<CMICmnResources>;
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+
+    CMIUtilString GetString(const MIuint vResourceId) const;
+    bool HasString(const MIuint vResourceId) const;
+
+    // Typedef:
+  private:
+    typedef std::map<MIuint, const MIchar *> MapRscrIdToTextData_t;
+    typedef std::pair<MIuint, const MIchar *> MapPairRscrIdToTextData_t;
+
+    // Enumerations:
+  private:
+    enum Buffer_e
+    {
+        eBufferSize = 2048
+    };
+
+    // Structs:
+  private:
+    struct SRsrcTextData
+    {
+        MIuint id;
+        const MIchar *pTextData;
+    };
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnResources(void);
+    /* ctor */ CMICmnResources(const CMICmnResources &);
+    void operator=(const CMICmnResources &);
+
+    bool GetStringFromResource(const MIuint vResourceId, CMIUtilString &vrwResourceString) const;
+    bool ReadResourceStringData(void);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnResources(void);
+
+    // Attributes:
+  private:
+    static const SRsrcTextData ms_pResourceId2TextData[];
+    //
+    MIuint m_nResourceId2TextDataSize;
+    MapRscrIdToTextData_t m_mapRscrIdToTextData;
 };
 
 //++ =========================================================================
 // Details: Macro short cut for retrieving a text data resource
 //--
-#define MIRSRC( x ) CMICmnResources::Instance().GetString( x ).c_str()
+#define MIRSRC(x) CMICmnResources::Instance().GetString(x).c_str()

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStderr.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStderr.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStderr.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStderr.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnStreamStderr.cpp
+// File:        MICmnStreamStderr.cpp
 //
-// Overview:	CMICmnStreamStderr implementation.
+// Overview:    CMICmnStreamStderr implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -26,232 +26,240 @@
 #include "MIDriver.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStderr constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStderr constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStderr::CMICmnStreamStderr( void )
+CMICmnStreamStderr::CMICmnStreamStderr(void)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStderr destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStderr destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStderr::~CMICmnStreamStderr( void )
+CMICmnStreamStderr::~CMICmnStreamStderr(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this stderr stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::Initialize( void )
+// Details: Initialize resources for *this stderr stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
+
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    bool bOk = MIstatus::success;
 
-	bool bOk = MIstatus::success;
-	
 #ifdef _MSC_VER
-	// Debugging / I/O issues with client.
-	// This is only required on Windows if you do not use ::flush(stderr). MI uses 
-	// ::flush(stderr)
-	// It trys to ensure the process attached to the stderr steam gets ALL the data.
-	//::setbuf( stderr, NULL );
+// Debugging / I/O issues with client.
+// This is only required on Windows if you do not use ::flush(stderr). MI uses
+// ::flush(stderr)
+// It trys to ensure the process attached to the stderr steam gets ALL the data.
+//::setbuf( stderr, NULL );
 #endif // _MSC_VER
-	
-	m_bInitialized = bOk;
 
-	return  MIstatus::success;
+    m_bInitialized = bOk;
+
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this stderr stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this stderr stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStderr::Shutdown( void )
+bool
+CMICmnStreamStderr::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
 
-	ClrErrorDescription();
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    ClrErrorDescription();
 
-	return MIstatus::success;
-}	
+    m_bInitialized = false;
+
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Write text data to stderr. Prefix the message with "MI:". The text data does 
-//			not need to include a carrage line return as this is added to the text. The 
-//			function also then passes the text data into the CMICmnLog logger.
-// Type:	Method.
-// Args:	vText		- (R) Text data.
-//			vbSendToLog	- (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::Write( const CMIUtilString & vText, const bool vbSendToLog /* = true */ )
+// Details: Write text data to stderr. Prefix the message with "MI:". The text data does
+//          not need to include a carrage line return as this is added to the text. The
+//          function also then passes the text data into the CMICmnLog logger.
+// Type:    Method.
+// Args:    vText       - (R) Text data.
+//          vbSendToLog - (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::Write(const CMIUtilString &vText, const bool vbSendToLog /* = true */)
 {
-	if( vText.length() == 0 )
-		return MIstatus::failure;
+    if (vText.length() == 0)
+        return MIstatus::failure;
 
-	const CMIUtilString strPrefixed( CMIUtilString::Format( "%s: %s", CMIDriver::Instance().GetAppNameShort().c_str(), vText.c_str() ) );
+    const CMIUtilString strPrefixed(CMIUtilString::Format("%s: %s", CMIDriver::Instance().GetAppNameShort().c_str(), vText.c_str()));
 
-	return WritePriv( strPrefixed, vText, vbSendToLog );
+    return WritePriv(strPrefixed, vText, vbSendToLog);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Write an LLDB text message to stderr. 
-//			The text data does not need to include a carrage line return as this is added 
-//			to the text. The function also then passes the text data into the CMICmnLog 
-//			logger.
-// Type:	Method.
-// Args:	vText		- (R) Text data.
-//			vbSendToLog	- (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::WriteLLDBMsg( const CMIUtilString & vText, const bool vbSendToLog /* = true */ )
+// Details: Write an LLDB text message to stderr.
+//          The text data does not need to include a carrage line return as this is added
+//          to the text. The function also then passes the text data into the CMICmnLog
+//          logger.
+// Type:    Method.
+// Args:    vText       - (R) Text data.
+//          vbSendToLog - (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::WriteLLDBMsg(const CMIUtilString &vText, const bool vbSendToLog /* = true */)
 {
-	if( vText.length() == 0 )
-		return MIstatus::failure;
+    if (vText.length() == 0)
+        return MIstatus::failure;
 
-	const CMIUtilString strPrefixed( CMIUtilString::Format( "LLDB: %s", vText.c_str() ) );
+    const CMIUtilString strPrefixed(CMIUtilString::Format("LLDB: %s", vText.c_str()));
 
-	return WritePriv( vText, strPrefixed, vbSendToLog );
+    return WritePriv(vText, strPrefixed, vbSendToLog);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Write text data to stderr. The text data does not need to
-//			include a carrage line return as this is added to the text. The function also
-//			then passes the text data into the CMICmnLog logger.
-// Type:	Method.
-// Args:	vText			- (R) Text data. May be prefixed with MI app's short name.
-//			vTxtForLogFile	- (R) Text data.
-//			vbSendToLog		- (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::WritePriv( const CMIUtilString & vText, const CMIUtilString & vTxtForLogFile, const bool vbSendToLog /* = true */ )
-{
-	if( vText.length() == 0 )
-		return MIstatus::failure;
+// Details: Write text data to stderr. The text data does not need to
+//          include a carrage line return as this is added to the text. The function also
+//          then passes the text data into the CMICmnLog logger.
+// Type:    Method.
+// Args:    vText           - (R) Text data. May be prefixed with MI app's short name.
+//          vTxtForLogFile  - (R) Text data.
+//          vbSendToLog     - (R) True = Yes send to the Log file too, false = do not. (Dflt = true)
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::WritePriv(const CMIUtilString &vText, const CMIUtilString &vTxtForLogFile, const bool vbSendToLog /* = true */)
+{
+    if (vText.length() == 0)
+        return MIstatus::failure;
+
+    bool bOk = MIstatus::success;
+    {
+        // Grab the stderr thread lock while we print
+        CMIUtilThreadLock _lock(m_mutex);
+
+        // Send this text to stderr
+        const MIint status = ::fputs(vText.c_str(), stderr);
+        if (status == EOF)
+        {
+            const CMIUtilString errMsg(CMIUtilString::Format(MIRSRC(IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN), vText.c_str()));
+            SetErrorDescription(errMsg);
+            bOk = MIstatus::failure;
+        }
+        else
+        {
+            ::fprintf(stderr, "\n");
+            ::fflush(stderr);
+        }
+
+        // Send this text to the log
+        if (bOk && vbSendToLog)
+            bOk &= m_pLog->WriteLog(vTxtForLogFile);
+    }
 
-	bool bOk = MIstatus::success;
-	{
-		// Grab the stderr thread lock while we print
-		CMIUtilThreadLock _lock( m_mutex );
-
-		// Send this text to stderr
-		const MIint status = ::fputs( vText.c_str(), stderr );
-		if( status == EOF )
-		{
-			const CMIUtilString errMsg( CMIUtilString::Format( MIRSRC( IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN ), vText.c_str() ) );
-			SetErrorDescription( errMsg );
-			bOk = MIstatus::failure;
-		}
-		else
-		{
-			::fprintf( stderr, "\n" );
-			::fflush( stderr );
-		}
-
-		// Send this text to the log
-		if( bOk && vbSendToLog )
-			bOk &= m_pLog->WriteLog( vTxtForLogFile );
-	}
-	
-	return bOk;
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Lock the availability of the stream stderr. Other users of *this stream will 
-//			be stalled until it is available (Unlock()).
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Lock the availability of the stream stderr. Other users of *this stream will
+//          be stalled until it is available (Unlock()).
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStderr::Lock( void )
+bool
+CMICmnStreamStderr::Lock(void)
 {
-	m_mutex.Lock();
-	return MIstatus::success;
+    m_mutex.Lock();
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release a previously locked stderr.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release a previously locked stderr.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStderr::Unlock( void )
+bool
+CMICmnStreamStderr::Unlock(void)
 {
-	m_mutex.Unlock();
-	return MIstatus::success;
+    m_mutex.Unlock();
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Take MI Driver text message and send to the stderr stream. Also output to the
-//			 MI Log file.
-// Type:	Static method.
-// Args:	vrTxt	- (R) Text.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::TextToStderr( const CMIUtilString & vrTxt )
-{
-	const bool bLock = CMICmnStreamStderr::Instance().Lock();
-	const bool bOk = bLock && CMICmnStreamStderr::Instance().Write( vrTxt );
-	bLock && CMICmnStreamStderr::Instance().Unlock();
-	
-	return bOk;
+// Details: Take MI Driver text message and send to the stderr stream. Also output to the
+//           MI Log file.
+// Type:    Static method.
+// Args:    vrTxt   - (R) Text.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::TextToStderr(const CMIUtilString &vrTxt)
+{
+    const bool bLock = CMICmnStreamStderr::Instance().Lock();
+    const bool bOk = bLock && CMICmnStreamStderr::Instance().Write(vrTxt);
+    bLock &&CMICmnStreamStderr::Instance().Unlock();
+
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Take an LLDB message and send to the stderr stream. The message is not always
-//			an error message. The user has typed a command in to the Eclipse console (by-
-//			passing Eclipse) and this is the result message from LLDB back to the user.
-//			Also output to the MI Log file.
-// Type:	Static method.
-// Args:	vrTxt	- (R) Text.
-// Return:	MIstatus::success - Functionality succeeded.
-//			MIstatus::failure - Functionality failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStderr::LLDBMsgToConsole( const CMIUtilString & vrTxt )
-{
-	const bool bLock = CMICmnStreamStderr::Instance().Lock();
-	const bool bOk = bLock && CMICmnStreamStderr::Instance().WriteLLDBMsg( vrTxt );
-	bLock && CMICmnStreamStderr::Instance().Unlock();
-	
-	return bOk;
-}
+// Details: Take an LLDB message and send to the stderr stream. The message is not always
+//          an error message. The user has typed a command in to the Eclipse console (by-
+//          passing Eclipse) and this is the result message from LLDB back to the user.
+//          Also output to the MI Log file.
+// Type:    Static method.
+// Args:    vrTxt   - (R) Text.
+// Return:  MIstatus::success - Functionality succeeded.
+//          MIstatus::failure - Functionality failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStderr::LLDBMsgToConsole(const CMIUtilString &vrTxt)
+{
+    const bool bLock = CMICmnStreamStderr::Instance().Lock();
+    const bool bOk = bLock && CMICmnStreamStderr::Instance().WriteLLDBMsg(vrTxt);
+    bLock &&CMICmnStreamStderr::Instance().Unlock();
 
+    return bOk;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStderr.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStderr.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStderr.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStderr.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MICmnStreamStderr.h
+// File:        MICmnStreamStderr.h
 //
-// Overview:	CMICmnStreamStderr interface.
+// Overview:    CMICmnStreamStderr interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -28,49 +28,47 @@
 #include "MIUtilThreadBaseStd.h"
 
 //++ ============================================================================
-// Details:	MI common code class. The MI driver requires this object. 
-//			CMICmnStreamStderr sets up and tears downs stderr for the driver.
-//			
-//			Singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 19/03/2014.
-// Changes:	None.
+// Details: MI common code class. The MI driver requires this object.
+//          CMICmnStreamStderr sets up and tears downs stderr for the driver.
+//
+//          Singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 19/03/2014.
+// Changes: None.
 //--
-class CMICmnStreamStderr
-:	public CMICmnBase
-,	public MI::ISingleton< CMICmnStreamStderr >
+class CMICmnStreamStderr : public CMICmnBase, public MI::ISingleton<CMICmnStreamStderr>
 {
-	friend class MI::ISingleton< CMICmnStreamStderr >;
+    friend class MI::ISingleton<CMICmnStreamStderr>;
 
-// Statics:
-public:
-	static bool	TextToStderr( const CMIUtilString & vrTxt );
-	static bool	LLDBMsgToConsole( const CMIUtilString & vrTxt );
-
-	// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	//
-	bool	Lock( void );										
-	bool	Unlock( void );										
-	bool	Write( const CMIUtilString & vText, const bool vbSendToLog = true );
-	bool	WriteLLDBMsg( const CMIUtilString & vText, const bool vbSendToLog = true );
-
-// Methods:
-private:
-	/* ctor */	CMICmnStreamStderr( void );
-	/* ctor */	CMICmnStreamStderr( const CMICmnStreamStderr & );
-	void		operator=( const CMICmnStreamStderr & );
-	//
-	bool	WritePriv( const CMIUtilString & vText, const CMIUtilString & vTxtForLogFile, const bool vbSendToLog = true );
-	
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnStreamStderr( void );
-
-// Attributes:
-private:
-	CMIUtilThreadMutex m_mutex;	// Mutex object for sync during Write()
+    // Statics:
+  public:
+    static bool TextToStderr(const CMIUtilString &vrTxt);
+    static bool LLDBMsgToConsole(const CMIUtilString &vrTxt);
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    //
+    bool Lock(void);
+    bool Unlock(void);
+    bool Write(const CMIUtilString &vText, const bool vbSendToLog = true);
+    bool WriteLLDBMsg(const CMIUtilString &vText, const bool vbSendToLog = true);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnStreamStderr(void);
+    /* ctor */ CMICmnStreamStderr(const CMICmnStreamStderr &);
+    void operator=(const CMICmnStreamStderr &);
+    //
+    bool WritePriv(const CMIUtilString &vText, const CMIUtilString &vTxtForLogFile, const bool vbSendToLog = true);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnStreamStderr(void);
+
+    // Attributes:
+  private:
+    CMIUtilThreadMutex m_mutex; // Mutex object for sync during Write()
 };

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MIUtilStreamStdin.cpp
+// File:        MIUtilStreamStdin.cpp
 //
-// Overview:	CMICmnStreamStdin implementation.
+// Overview:    CMICmnStreamStdin implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // In-house headers:
@@ -27,7 +27,7 @@
 #include "MICmnThreadMgrStd.h"
 #include "MIUtilSingletonHelper.h"
 #include "MIDriver.h"
-#if defined( _MSC_VER )
+#if defined(_MSC_VER)
 #include "MIUtilSystemWindows.h"
 #include "MICmnStreamStdinWindows.h"
 #else
@@ -35,387 +35,402 @@
 #endif // defined( _MSC_VER )
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdin constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStdin constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStdin::CMICmnStreamStdin( void )
-:	m_constStrThisThreadname( "MI stdin thread" )
-,	m_pVisitor( nullptr )
-,	m_strPromptCurrent( "(gdb)" )
-,	m_bKeyCtrlCHit( false )
-,	m_bShowPrompt( false )
-,	m_bRedrawPrompt( true )
-,	m_pStdinReadHandler( nullptr )
+CMICmnStreamStdin::CMICmnStreamStdin(void)
+    : m_constStrThisThreadname("MI stdin thread")
+    , m_pVisitor(nullptr)
+    , m_strPromptCurrent("(gdb)")
+    , m_bKeyCtrlCHit(false)
+    , m_bShowPrompt(false)
+    , m_bRedrawPrompt(true)
+    , m_pStdinReadHandler(nullptr)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdin destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStdin destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStdin::~CMICmnStreamStdin( void )
+CMICmnStreamStdin::~CMICmnStreamStdin(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::Initialize( void )
+bool
+CMICmnStreamStdin::Initialize(void)
 {
-	m_clientUsageRefCnt++;
+    m_clientUsageRefCnt++;
 
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
 
-	// Note initialisation order is important here as some resources depend on previous
-	MI::ModuleInit< CMICmnLog >			( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
-	MI::ModuleInit< CMICmnResources >	( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-	MI::ModuleInit< CMICmnThreadMgrStd >( IDS_MI_INIT_ERR_THREADMGR, bOk, errMsg );
+    // Note initialisation order is important here as some resources depend on previous
+    MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+    MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleInit<CMICmnThreadMgrStd>(IDS_MI_INIT_ERR_THREADMGR, bOk, errMsg);
 #ifdef _MSC_VER
-	MI::ModuleInit< CMICmnStreamStdinWindows >( IDS_MI_INIT_ERR_OS_STDIN_HANDLER, bOk, errMsg );
-	bOk = bOk && SetOSStdinHandler( CMICmnStreamStdinWindows::Instance() );
+    MI::ModuleInit<CMICmnStreamStdinWindows>(IDS_MI_INIT_ERR_OS_STDIN_HANDLER, bOk, errMsg);
+    bOk = bOk && SetOSStdinHandler(CMICmnStreamStdinWindows::Instance());
 #else
-	MI::ModuleInit< CMICmnStreamStdinLinux >( IDS_MI_INIT_ERR_OS_STDIN_HANDLER, bOk, errMsg );
-	bOk = bOk && SetOSStdinHandler( CMICmnStreamStdinLinux::Instance() );
+    MI::ModuleInit<CMICmnStreamStdinLinux>(IDS_MI_INIT_ERR_OS_STDIN_HANDLER, bOk, errMsg);
+    bOk = bOk && SetOSStdinHandler(CMICmnStreamStdinLinux::Instance());
 #endif // ( _MSC_VER )
 
-	// The OS specific stdin stream handler must be set before *this class initialises
-	if( bOk && m_pStdinReadHandler == nullptr )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-		return MIstatus::failure;
-	}
+    // The OS specific stdin stream handler must be set before *this class initialises
+    if (bOk && m_pStdinReadHandler == nullptr)
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+        return MIstatus::failure;
+    }
 
-	// Other resources required
-	if( bOk )
-	{
-		m_bKeyCtrlCHit = false; // Reset
-	}
+    // Other resources required
+    if (bOk)
+    {
+        m_bKeyCtrlCHit = false; // Reset
+    }
 
-	m_bInitialized = bOk;
+    m_bInitialized = bOk;
 
-	if( !bOk )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_STREAMSTDIN ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-		return MIstatus::failure;
-	}
+    if (!bOk)
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_STREAMSTDIN), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+        return MIstatus::failure;
+    }
 
-	return  MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::Shutdown( void )
+bool
+CMICmnStreamStdin::Shutdown(void)
 {
-	if( --m_clientUsageRefCnt > 0 )
-		return MIstatus::success;
-	
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (--m_clientUsageRefCnt > 0)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	ClrErrorDescription();
+    m_bInitialized = false;
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
+    ClrErrorDescription();
 
-	m_pVisitor = nullptr;
-	m_bKeyCtrlCHit = false;
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
 
-	// Note shutdown order is important here 	
+    m_pVisitor = nullptr;
+    m_bKeyCtrlCHit = false;
+
+// Note shutdown order is important here
 #ifndef _MSC_VER
-	MI::ModuleShutdown< CMICmnStreamStdinLinux >( IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, bOk, errMsg );
+    MI::ModuleShutdown<CMICmnStreamStdinLinux>(IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, bOk, errMsg);
 #else
-	MI::ModuleShutdown< CMICmnStreamStdinWindows >( IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, bOk, errMsg );
+    MI::ModuleShutdown<CMICmnStreamStdinWindows>(IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, bOk, errMsg);
 #endif // ( _MSC_VER )
-	MI::ModuleShutdown< CMICmnThreadMgrStd >( IDS_MI_SHTDWN_ERR_THREADMGR, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnResources >   ( IDE_MI_SHTDWN_ERR_RESOURCES, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLog >         ( IDS_MI_SHTDWN_ERR_LOG      , bOk, errMsg );
+    MI::ModuleShutdown<CMICmnThreadMgrStd>(IDS_MI_SHTDWN_ERR_THREADMGR, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnResources>(IDE_MI_SHTDWN_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLog>(IDS_MI_SHTDWN_ERR_LOG, bOk, errMsg);
 
-	if( !bOk )
-	{
-		SetErrorDescriptionn( MIRSRC( IDE_MI_SHTDWN_ERR_STREAMSTDIN ), errMsg.c_str() );
-	}
+    if (!bOk)
+    {
+        SetErrorDescriptionn(MIRSRC(IDE_MI_SHTDWN_ERR_STREAMSTDIN), errMsg.c_str());
+    }
 
-	return MIstatus::success;
-}	
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Validate and set the text that forms the prompt on the command line.
-// Type:	Method.
-// Args:	vNewPrompt	- (R) Text description.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Validate and set the text that forms the prompt on the command line.
+// Type:    Method.
+// Args:    vNewPrompt  - (R) Text description.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::SetPrompt( const CMIUtilString & vNewPrompt )
+bool
+CMICmnStreamStdin::SetPrompt(const CMIUtilString &vNewPrompt)
 {
-	if( vNewPrompt.empty() )
-	{
-		const CMIUtilString msg( CMIUtilString::Format( MIRSRC( IDS_STDIN_ERR_INVALID_PROMPT), vNewPrompt.c_str() ) );
-		CMICmnStreamStdout::Instance().Write( msg );
-		return MIstatus::failure;
-	}
+    if (vNewPrompt.empty())
+    {
+        const CMIUtilString msg(CMIUtilString::Format(MIRSRC(IDS_STDIN_ERR_INVALID_PROMPT), vNewPrompt.c_str()));
+        CMICmnStreamStdout::Instance().Write(msg);
+        return MIstatus::failure;
+    }
 
-	m_strPromptCurrent = vNewPrompt;
+    m_strPromptCurrent = vNewPrompt;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve the command line prompt text currently being used.
-// Type:	Method.
-// Args:	None.
-// Return:	const CMIUtilString & - Functional failed.
-// Throws:	None.
+// Details: Retrieve the command line prompt text currently being used.
+// Type:    Method.
+// Args:    None.
+// Return:  const CMIUtilString & - Functional failed.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnStreamStdin::GetPrompt( void ) const
+const CMIUtilString &
+CMICmnStreamStdin::GetPrompt(void) const
 {
-	return m_strPromptCurrent;
+    return m_strPromptCurrent;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Wait on input from stream Stdin. On each line of input received it is 
-//			validated and providing there are no errors on the stream or the input
-//			buffer is not exceeded the data is passed to the visitor.
-// Type:	Method.
-// Args:	vrVisitor	- (W) A client deriver callback.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Wait on input from stream Stdin. On each line of input received it is
+//          validated and providing there are no errors on the stream or the input
+//          buffer is not exceeded the data is passed to the visitor.
+// Type:    Method.
+// Args:    vrVisitor   - (W) A client deriver callback.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::SetVisitor( IStreamStdin & vrVisitor )
+bool
+CMICmnStreamStdin::SetVisitor(IStreamStdin &vrVisitor)
 {
-	m_pVisitor = &vrVisitor;
-	return MIstatus::success;
+    m_pVisitor = &vrVisitor;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
 // Details: Set whether to display optional command line prompt. The prompt is output to
-//			stdout. Disable it when this may interfere with the client reading stdout as
-//			input and it tries to interpret the prompt text to.
-// Type:	Method.
-// Args:	vbYes	- (R) True = Yes prompt is shown/output to the user (stdout), false = no prompt.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+//          stdout. Disable it when this may interfere with the client reading stdout as
+//          input and it tries to interpret the prompt text to.
+// Type:    Method.
+// Args:    vbYes   - (R) True = Yes prompt is shown/output to the user (stdout), false = no prompt.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-void CMICmnStreamStdin::SetEnablePrompt( const bool vbYes )
+void
+CMICmnStreamStdin::SetEnablePrompt(const bool vbYes)
 {
-	m_bShowPrompt = vbYes;
+    m_bShowPrompt = vbYes;
 }
 
 //++ ------------------------------------------------------------------------------------
 // Details: Get whether to display optional command line prompt. The prompt is output to
-//			stdout. Disable it when this may interfere with the client reading stdout as
-//			input and it tries to interpret the prompt text to.
-// Type:	Method.
-// Args:	None. 
-// Return:	bool - True = Yes prompt is shown/output to the user (stdout), false = no prompt.
-// Throws:	None.
-//--
-bool CMICmnStreamStdin::GetEnablePrompt( void ) const
-{
-	return m_bShowPrompt;
+//          stdout. Disable it when this may interfere with the client reading stdout as
+//          input and it tries to interpret the prompt text to.
+// Type:    Method.
+// Args:    None.
+// Return:  bool - True = Yes prompt is shown/output to the user (stdout), false = no prompt.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdin::GetEnablePrompt(void) const
+{
+    return m_bShowPrompt;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if stdin has any characters present in its buffer.
-// Type:	Method.
-// Args:	vwbAvail	- (W) True = There is chars available, false = nothing there.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStdin::InputAvailable( bool & vwbAvail )
-{
-	return m_pStdinReadHandler->InputAvailable( vwbAvail );
+// Details: Determine if stdin has any characters present in its buffer.
+// Type:    Method.
+// Args:    vwbAvail    - (W) True = There is chars available, false = nothing there.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdin::InputAvailable(bool &vwbAvail)
+{
+    return m_pStdinReadHandler->InputAvailable(vwbAvail);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	The monitoring on new line data calls back to the visitor object registered 
-//			with *this stdin monitoring. The monitoring to stops when the visitor returns 
-//			true for bYesExit flag. Errors output to log file.
-//			This function runs in the thread "MI stdin monitor".
-// Type:	Method.
-//			vrwbYesAlive	- (W) False = yes exit stdin monitoring, true = continue monitor.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStdin::MonitorStdin( bool & vrwbYesAlive )
-{
-	if( m_bShowPrompt )
-	{
-		CMICmnStreamStdout & rStdoutMan = CMICmnStreamStdout::Instance();
-		rStdoutMan.WriteMIResponse( m_strPromptCurrent.c_str() );
-		m_bRedrawPrompt = false;
-	}
-
-	// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
-	if( m_bKeyCtrlCHit )
-	{
-		CMIDriver & rMIDriver = CMIDriver::Instance();
-		rMIDriver.SetExitApplicationFlag( false );
-		if( rMIDriver.GetExitApplicationFlag() )
-		{
-			vrwbYesAlive = false;
-			return MIstatus::success;
-		}
-
-		// Reset - the MI Driver received SIGINT during a running debug programm session
-		m_bKeyCtrlCHit = false;
-	}
+// Details: The monitoring on new line data calls back to the visitor object registered
+//          with *this stdin monitoring. The monitoring to stops when the visitor returns
+//          true for bYesExit flag. Errors output to log file.
+//          This function runs in the thread "MI stdin monitor".
+// Type:    Method.
+//          vrwbYesAlive    - (W) False = yes exit stdin monitoring, true = continue monitor.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdin::MonitorStdin(bool &vrwbYesAlive)
+{
+    if (m_bShowPrompt)
+    {
+        CMICmnStreamStdout &rStdoutMan = CMICmnStreamStdout::Instance();
+        rStdoutMan.WriteMIResponse(m_strPromptCurrent.c_str());
+        m_bRedrawPrompt = false;
+    }
+
+    // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
+    if (m_bKeyCtrlCHit)
+    {
+        CMIDriver &rMIDriver = CMIDriver::Instance();
+        rMIDriver.SetExitApplicationFlag(false);
+        if (rMIDriver.GetExitApplicationFlag())
+        {
+            vrwbYesAlive = false;
+            return MIstatus::success;
+        }
+
+        // Reset - the MI Driver received SIGINT during a running debug programm session
+        m_bKeyCtrlCHit = false;
+    }
 
 #if MICONFIG_POLL_FOR_STD_IN
-	bool bAvail = true;
-	// Check if there is stdin available
-	if( InputAvailable( bAvail ) )
-	{
-		// Early exit when there is no input
-		if( !bAvail )
-			return MIstatus::success;
-	}
-	else
-	{
-		vrwbYesAlive = false;
-		CMIDriver::Instance().SetExitApplicationFlag( true );
-		return MIstatus::failure;
-	}
+    bool bAvail = true;
+    // Check if there is stdin available
+    if (InputAvailable(bAvail))
+    {
+        // Early exit when there is no input
+        if (!bAvail)
+            return MIstatus::success;
+    }
+    else
+    {
+        vrwbYesAlive = false;
+        CMIDriver::Instance().SetExitApplicationFlag(true);
+        return MIstatus::failure;
+    }
 #endif // MICONFIG_POLL_FOR_STD_IN
 
-	// Read a line from std input
-	CMIUtilString stdinErrMsg;
-	const MIchar * pText = ReadLine( stdinErrMsg );
+    // Read a line from std input
+    CMIUtilString stdinErrMsg;
+    const MIchar *pText = ReadLine(stdinErrMsg);
+
+    // Did something go wrong
+    const bool bHaveError(!stdinErrMsg.empty());
+    if ((pText == nullptr) || bHaveError)
+    {
+        if (bHaveError)
+        {
+            CMICmnStreamStdout::Instance().Write(stdinErrMsg);
+        }
+        return MIstatus::failure;
+    }
 
-	// Did something go wrong
-	const bool bHaveError( !stdinErrMsg.empty() );
-	if( (pText == nullptr) || bHaveError )
-	{
-		if( bHaveError )
-		{
-			CMICmnStreamStdout::Instance().Write( stdinErrMsg );
-		}
-		return MIstatus::failure;
-	}
+    // We have text so send it off to the visitor
+    bool bOk = MIstatus::success;
+    if (m_pVisitor != nullptr)
+    {
+        bool bYesExit = false;
+        bOk = m_pVisitor->ReadLine(CMIUtilString(pText), bYesExit);
+        m_bRedrawPrompt = true;
+        vrwbYesAlive = !bYesExit;
+    }
 
-	// We have text so send it off to the visitor
-	bool bOk = MIstatus::success;
-	if( m_pVisitor != nullptr )
-	{
-		bool bYesExit = false;
-		bOk = m_pVisitor->ReadLine( CMIUtilString( pText ), bYesExit );
-		m_bRedrawPrompt = true;
-		vrwbYesAlive = !bYesExit;
-	}
-	
-	return bOk;
+    return bOk;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Wait on new line of data from stdin stream (completed by '\n' or '\r').
-// Type:	Method.
-// Args:	vwErrMsg	- (W) Empty string ok or error description.			
-// Return:	MIchar * - text buffer pointer or NULL on failure.
-// Throws:	None.
+// Details: Wait on new line of data from stdin stream (completed by '\n' or '\r').
+// Type:    Method.
+// Args:    vwErrMsg    - (W) Empty string ok or error description.
+// Return:  MIchar * - text buffer pointer or NULL on failure.
+// Throws:  None.
 //--
-const MIchar * CMICmnStreamStdin::ReadLine( CMIUtilString & vwErrMsg )
+const MIchar *
+CMICmnStreamStdin::ReadLine(CMIUtilString &vwErrMsg)
 {
-	return m_pStdinReadHandler->ReadLine( vwErrMsg );
+    return m_pStdinReadHandler->ReadLine(vwErrMsg);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Inform *this stream that the user hit Control-C key to exit.
-//			The function is normally called by the SIGINT signal in sigint_handler() to 
-//			simulate kill app from the client.
-//			This function is called by a Kernel thread.
-// Type:	Method.
-// Args:	None.			
-// Return:	None.
-// Throws:	None.
+// Details: Inform *this stream that the user hit Control-C key to exit.
+//          The function is normally called by the SIGINT signal in sigint_handler() to
+//          simulate kill app from the client.
+//          This function is called by a Kernel thread.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-void CMICmnStreamStdin::SetCtrlCHit( void )
+void
+CMICmnStreamStdin::SetCtrlCHit(void)
 {
-	CMIUtilThreadLock lock( m_mutex );
-	m_bKeyCtrlCHit = true;
+    CMIUtilThreadLock lock(m_mutex);
+    m_bKeyCtrlCHit = true;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	The main worker method for this thread.
-// Type:	Overridden.
-// Args:	vrbIsAlive	= (W) True = *this thread is working, false = thread has exited.			
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: The main worker method for this thread.
+// Type:    Overridden.
+// Args:    vrbIsAlive  - (W) True = *this thread is working, false = thread has exited.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::ThreadRun( bool & vrbIsAlive )
+bool
+CMICmnStreamStdin::ThreadRun(bool &vrbIsAlive)
 {
-	return MonitorStdin( vrbIsAlive );
+    return MonitorStdin(vrbIsAlive);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Let this thread clean up after itself.
-// Type:	Overridden.
-// Args:	None.			
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Let this thread clean up after itself.
+// Type:    Overridden.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::ThreadFinish( void )
+bool
+CMICmnStreamStdin::ThreadFinish(void)
 {
-	// Do nothing - override to implement
-	return MIstatus::success;
+    // Do nothing - override to implement
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Retrieve *this thread object's name.
-// Type:	Overridden.
-// Args:	None.			
-// Return:	CMIUtilString & - Text.
-// Throws:	None.
+// Details: Retrieve *this thread object's name.
+// Type:    Overridden.
+// Args:    None.
+// Return:  CMIUtilString & - Text.
+// Throws:  None.
 //--
-const CMIUtilString & CMICmnStreamStdin::ThreadGetName( void ) const
+const CMIUtilString &
+CMICmnStreamStdin::ThreadGetName(void) const
 {
-	return m_constStrThisThreadname;
+    return m_constStrThisThreadname;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Mandatory set the OS specific stream stdin handler. *this class utilises the
-//			handler to read data from the stdin stream and put into a queue for the 
-//			driver to read when able.
-// Type:	Method.
-// Args:	None.			
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Mandatory set the OS specific stream stdin handler. *this class utilises the
+//          handler to read data from the stdin stream and put into a queue for the
+//          driver to read when able.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdin::SetOSStdinHandler( IOSStdinHandler & vrHandler )
+bool
+CMICmnStreamStdin::SetOSStdinHandler(IOSStdinHandler &vrHandler)
 {
-	m_pStdinReadHandler = &vrHandler;
+    m_pStdinReadHandler = &vrHandler;
 
-	return MIstatus::success;
+    return MIstatus::success;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MIUtilStreamStdin.h
+// File:        MIUtilStreamStdin.h
 //
-// Overview:	CMICmnStreamStdin interface.
+// Overview:    CMICmnStreamStdin interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -28,98 +28,96 @@
 #include "MIUtilSingletonBase.h"
 
 //++ ============================================================================
-// Details:	MI common code class. Used to handle stream data from Stdin.
-//			Singleton class using the Visitor pattern. A driver using the interface
-//			provide can receive callbacks when a new line of data is received.
-//			Each line is determined by a carriage return.
-//			A singleton class.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 10/02/2014.
-// Changes:	Factored out OS specific handling of reading stdin	- IOR 16/06/2014.
+// Details: MI common code class. Used to handle stream data from Stdin.
+//          Singleton class using the Visitor pattern. A driver using the interface
+//          provide can receive callbacks when a new line of data is received.
+//          Each line is determined by a carriage return.
+//          A singleton class.
+// Gotchas: None.
+// Authors: Illya Rudkin 10/02/2014.
+// Changes: Factored out OS specific handling of reading stdin  - IOR 16/06/2014.
 //--
-class CMICmnStreamStdin
-:	public CMICmnBase
-,	public CMIUtilThreadActiveObjBase
-,	public MI::ISingleton< CMICmnStreamStdin >
+class CMICmnStreamStdin : public CMICmnBase, public CMIUtilThreadActiveObjBase, public MI::ISingleton<CMICmnStreamStdin>
 {
-	// Give singleton access to private constructors
-	friend MI::ISingleton< CMICmnStreamStdin >;
+    // Give singleton access to private constructors
+    friend MI::ISingleton<CMICmnStreamStdin>;
 
-// Class:
-public:
-	//++
-	// Description: Visitor pattern. Driver(s) use this interface to get a callback
-	//				on each new line of data received from stdin.
-	//--
-	class IStreamStdin
-	{
-	public:
-		virtual bool ReadLine( const CMIUtilString & vStdInBuffer, bool & vrwbYesExit ) = 0;
-
-		/* dtor */ virtual ~IStreamStdin( void ) {};
-	};
-
-	//++
-	// Description: Specific OS stdin handling implementations are created and used by *this
-	//				class. Seperates out functionality and enables handler to be set 
-	//				dynamically depended on the OS detected. 
-	//--
-	class IOSStdinHandler
-	{
-	public:
-		virtual bool			InputAvailable( bool & vwbAvail ) = 0;
-		virtual const MIchar *	ReadLine( CMIUtilString & vwErrMsg ) = 0;
-
-		/* dtor */ virtual ~IOSStdinHandler( void ) {};
-	};
-		
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-	//
-	const CMIUtilString &	GetPrompt( void ) const;
-	bool					SetPrompt( const CMIUtilString & vNewPrompt );
-	void					SetEnablePrompt( const bool vbYes );
-	bool					GetEnablePrompt( void ) const;
-	void					SetCtrlCHit( void );
-	bool					SetVisitor( IStreamStdin & vrVisitor );
-	bool					SetOSStdinHandler( IOSStdinHandler & vrHandler );
-	
-// Overridden:
-public:
-	// From CMIUtilThreadActiveObjBase
-	virtual const CMIUtilString & ThreadGetName( void ) const;
-	
-// Overridden:
-protected:
-	// From CMIUtilThreadActiveObjBase
-	virtual bool ThreadRun( bool & vrIsAlive );
-	virtual bool ThreadFinish( void );							// Let this thread clean up after itself
-
-// Methods:
-private:
-	/* ctor */	CMICmnStreamStdin( void );
-	/* ctor */	CMICmnStreamStdin( const CMICmnStreamStdin & );
-	void		operator=( const CMICmnStreamStdin & );
-	
-	bool			MonitorStdin( bool & vrwbYesExit );
-	const MIchar *	ReadLine( CMIUtilString & vwErrMsg );
-	bool			InputAvailable( bool & vbAvail );					// Bytes are available on stdin
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnStreamStdin( void );
-
-// Attributes:
-private:
-	const CMIUtilString	m_constStrThisThreadname;
-	IStreamStdin *		m_pVisitor;
-	CMIUtilString		m_strPromptCurrent;		// Command line prompt as shown to the user
-	volatile bool		m_bKeyCtrlCHit;			// True = User hit Ctrl-C, false = has not yet
-	bool				m_bShowPrompt;			// True = Yes prompt is shown/output to the user (stdout), false = no prompt
-	bool				m_bRedrawPrompt;		// True = Prompt needs to be redrawn
-	IOSStdinHandler *	m_pStdinReadHandler;
+    // Class:
+  public:
+    //++
+    // Description: Visitor pattern. Driver(s) use this interface to get a callback
+    //              on each new line of data received from stdin.
+    //--
+    class IStreamStdin
+    {
+      public:
+        virtual bool ReadLine(const CMIUtilString &vStdInBuffer, bool &vrwbYesExit) = 0;
+
+        /* dtor */ virtual ~IStreamStdin(void){};
+    };
+
+    //++
+    // Description: Specific OS stdin handling implementations are created and used by *this
+    //              class. Seperates out functionality and enables handler to be set
+    //              dynamically depended on the OS detected.
+    //--
+    class IOSStdinHandler
+    {
+      public:
+        virtual bool InputAvailable(bool &vwbAvail) = 0;
+        virtual const MIchar *ReadLine(CMIUtilString &vwErrMsg) = 0;
+
+        /* dtor */ virtual ~IOSStdinHandler(void){};
+    };
+
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+    //
+    const CMIUtilString &GetPrompt(void) const;
+    bool SetPrompt(const CMIUtilString &vNewPrompt);
+    void SetEnablePrompt(const bool vbYes);
+    bool GetEnablePrompt(void) const;
+    void SetCtrlCHit(void);
+    bool SetVisitor(IStreamStdin &vrVisitor);
+    bool SetOSStdinHandler(IOSStdinHandler &vrHandler);
+
+    // Overridden:
+  public:
+    // From CMIUtilThreadActiveObjBase
+    virtual const CMIUtilString &ThreadGetName(void) const;
+
+    // Overridden:
+  protected:
+    // From CMIUtilThreadActiveObjBase
+    virtual bool ThreadRun(bool &vrIsAlive);
+    virtual bool
+    ThreadFinish(void); // Let this thread clean up after itself
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnStreamStdin(void);
+    /* ctor */ CMICmnStreamStdin(const CMICmnStreamStdin &);
+    void operator=(const CMICmnStreamStdin &);
+
+    bool MonitorStdin(bool &vrwbYesExit);
+    const MIchar *ReadLine(CMIUtilString &vwErrMsg);
+    bool
+    InputAvailable(bool &vbAvail); // Bytes are available on stdin
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnStreamStdin(void);
+
+    // Attributes:
+  private:
+    const CMIUtilString m_constStrThisThreadname;
+    IStreamStdin *m_pVisitor;
+    CMIUtilString m_strPromptCurrent; // Command line prompt as shown to the user
+    volatile bool m_bKeyCtrlCHit;     // True = User hit Ctrl-C, false = has not yet
+    bool m_bShowPrompt;               // True = Yes prompt is shown/output to the user (stdout), false = no prompt
+    bool m_bRedrawPrompt;             // True = Prompt needs to be redrawn
+    IOSStdinHandler *m_pStdinReadHandler;
 };
-

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp Mon Nov 17 12:06:21 2014
@@ -8,22 +8,22 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MIUtilStreamStdin.cpp
+// File:        MIUtilStreamStdin.cpp
 //
-// Overview:	CMICmnStreamStdinLinux implementation.
+// Overview:    CMICmnStreamStdinLinux implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third Party Headers:
-#if !defined( _MSC_VER )
+#if !defined(_MSC_VER)
 #include <sys/select.h>
 #include <termios.h>
-#endif // !defined( _MSC_VER )
+#endif              // !defined( _MSC_VER )
 #include <string.h> // For std::strerror()
 
 // In-house headers:
@@ -33,180 +33,183 @@
 #include "MIUtilSingletonHelper.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdinLinux constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
-//--
-CMICmnStreamStdinLinux::CMICmnStreamStdinLinux( void )
-:	m_constBufferSize( 1024 )
-,	m_pStdin( nullptr )
-,	m_pCmdBuffer( nullptr )
+// Details: CMICmnStreamStdinLinux constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
+//--
+CMICmnStreamStdinLinux::CMICmnStreamStdinLinux(void)
+    : m_constBufferSize(1024)
+    , m_pStdin(nullptr)
+    , m_pCmdBuffer(nullptr)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdinLinux destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStdinLinux destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStdinLinux::~CMICmnStreamStdinLinux( void )
+CMICmnStreamStdinLinux::~CMICmnStreamStdinLinux(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStdinLinux::Initialize( void )
-{
-	if( m_bInitialized )
-		return MIstatus::success;
-
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
- 
-	// Note initialisation order is important here as some resources depend on previous
-	MI::ModuleInit< CMICmnLog >      ( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
-	MI::ModuleInit< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-
-	// Other resources required
-	if( bOk )
-	{
-		m_pCmdBuffer = new MIchar[ m_constBufferSize ];
-		m_pStdin = stdin;
-	}
+// Details: Initialize resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdinLinux::Initialize(void)
+{
+    if (m_bInitialized)
+        return MIstatus::success;
+
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Note initialisation order is important here as some resources depend on previous
+    MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+    MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+
+    // Other resources required
+    if (bOk)
+    {
+        m_pCmdBuffer = new MIchar[m_constBufferSize];
+        m_pStdin = stdin;
+    }
 
-	// Clear error indicators for std input
-	::clearerr( stdin );
+    // Clear error indicators for std input
+    ::clearerr(stdin);
 
-	m_bInitialized = bOk;
+    m_bInitialized = bOk;
 
-	if( !bOk )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_OS_STDIN_HANDLER ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-		return MIstatus::failure;
-	}
+    if (!bOk)
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_OS_STDIN_HANDLER), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+        return MIstatus::failure;
+    }
 
-	return  MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStdinLinux::Shutdown( void )
-{
-	if( !m_bInitialized )
-		return MIstatus::success;
-
-	m_bInitialized = false;
-
-	ClrErrorDescription();
-
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-
-	// Tidy up
-	if( m_pCmdBuffer != nullptr )
-	{
-		delete [] m_pCmdBuffer;
-		m_pCmdBuffer = nullptr;
-	}
-	m_pStdin = nullptr;
-
-	// Note shutdown order is important here 	
-	MI::ModuleShutdown< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLog >      ( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
+// Details: Release resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdinLinux::Shutdown(void)
+{
+    if (!m_bInitialized)
+        return MIstatus::success;
+
+    m_bInitialized = false;
+
+    ClrErrorDescription();
+
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Tidy up
+    if (m_pCmdBuffer != nullptr)
+    {
+        delete[] m_pCmdBuffer;
+        m_pCmdBuffer = nullptr;
+    }
+    m_pStdin = nullptr;
 
-	if( !bOk )
-	{
-		SetErrorDescriptionn( MIRSRC( IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER ), errMsg.c_str() );
-	}
+    // Note shutdown order is important here
+    MI::ModuleShutdown<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+
+    if (!bOk)
+    {
+        SetErrorDescriptionn(MIRSRC(IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER), errMsg.c_str());
+    }
 
-	return MIstatus::success;
-}	
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if stdin has any characters present in its buffer.
-// Type:	Method.
-// Args:	vwbAvail	- (W) True = There is chars available, false = nothing there.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
-//--
-bool CMICmnStreamStdinLinux::InputAvailable( bool & vwbAvail )
-{
-/* AD: Not used ATM but could come in handy just in case we need to do
-       this, poll for input
-
-	static const int STDIN = 0;
-    static bool bInitialized = false;
-
-    if( !bInitialized )
-	{
-        // Use termios to turn off line buffering
-        ::termios term;
-        ::tcgetattr( STDIN, &term );
-        ::term.c_lflag &= ~ICANON;
-        ::tcsetattr( STDIN, TCSANOW, &term );
-        ::setbuf( stdin, NULL );
-        bInitialized = true;
-    }
-
-    int nBytesWaiting;
-    ::ioctl( STDIN, FIONREAD, &nBytesWaiting );
-    vwbAvail = (nBytesWaiting > 0);
+// Details: Determine if stdin has any characters present in its buffer.
+// Type:    Method.
+// Args:    vwbAvail    - (W) True = There is chars available, false = nothing there.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmnStreamStdinLinux::InputAvailable(bool &vwbAvail)
+{
+    /* AD: Not used ATM but could come in handy just in case we need to do
+           this, poll for input
+
+            static const int STDIN = 0;
+        static bool bInitialized = false;
+
+        if( !bInitialized )
+            {
+            // Use termios to turn off line buffering
+            ::termios term;
+            ::tcgetattr( STDIN, &term );
+            ::term.c_lflag &= ~ICANON;
+            ::tcsetattr( STDIN, TCSANOW, &term );
+            ::setbuf( stdin, NULL );
+            bInitialized = true;
+        }
+
+        int nBytesWaiting;
+        ::ioctl( STDIN, FIONREAD, &nBytesWaiting );
+        vwbAvail = (nBytesWaiting > 0);
 
-	return MIstatus::success;
-*/
+            return MIstatus::success;
+    */
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Wait on new line of data from stdin stream (completed by '\n' or '\r').
-// Type:	Method.
-// Args:	vwErrMsg	- (W) Empty string ok or error description.			
-// Return:	MIchar * - text buffer pointer or NULL on failure.
-// Throws:	None.
-//--
-const MIchar * CMICmnStreamStdinLinux::ReadLine( CMIUtilString & vwErrMsg )
-{
-	vwErrMsg.clear();
-	
-	// Read user input
-	const MIchar * pText = ::fgets( &m_pCmdBuffer[ 0 ], m_constBufferSize, stdin );
-	if( pText == nullptr )
-	{
-		if( ::ferror( m_pStdin ) != 0 )
-			vwErrMsg = ::strerror( errno );
-		return nullptr;
-	}
+// Details: Wait on new line of data from stdin stream (completed by '\n' or '\r').
+// Type:    Method.
+// Args:    vwErrMsg    - (W) Empty string ok or error description.
+// Return:  MIchar * - text buffer pointer or NULL on failure.
+// Throws:  None.
+//--
+const MIchar *
+CMICmnStreamStdinLinux::ReadLine(CMIUtilString &vwErrMsg)
+{
+    vwErrMsg.clear();
+
+    // Read user input
+    const MIchar *pText = ::fgets(&m_pCmdBuffer[0], m_constBufferSize, stdin);
+    if (pText == nullptr)
+    {
+        if (::ferror(m_pStdin) != 0)
+            vwErrMsg = ::strerror(errno);
+        return nullptr;
+    }
 
     // Strip off new line characters
-	for( MIchar * pI = m_pCmdBuffer; *pI != '\0'; pI++ )
-	{
-		if( (*pI == '\n') || (*pI == '\r') )
-		{
-			*pI = '\0';
-			break;
-		}
-	}
+    for (MIchar *pI = m_pCmdBuffer; *pI != '\0'; pI++)
+    {
+        if ((*pI == '\n') || (*pI == '\r'))
+        {
+            *pI = '\0';
+            break;
+        }
+    }
 
-	return pText;
+    return pText;
 }
-

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.h?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.h Mon Nov 17 12:06:21 2014
@@ -8,15 +8,15 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MIUtilStreamStdin.h
+// File:        MIUtilStreamStdin.h
 //
-// Overview:	CMICmnStreamStdinLinux interface.
+// Overview:    CMICmnStreamStdinLinux interface.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 #pragma once
@@ -27,49 +27,45 @@
 #include "MIUtilSingletonBase.h"
 
 //++ ============================================================================
-// Details:	MI common code class. Specific OS stdin handling implementation.
-//			CMICmnStreamStdin instance is set with stdin handler before using the
-//			the stream. An instance of this class must be set up and ready to give
-//			to the CMICmnStreamStdin before it initialises other CMICmnStreamStdin
-//			will give an error.
-// Gotchas:	None.
-// Authors:	Illya Rudkin 16/06/2014.
-// Changes:	None.
+// Details: MI common code class. Specific OS stdin handling implementation.
+//          CMICmnStreamStdin instance is set with stdin handler before using the
+//          the stream. An instance of this class must be set up and ready to give
+//          to the CMICmnStreamStdin before it initialises other CMICmnStreamStdin
+//          will give an error.
+// Gotchas: None.
+// Authors: Illya Rudkin 16/06/2014.
+// Changes: None.
 //--
-class CMICmnStreamStdinLinux
-:	public CMICmnBase
-,	public CMICmnStreamStdin::IOSStdinHandler
-,	public MI::ISingleton< CMICmnStreamStdinLinux >
+class CMICmnStreamStdinLinux : public CMICmnBase, public CMICmnStreamStdin::IOSStdinHandler, public MI::ISingleton<CMICmnStreamStdinLinux>
 {
-	// Give singleton access to private constructors
-	friend MI::ISingleton< CMICmnStreamStdinLinux >;
+    // Give singleton access to private constructors
+    friend MI::ISingleton<CMICmnStreamStdinLinux>;
 
-// Methods:
-public:
-	bool	Initialize( void );
-	bool	Shutdown( void );
-
-// Overridden:
-public:
-	// From CMICmnStreamStdin::IOSpecificReadStreamStdin
-	virtual bool			InputAvailable( bool & vwbAvail );
-	virtual const MIchar *	ReadLine( CMIUtilString & vwErrMsg );
-	
-// Methods:
-private:
-	/* ctor */	CMICmnStreamStdinLinux( void );
-	/* ctor */	CMICmnStreamStdinLinux( const CMICmnStreamStdin & );
-	void		operator=( const CMICmnStreamStdin & );
-
-// Overridden:
-private:
-	// From CMICmnBase
-	/* dtor */ virtual ~CMICmnStreamStdinLinux( void );
-
-// Attributes:
-private:
-	const MIuint	m_constBufferSize;
-	FILE *			m_pStdin;
-	MIchar *		m_pCmdBuffer;
+    // Methods:
+  public:
+    bool Initialize(void);
+    bool Shutdown(void);
+
+    // Overridden:
+  public:
+    // From CMICmnStreamStdin::IOSpecificReadStreamStdin
+    virtual bool InputAvailable(bool &vwbAvail);
+    virtual const MIchar *ReadLine(CMIUtilString &vwErrMsg);
+
+    // Methods:
+  private:
+    /* ctor */ CMICmnStreamStdinLinux(void);
+    /* ctor */ CMICmnStreamStdinLinux(const CMICmnStreamStdin &);
+    void operator=(const CMICmnStreamStdin &);
+
+    // Overridden:
+  private:
+    // From CMICmnBase
+    /* dtor */ virtual ~CMICmnStreamStdinLinux(void);
+
+    // Attributes:
+  private:
+    const MIuint m_constBufferSize;
+    FILE *m_pStdin;
+    MIchar *m_pCmdBuffer;
 };
-

Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdinWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdinWindows.cpp?rev=222150&r1=222149&r2=222150&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnStreamStdinWindows.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnStreamStdinWindows.cpp Mon Nov 17 12:06:21 2014
@@ -8,19 +8,19 @@
 //===----------------------------------------------------------------------===//
 
 //++
-// File:		MIUtilStreamStdin.cpp
+// File:        MIUtilStreamStdin.cpp
 //
-// Overview:	CMICmnStreamStdinWindows implementation.
+// Overview:    CMICmnStreamStdinWindows implementation.
 //
-// Environment:	Compilers:	Visual C++ 12.
-//							gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-//				Libraries:	See MIReadmetxt. 
+// Environment: Compilers:  Visual C++ 12.
+//                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+//              Libraries:  See MIReadmetxt.
 //
-// Copyright:	None.
+// Copyright:   None.
 //--
 
 // Third Party Headers:
-#if defined( _MSC_VER )
+#if defined(_MSC_VER)
 #include <stdio.h>
 #include <Windows.h>
 #include <io.h>
@@ -36,164 +36,168 @@
 #include "MIUtilSingletonHelper.h"
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdinWindows constructor.
-// Type:	Method.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStdinWindows constructor.
+// Type:    Method.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStdinWindows::CMICmnStreamStdinWindows( void )
-:	m_constBufferSize( 1024 )
-,	m_pStdin( nullptr )
-,	m_pCmdBuffer( nullptr )
-,	m_pStdinBuffer( nullptr )
-,	m_nBytesToBeRead( 0 )
-,	m_bRunningInConsoleWin( false )
+CMICmnStreamStdinWindows::CMICmnStreamStdinWindows(void)
+    : m_constBufferSize(1024)
+    , m_pStdin(nullptr)
+    , m_pCmdBuffer(nullptr)
+    , m_pStdinBuffer(nullptr)
+    , m_nBytesToBeRead(0)
+    , m_bRunningInConsoleWin(false)
 {
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	CMICmnStreamStdinWindows destructor.
-// Type:	Overridable.
-// Args:	None.
-// Return:	None.
-// Throws:	None.
+// Details: CMICmnStreamStdinWindows destructor.
+// Type:    Overridable.
+// Args:    None.
+// Return:  None.
+// Throws:  None.
 //--
-CMICmnStreamStdinWindows::~CMICmnStreamStdinWindows( void )
+CMICmnStreamStdinWindows::~CMICmnStreamStdinWindows(void)
 {
-	Shutdown();
+    Shutdown();
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Initialize resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Initialize resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdinWindows::Initialize( void )
+bool
+CMICmnStreamStdinWindows::Initialize(void)
 {
-	if( m_bInitialized )
-		return MIstatus::success;
+    if (m_bInitialized)
+        return MIstatus::success;
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
- 
-	// Note initialisation order is important here as some resources depend on previous
-	MI::ModuleInit< CMICmnLog >      ( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
-	MI::ModuleInit< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-
-	// Other resources required
-	if( bOk )
-	{
-		m_pCmdBuffer = new MIchar[ m_constBufferSize ];
-		m_pStdin = stdin;
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Note initialisation order is important here as some resources depend on previous
+    MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+    MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+
+    // Other resources required
+    if (bOk)
+    {
+        m_pCmdBuffer = new MIchar[m_constBufferSize];
+        m_pStdin = stdin;
 
 #if MICONFIG_CREATE_OWN_STDIN_BUFFER
-		// Give stdinput a user defined buffer
-		m_pStdinBuffer = new char[ 1024 ];
-		::setbuf( stdin, m_pStdinBuffer );
+        // Give stdinput a user defined buffer
+        m_pStdinBuffer = new char[1024];
+        ::setbuf(stdin, m_pStdinBuffer);
 #endif // MICONFIG_CREATE_OWN_STDIN_BUFFER
 
-		// Clear error indicators for std input
-		::clearerr( stdin );
+        // Clear error indicators for std input
+        ::clearerr(stdin);
 
-#if defined( _MSC_VER )
-		m_bRunningInConsoleWin = ::_isatty( ::fileno( stdin ) );
+#if defined(_MSC_VER)
+        m_bRunningInConsoleWin = ::_isatty(::fileno(stdin));
 #endif // #if defined( _MSC_VER )
-	}
+    }
 
-	m_bInitialized = bOk;
+    m_bInitialized = bOk;
 
-	if( !bOk )
-	{
-		CMIUtilString strInitError( CMIUtilString::Format( MIRSRC( IDS_MI_INIT_ERR_OS_STDIN_HANDLER ), errMsg.c_str() ) );
-		SetErrorDescription( strInitError );
-		return MIstatus::failure;
-	}
+    if (!bOk)
+    {
+        CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_OS_STDIN_HANDLER), errMsg.c_str()));
+        SetErrorDescription(strInitError);
+        return MIstatus::failure;
+    }
 
-	return  MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Release resources for *this Stdin stream.
-// Type:	Method.
-// Args:	None.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Release resources for *this Stdin stream.
+// Type:    Method.
+// Args:    None.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdinWindows::Shutdown( void )
+bool
+CMICmnStreamStdinWindows::Shutdown(void)
 {
-	if( !m_bInitialized )
-		return MIstatus::success;
+    if (!m_bInitialized)
+        return MIstatus::success;
 
-	m_bInitialized = false;
+    m_bInitialized = false;
 
-	ClrErrorDescription();
+    ClrErrorDescription();
 
-	bool bOk = MIstatus::success;
-	CMIUtilString errMsg;
-
-	// Tidy up
-	if( m_pCmdBuffer != nullptr )
-	{
-		delete [] m_pCmdBuffer;
-		m_pCmdBuffer = nullptr;
-	}
-	m_pStdin = nullptr;
+    bool bOk = MIstatus::success;
+    CMIUtilString errMsg;
+
+    // Tidy up
+    if (m_pCmdBuffer != nullptr)
+    {
+        delete[] m_pCmdBuffer;
+        m_pCmdBuffer = nullptr;
+    }
+    m_pStdin = nullptr;
 
 #if MICONFIG_CREATE_OWN_STDIN_BUFFER
-	if ( m_pStdinBuffer )
-		delete [] m_pStdinBuffer;
-	m_pStdinBuffer = nullptr;
+    if (m_pStdinBuffer)
+        delete[] m_pStdinBuffer;
+    m_pStdinBuffer = nullptr;
 #endif // MICONFIG_CREATE_OWN_STDIN_BUFFER
 
-	// Note shutdown order is important here 	
-	MI::ModuleShutdown< CMICmnResources >( IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg );
-	MI::ModuleShutdown< CMICmnLog >      ( IDS_MI_INIT_ERR_LOG      , bOk, errMsg );
-
-	if( !bOk )
-	{
-		SetErrorDescriptionn( MIRSRC( IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER ), errMsg.c_str() );
-	}
+    // Note shutdown order is important here
+    MI::ModuleShutdown<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg);
+    MI::ModuleShutdown<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg);
+
+    if (!bOk)
+    {
+        SetErrorDescriptionn(MIRSRC(IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER), errMsg.c_str());
+    }
 
-	return MIstatus::success;
-}	
+    return MIstatus::success;
+}
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if stdin has any characters present in its buffer.
-// Type:	Method.
-// Args:	vwbAvail	- (W) True = There is chars available, false = nothing there.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Determine if stdin has any characters present in its buffer.
+// Type:    Method.
+// Args:    vwbAvail    - (W) True = There is chars available, false = nothing there.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdinWindows::InputAvailable( bool & vwbAvail )
+bool
+CMICmnStreamStdinWindows::InputAvailable(bool &vwbAvail)
 {
-	return m_bRunningInConsoleWin ? InputAvailableConsoleWin( vwbAvail ) : InputAvailableApplication( vwbAvail );
+    return m_bRunningInConsoleWin ? InputAvailableConsoleWin(vwbAvail) : InputAvailableApplication(vwbAvail);
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if stdin has any characters present in its buffer. If running in a 
-//			terminal use _kbhit().
-// Type:	Method.
-// Args:	vwbAvail	- (W) True = There is chars available, false = nothing there.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Determine if stdin has any characters present in its buffer. If running in a
+//          terminal use _kbhit().
+// Type:    Method.
+// Args:    vwbAvail    - (W) True = There is chars available, false = nothing there.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdinWindows::InputAvailableConsoleWin( bool & vwbAvail )
+bool
+CMICmnStreamStdinWindows::InputAvailableConsoleWin(bool &vwbAvail)
 {
-#if defined( _MSC_VER )
-  if( m_nBytesToBeRead == 0 )
-   {
+#if defined(_MSC_VER)
+    if (m_nBytesToBeRead == 0)
+    {
         // Get a windows handle to std input stream
-        HANDLE handle = ::GetStdHandle( STD_INPUT_HANDLE );
+        HANDLE handle = ::GetStdHandle(STD_INPUT_HANDLE);
         DWORD nBytesWaiting = ::_kbhit();
-        
-		// Save the number of bytes to be read so that we can check if input is available to be read
+
+        // Save the number of bytes to be read so that we can check if input is available to be read
         m_nBytesToBeRead = nBytesWaiting;
 
         // Return state of whether bytes are waiting or not
@@ -201,36 +205,37 @@ bool CMICmnStreamStdinWindows::InputAvai
     }
 #endif // #if defined( _MSC_VER )
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Determine if stdin has any characters present in its buffer.
-// Type:	Method.
-// Args:	vwbAvail	- (W) True = There is chars available, false = nothing there.
-// Return:	MIstatus::success - Functional succeeded.
-//			MIstatus::failure - Functional failed.
-// Throws:	None.
+// Details: Determine if stdin has any characters present in its buffer.
+// Type:    Method.
+// Args:    vwbAvail    - (W) True = There is chars available, false = nothing there.
+// Return:  MIstatus::success - Functional succeeded.
+//          MIstatus::failure - Functional failed.
+// Throws:  None.
 //--
-bool CMICmnStreamStdinWindows::InputAvailableApplication( bool & vwbAvail )
+bool
+CMICmnStreamStdinWindows::InputAvailableApplication(bool &vwbAvail)
 {
- #if defined( _MSC_VER )
-  if( m_nBytesToBeRead == 0 )
-   {
+#if defined(_MSC_VER)
+    if (m_nBytesToBeRead == 0)
+    {
         // Get a windows handle to std input stream
-        HANDLE handle = ::GetStdHandle( STD_INPUT_HANDLE );
+        HANDLE handle = ::GetStdHandle(STD_INPUT_HANDLE);
         DWORD nBytesWaiting = 0;
 
         // Ask how many bytes are available
-        if( ::PeekNamedPipe( handle, nullptr, 0, nullptr, &nBytesWaiting, nullptr ) == FALSE )
+        if (::PeekNamedPipe(handle, nullptr, 0, nullptr, &nBytesWaiting, nullptr) == FALSE)
         {
             // This can occur when the client i.e. Eclipse closes the stdin stream 'cause it deems its work is finished
             // for that debug session. May be we should be handling SIGKILL somehow?
-            const CMIUtilString osErrMsg( CMIUtilSystemWindows().GetOSLastError().StripCRAll() );
-            SetErrorDescription( CMIUtilString::Format( MIRSRC( IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE ), osErrMsg.c_str() ) );
+            const CMIUtilString osErrMsg(CMIUtilSystemWindows().GetOSLastError().StripCRAll());
+            SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE), osErrMsg.c_str()));
             return MIstatus::failure;
         }
- 
+
         // Save the number of bytes to be read so that we can check if input is available to be read
         m_nBytesToBeRead = nBytesWaiting;
 
@@ -239,41 +244,42 @@ bool CMICmnStreamStdinWindows::InputAvai
     }
 #endif // #if defined( _MSC_VER )
 
-	return MIstatus::success;
+    return MIstatus::success;
 }
 
 //++ ------------------------------------------------------------------------------------
-// Details:	Wait on new line of data from stdin stream (completed by '\n' or '\r').
-// Type:	Method.
-// Args:	vwErrMsg	- (W) Empty string ok or error description.			
-// Return:	MIchar * - text buffer pointer or NULL on failure.
-// Throws:	None.
+// Details: Wait on new line of data from stdin stream (completed by '\n' or '\r').
+// Type:    Method.
+// Args:    vwErrMsg    - (W) Empty string ok or error description.
+// Return:  MIchar * - text buffer pointer or NULL on failure.
+// Throws:  None.
 //--
-const MIchar * CMICmnStreamStdinWindows::ReadLine( CMIUtilString & vwErrMsg )
+const MIchar *
+CMICmnStreamStdinWindows::ReadLine(CMIUtilString &vwErrMsg)
 {
-	vwErrMsg.clear();
-	
-	// Read user input
-	const MIchar * pText = ::fgets( &m_pCmdBuffer[ 0 ], m_constBufferSize, stdin );
-	if( pText == nullptr )
-	{
-		if( ::ferror( m_pStdin ) != 0 )
-			vwErrMsg = ::strerror( errno );
-		return nullptr;
-	}
+    vwErrMsg.clear();
+
+    // Read user input
+    const MIchar *pText = ::fgets(&m_pCmdBuffer[0], m_constBufferSize, stdin);
+    if (pText == nullptr)
+    {
+        if (::ferror(m_pStdin) != 0)
+            vwErrMsg = ::strerror(errno);
+        return nullptr;
+    }
 
     // Subtract the number of bytes read so that we can check if input is available to be read
-    m_nBytesToBeRead = m_nBytesToBeRead - ::strlen( pText );
-	
-	// Strip off new line characters
-	for( MIchar * pI = m_pCmdBuffer; *pI != '\0'; pI++ )
-	{
-		if( (*pI == '\n') || (*pI == '\r') )
-		{
-			*pI = '\0';
-			break;
-		}
-	}
+    m_nBytesToBeRead = m_nBytesToBeRead - ::strlen(pText);
+
+    // Strip off new line characters
+    for (MIchar *pI = m_pCmdBuffer; *pI != '\0'; pI++)
+    {
+        if ((*pI == '\n') || (*pI == '\r'))
+        {
+            *pI = '\0';
+            break;
+        }
+    }
 
-	return pText;
-}
\ No newline at end of file
+    return pText;
+}





More information about the lldb-commits mailing list