[Lldb-commits] [lldb] r143403 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Interpreter/Options.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Symbol/ClangASTContext.cpp tools/darwin-debug/darwin-debug.cpp tools/lldb-platform/lldb-platform.cpp

Johnny Chen johnny.chen at apple.com
Mon Oct 31 17:18:04 PDT 2011


Hi Greg,

TestNamespace.py failed as a result of the check-in?

runCmd: frame variable
output: (int) a = 12
(<anonymous namespace>::my_uint_t) anon_uint = 0
(A::uint_t) a_uint = 1
(A::B::uint_t) b_uint = 2
(Y::uint_t) y_uint = 3


Expecting sub string: (int) a = 12
Matched

Expecting sub string: (my_uint_t) anon_uint = 0
Not matched

FAIL

On Oct 31, 2011, at 4:51 PM, Greg Clayton wrote:

> Author: gclayton
> Date: Mon Oct 31 18:51:19 2011
> New Revision: 143403
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=143403&view=rev
> Log:
> Fixed some warnings after enabling some stricter warnings in the Xcode project
> settings.
> 
> Also fixed an issue where we weren't creating anonymous namepaces correctly:
> <rdar://problem/10371295>
> 
> 
> 
> Modified:
>    lldb/trunk/lldb.xcodeproj/project.pbxproj
>    lldb/trunk/source/Interpreter/Options.cpp
>    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
>    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>    lldb/trunk/source/Symbol/ClangASTContext.cpp
>    lldb/trunk/tools/darwin-debug/darwin-debug.cpp
>    lldb/trunk/tools/lldb-platform/lldb-platform.cpp
> 
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Oct 31 18:51:19 2011
> @@ -3592,7 +3592,7 @@
> 					LLDB_CONFIGURATION_DEBUG,
> 				);
> 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
> -				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
> +				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
> 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
> 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
> 				GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
> @@ -3600,6 +3600,8 @@
> 				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
> 				GCC_WARN_MISSING_PARENTHESES = YES;
> 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
> +				GCC_WARN_UNINITIALIZED_AUTOS = YES;
> +				GCC_WARN_UNUSED_LABEL = YES;
> 				GCC_WARN_UNUSED_VALUE = YES;
> 				GCC_WARN_UNUSED_VARIABLE = YES;
> 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm";
> @@ -3628,7 +3630,7 @@
> 					LLDB_CONFIGURATION_RELEASE,
> 				);
> 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
> -				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
> +				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
> 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
> 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
> 				GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
> @@ -3636,6 +3638,8 @@
> 				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
> 				GCC_WARN_MISSING_PARENTHESES = YES;
> 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
> +				GCC_WARN_UNINITIALIZED_AUTOS = YES;
> +				GCC_WARN_UNUSED_LABEL = YES;
> 				GCC_WARN_UNUSED_VALUE = YES;
> 				GCC_WARN_UNUSED_VARIABLE = YES;
> 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm";
> @@ -3913,7 +3917,7 @@
> 					LLDB_CONFIGURATION_BUILD_AND_INTEGRATION,
> 				);
> 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
> -				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
> +				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
> 				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
> 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
> 				GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
> @@ -3921,6 +3925,8 @@
> 				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
> 				GCC_WARN_MISSING_PARENTHESES = YES;
> 				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
> +				GCC_WARN_UNINITIALIZED_AUTOS = YES;
> +				GCC_WARN_UNUSED_LABEL = YES;
> 				GCC_WARN_UNUSED_VALUE = YES;
> 				GCC_WARN_UNUSED_VARIABLE = YES;
> 				LLVM_BUILD_DIR = "$(OBJROOT)/llvm";
> 
> Modified: lldb/trunk/source/Interpreter/Options.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/source/Interpreter/Options.cpp (original)
> +++ lldb/trunk/source/Interpreter/Options.cpp Mon Oct 31 18:51:19 2011
> @@ -375,11 +375,9 @@
>         const OptionDefinition *opt_defs = GetDefinitions ();
>         if (opt_defs)
>         {
> -            const char *long_option_name;
> +            const char *long_option_name = long_option;
>             if (long_option[0] == '-' && long_option[1] == '-')
>                 long_option_name += 2;
> -            else
> -                long_option_name = long_option;
> 
>             for (uint32_t i = 0; opt_defs[i].long_option; ++i)
>             {
> 
> Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
> +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Oct 31 18:51:19 2011
> @@ -13185,11 +13185,11 @@
>     {
>     default:
>         return false;
> -    eModeARM:
> +    case eModeARM:
>         // Clear the T bit.
>         m_new_inst_cpsr &= ~MASK_CPSR_T;
>         break;
> -    eModeThumb:
> +    case eModeThumb:
>         // Set the T bit.
>         m_new_inst_cpsr |= MASK_CPSR_T;
>         break;
> 
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Oct 31 18:51:19 2011
> @@ -1012,7 +1012,17 @@
>             std::auto_ptr<LineTable> line_table_ap(new LineTable(sc.comp_unit));
>             if (line_table_ap.get())
>             {
> -                ParseDWARFLineTableCallbackInfo info = { line_table_ap.get(), m_obj_file->GetSectionList(), 0, 0, m_debug_map_symfile != NULL, false};
> +                ParseDWARFLineTableCallbackInfo info = { 
> +                    line_table_ap.get(), 
> +                    m_obj_file->GetSectionList(), 
> +                    0, 
> +                    0, 
> +                    m_debug_map_symfile != NULL, 
> +                    false, 
> +                    DWARFDebugLine::Row(), 
> +                    SectionSP(), 
> +                    SectionSP()
> +                };
>                 uint32_t offset = cu_line_offset;
>                 DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);
>                 sc.comp_unit->SetLineTable(line_table_ap.release());
> @@ -3516,14 +3526,14 @@
>         else
>         {
>             const char *namespace_name = die->GetAttributeValueAsString(this, curr_cu, DW_AT_name, NULL);
> -            if (namespace_name)
> +            clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL);            
> +            namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx);
> +            LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
> +            if (log)
>             {
> -                clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL);            
> -                namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx);
> -                LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
> -                if (log)
> +                const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString();
> +                if (namespace_name)
>                 {
> -                    const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString();
>                     log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", 
>                                  GetClangASTContext().getASTContext(),
>                                  MakeUserID(die->GetOffset()),
> @@ -3536,11 +3546,24 @@
>                                  object_name ? "(" : "",
>                                  namespace_decl->getOriginalNamespace());
>                 }
> -
> -                if (namespace_decl)
> -                    LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die);
> -                return namespace_decl;
> +                else
> +                {
> +                    log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace (anonymous) => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", 
> +                                 GetClangASTContext().getASTContext(),
> +                                 MakeUserID(die->GetOffset()),
> +                                 namespace_decl,
> +                                 m_obj_file->GetFileSpec().GetDirectory().GetCString(),
> +                                 m_obj_file->GetFileSpec().GetFilename().GetCString(),
> +                                 object_name ? "(" : "",
> +                                 object_name ? object_name : "",
> +                                 object_name ? "(" : "",
> +                                 namespace_decl->getOriginalNamespace());
> +                }
>             }
> +
> +            if (namespace_decl)
> +                LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die);
> +            return namespace_decl;
>         }
>     }
>     return NULL;
> 
> Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
> +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Oct 31 18:51:19 2011
> @@ -4299,12 +4299,13 @@
> ClangASTContext::GetUniqueNamespaceDeclaration (const char *name, DeclContext *decl_ctx)
> {
>     NamespaceDecl *namespace_decl = NULL;
> +    ASTContext *ast = getASTContext();
> +    TranslationUnitDecl *translation_unit_decl = ast->getTranslationUnitDecl ();
> +    if (decl_ctx == NULL)
> +        decl_ctx = translation_unit_decl;
> +    
>     if (name)
>     {
> -        ASTContext *ast = getASTContext();
> -        if (decl_ctx == NULL)
> -            decl_ctx = ast->getTranslationUnitDecl();
> -        
>         IdentifierInfo &identifier_info = ast->Idents.get(name);
>         DeclarationName decl_name (&identifier_info);
>         clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
> @@ -4317,12 +4318,61 @@
> 
>         namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), &identifier_info);
> 
> -        decl_ctx->addDecl (namespace_decl);
> +        decl_ctx->addDecl (namespace_decl);        
> +    }
> +    else
> +    {
> +        if (decl_ctx == translation_unit_decl)
> +        {
> +            namespace_decl = translation_unit_decl->getAnonymousNamespace();
> +            if (namespace_decl)
> +                return namespace_decl;
> +            
> +            namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL);
> +            translation_unit_decl->setAnonymousNamespace (namespace_decl);
> +            translation_unit_decl->addDecl (namespace_decl);
> +            assert (namespace_decl == translation_unit_decl->getAnonymousNamespace());
> +        }
> +        else
> +        {
> +            NamespaceDecl *parent_namespace_decl = cast<NamespaceDecl>(decl_ctx);
> +            if (parent_namespace_decl)
> +            {
> +                namespace_decl = parent_namespace_decl->getAnonymousNamespace();
> +                if (namespace_decl)
> +                    return namespace_decl;
> +                namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL);
> +                parent_namespace_decl->setAnonymousNamespace (namespace_decl);
> +                parent_namespace_decl->addDecl (namespace_decl);
> +                assert (namespace_decl == parent_namespace_decl->getAnonymousNamespace());
> +            }
> +            else
> +            {
> +                // BAD!!!
> +            }
> +        }
> 
> +
> +        if (namespace_decl)
> +        {
> +            // If we make it here, we are creating the anonymous namespace decl
> +            // for the first time, so we need to do the using directive magic
> +            // like SEMA does
> +            UsingDirectiveDecl* using_directive_decl = UsingDirectiveDecl::Create (*ast, 
> +                                                                                   decl_ctx, 
> +                                                                                   SourceLocation(),
> +                                                                                   SourceLocation(),
> +                                                                                   NestedNameSpecifierLoc(),
> +                                                                                   SourceLocation(),
> +                                                                                   namespace_decl,
> +                                                                                   decl_ctx);
> +            using_directive_decl->setImplicit();
> +            decl_ctx->addDecl(using_directive_decl);
> +        }
> +    }
> #ifdef LLDB_CONFIGURATION_DEBUG
> -        VerifyDecl(namespace_decl);
> +    VerifyDecl(namespace_decl);
> #endif
> -    }
>     return namespace_decl;
> }
> 
> 
> Modified: lldb/trunk/tools/darwin-debug/darwin-debug.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-debug/darwin-debug.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/tools/darwin-debug/darwin-debug.cpp (original)
> +++ lldb/trunk/tools/darwin-debug/darwin-debug.cpp Mon Oct 31 18:51:19 2011
> @@ -178,7 +178,7 @@
> 
>     cpu_type_t cpu_type = 0;
>     bool show_usage = false;
> -    char ch;
> +    int ch;
>     int disable_aslr = 0; // By default we disable ASLR
>     int pass_env = 1;
>     std::string unix_socket_name;
> 
> Modified: lldb/trunk/tools/lldb-platform/lldb-platform.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/lldb-platform.cpp?rev=143403&r1=143402&r2=143403&view=diff
> ==============================================================================
> --- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original)
> +++ lldb/trunk/tools/lldb-platform/lldb-platform.cpp Mon Oct 31 18:51:19 2011
> @@ -73,7 +73,7 @@
>     Args log_args;
>     Error error;
>     std::string listen_host_port;
> -    char ch;
> +    int ch;
>     Debugger::Initialize();
> 
> //    ConnectionMachPort a;
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list