Beispiel #1
0
void
CommandInterpreter::ShowVariableValues (CommandReturnObject &result)
{
    result.AppendMessage ("Below is a list of all the debugger setting variables and their values:");

    for (VariableMap::const_iterator pos = m_variables.begin(); pos != m_variables.end(); ++pos)
    {
        StateVariable *var = pos->second.get();
        var->AppendVariableInformation (result);
    }
}
Beispiel #2
0
bool
CommandObjectShow::Execute
(
    CommandInterpreter &interpreter,
    Args& command,
    CommandReturnObject &result
)
{
    CommandInterpreter::VariableMap::iterator pos;

    if (command.GetArgumentCount())
    {
        // The user requested to see the value of a particular variable.

        const char *var_name = command.GetArgumentAtIndex(0);
        StateVariable *var = interpreter.GetStateVariable(var_name);
        if (var)
        {
            var->AppendVariableInformation (result);
            result.SetStatus (eReturnStatusSuccessFinishNoResult);
        }
        else
        {
            result.AppendErrorWithFormat ("Unrecognized variable '%s'; cannot do 'show' command.\n", var_name);
            result.SetStatus (eReturnStatusFailed);
        }
    }
    else
    {
        // The user didn't specify a particular variable, so show the values of all of them.
        interpreter.ShowVariableValues(result);
        result.SetStatus (eReturnStatusSuccessFinishNoResult);
    }

    return result.Succeeded();
}