bool
OptionGroupFormat::ParserGDBFormatLetter (CommandInterpreter &interpreter, char format_letter, Format &format, uint32_t &byte_size)
{
    m_has_gdb_format = true;
    switch (format_letter)
    {
        case 'o': format = eFormatOctal;        m_prev_gdb_format = format_letter; return true; 
        case 'x': format = eFormatHex;          m_prev_gdb_format = format_letter; return true;
        case 'd': format = eFormatDecimal;      m_prev_gdb_format = format_letter; return true;
        case 'u': format = eFormatUnsigned;     m_prev_gdb_format = format_letter; return true;
        case 't': format = eFormatBinary;       m_prev_gdb_format = format_letter; return true;
        case 'f': format = eFormatFloat;        m_prev_gdb_format = format_letter; return true;
        case 'a': format = eFormatAddressInfo;
        {
            ExecutionContext exe_ctx(interpreter.GetExecutionContext());
            Target *target = exe_ctx.GetTargetPtr();
            if (target)
                byte_size = target->GetArchitecture().GetAddressByteSize();
            m_prev_gdb_format = format_letter;
            return true;
        }
        case 'i': format = eFormatInstruction;  m_prev_gdb_format = format_letter; return true;
        case 'c': format = eFormatChar;         m_prev_gdb_format = format_letter; return true;
        case 's': format = eFormatCString;      m_prev_gdb_format = format_letter; return true;
        case 'T': format = eFormatOSType;       m_prev_gdb_format = format_letter; return true;
        case 'A': format = eFormatHexFloat;     m_prev_gdb_format = format_letter; return true;
        case 'b': byte_size = 1;                m_prev_gdb_size = format_letter;   return true;
        case 'h': byte_size = 2;                m_prev_gdb_size = format_letter;   return true;
        case 'w': byte_size = 4;                m_prev_gdb_size = format_letter;   return true;
        case 'g': byte_size = 8;                m_prev_gdb_size = format_letter;   return true;
        default:  break;
    }
    return false;
}
void
OptionGroupValueObjectDisplay::OptionParsingStarting (CommandInterpreter &interpreter)
{
    // If these defaults change, be sure to modify AnyOptionWasSet().
    show_types        = false;
    no_summary_depth  = 0;
    show_location     = false;
    flat_output       = false;
    use_objc          = false;
    max_depth         = UINT32_MAX;
    ptr_depth         = 0;
    use_synth         = true;
    be_raw            = false;
    ignore_cap        = false;
    run_validator     = false;
    
    Target *target = interpreter.GetExecutionContext().GetTargetPtr();
    if (target != nullptr)
        use_dynamic = target->GetPreferDynamicValue();
    else
    {
        // If we don't have any targets, then dynamic values won't do us much good.
        use_dynamic = lldb::eNoDynamicValues;
    }
}
int
CommandCompletions::VariablePath (CommandInterpreter &interpreter,
                                  const char *partial_name,
                                  int match_start_point,
                                  int max_return_elements,
                                  SearchFilter *searcher,
                                  bool &word_complete,
                                  lldb_private::StringList &matches)
{
    return Variable::AutoComplete (interpreter.GetExecutionContext(), partial_name, matches, word_complete);
}
Esempio n. 4
0
size_t
OptionValueUUID::AutoComplete (CommandInterpreter &interpreter,
                               const char *s,
                               int match_start_point,
                               int max_return_elements,
                               bool &word_complete,
                               StringList &matches)
{
    word_complete = false;
    matches.Clear();
    ExecutionContext exe_ctx(interpreter.GetExecutionContext());
    Target *target = exe_ctx.GetTargetPtr();
    if (target)
    {
        const size_t num_modules = target->GetImages().GetSize();
        if (num_modules > 0)
        {
            UUID::ValueType uuid_bytes;
            const size_t num_bytes_decoded = UUID::DecodeUUIDBytesFromCString(s, uuid_bytes, NULL);
            for (size_t i=0; i<num_modules; ++i)
            {
                ModuleSP module_sp (target->GetImages().GetModuleAtIndex(i));
                if (module_sp)
                {
                    const UUID &module_uuid = module_sp->GetUUID();
                    if (module_uuid.IsValid())
                    {
                        bool add_uuid = false;
                        if (num_bytes_decoded == 0)
                            add_uuid = true;
                        else
                            add_uuid = ::memcmp(module_uuid.GetBytes(), uuid_bytes, num_bytes_decoded) == 0;
                        if (add_uuid)
                        {
                            std::string uuid_str;
                            uuid_str = module_uuid.GetAsString();
                            if (!uuid_str.empty())
                                matches.AppendString(uuid_str.c_str());
                        }
                    }
                }
            }
        }
    }
    return matches.GetSize();
}
int CommandCompletions::VariablePath(CommandInterpreter &interpreter,
                                     CompletionRequest &request,
                                     SearchFilter *searcher) {
  return Variable::AutoComplete(interpreter.GetExecutionContext(), request);
}