예제 #1
0
bool SBTypeCategory::AddTypeFormat(SBTypeNameSpecifier type_name,
                                   SBTypeFormat format) {
  LLDB_RECORD_METHOD(bool, SBTypeCategory, AddTypeFormat,
                     (lldb::SBTypeNameSpecifier, lldb::SBTypeFormat), type_name,
                     format);

  if (!IsValid())
    return false;

  if (!type_name.IsValid())
    return false;

  if (!format.IsValid())
    return false;

  if (type_name.IsRegex())
    m_opaque_sp->GetRegexTypeFormatsContainer()->Add(
        lldb::RegularExpressionSP(new RegularExpression(
            llvm::StringRef::withNullAsEmpty(type_name.GetName()))),
        format.GetSP());
  else
    m_opaque_sp->GetTypeFormatsContainer()->Add(
        ConstString(type_name.GetName()), format.GetSP());

  return true;
}
예제 #2
0
bool
SBTypeCategory::AddTypeFormat (SBTypeNameSpecifier type_name,
                               SBTypeFormat format)
{
    if (!IsValid())
        return false;
    
    if (!type_name.IsValid())
        return false;
    
    if (!format.IsValid())
        return false;
    
    if (type_name.IsRegex())
        m_opaque_sp->GetRegexValueNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), format.GetSP());
    else
        m_opaque_sp->GetValueNavigator()->Add(ConstString(type_name.GetName()), format.GetSP());
    
    return true;
}