From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:50:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DEF29F8; Mon, 17 Feb 2014 18:50:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 363F413D5; Mon, 17 Feb 2014 18:50:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIo6Ib095829; Mon, 17 Feb 2014 18:50:06 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIo4vf095817; Mon, 17 Feb 2014 18:50:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402171850.s1HIo4vf095817@svn.freebsd.org> From: Ed Maste Date: Mon, 17 Feb 2014 18:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262121 - in head: contrib/llvm/tools/lldb/include/lldb/Expression contrib/llvm/tools/lldb/source/Core contrib/llvm/tools/lldb/source/Expression contrib/llvm/tools/lldb/source/Host/comm... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:50:06 -0000 Author: emaste Date: Mon Feb 17 18:50:03 2014 New Revision: 262121 URL: http://svnweb.freebsd.org/changeset/base/262121 Log: Update lldb for clang/llvm 3.4 import This commit largely restores the lldb source to the upstream r196259 snapshot with the addition of threaded inferior support and a few bug fixes. Specific upstream lldb revisions restored include: SVN git 181387 779e6ac 181703 7bef4e2 182099 b31044e 182650 f2dcf35 182683 0d91b80 183862 15c1774 183929 99447a6 184177 0b2934b 184948 4dc3761 184954 007e7bc 186990 eebd175 Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp head/usr.bin/clang/lldb/Makefile Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Mon Feb 17 18:50:03 2014 (r262121) @@ -18,7 +18,6 @@ #include // Other libraries and framework includes -#include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" // Project includes @@ -288,7 +287,8 @@ private: /// Allocated space. //------------------------------------------------------------------ virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID); + unsigned SectionID, + llvm::StringRef SectionName); //------------------------------------------------------------------ /// Allocate space for data, and add it to the m_spaceBlocks map @@ -309,7 +309,9 @@ private: /// Allocated space. //------------------------------------------------------------------ virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID, bool IsReadOnly); + unsigned SectionID, + llvm::StringRef SectionName, + bool IsReadOnly); //------------------------------------------------------------------ /// Allocate space for a global variable, and add it to the @@ -337,7 +339,13 @@ private: /// @return /// True in case of failure, false in case of success. //------------------------------------------------------------------ - bool applyPermissions(std::string *ErrMsg) { return false; } + virtual bool finalizeMemory(std::string *ErrMsg) { + // TODO: Ensure that the instruction cache is flushed because + // relocations are updated by dy-load. See: + // sys::Memory::InvalidateInstructionCache + // llvm::SectionMemoryManager + return false; + } //------------------------------------------------------------------ /// Passthrough interface stub @@ -347,38 +355,6 @@ private: //------------------------------------------------------------------ /// Passthrough interface stub //------------------------------------------------------------------ - virtual uint8_t* startExceptionTable(const llvm::Function* F, - uintptr_t &ActualSize); - - //------------------------------------------------------------------ - /// Complete the exception table for a function, and add it to the - /// m_exception_tables map - /// - /// @param[in] F - /// The function whose exception table is being written. - /// - /// @param[in] TableStart - /// The first byte of the exception table. - /// - /// @param[in] TableEnd - /// The last byte of the exception table. - /// - /// @param[in] FrameRegister - /// I don't know what this does, but it's passed through. - //------------------------------------------------------------------ - virtual void endExceptionTable(const llvm::Function *F, - uint8_t *TableStart, - uint8_t *TableEnd, - uint8_t* FrameRegister); - - //------------------------------------------------------------------ - /// Passthrough interface stub - //------------------------------------------------------------------ - virtual void deallocateExceptionTable(void *ET); - - //------------------------------------------------------------------ - /// Passthrough interface stub - //------------------------------------------------------------------ virtual size_t GetDefaultCodeSlabSize() { return m_default_mm_ap->GetDefaultCodeSlabSize(); } @@ -416,7 +392,7 @@ private: } virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) { - return m_default_mm_ap->registerEHFrames(llvm::StringRef((const char *)Addr, Size)); + return m_default_mm_ap->registerEHFrames(Addr, LoadAddr, Size); } //------------------------------------------------------------------ Modified: head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -158,60 +158,60 @@ ArchSpec::AutoComplete (const char *name #define SUBTYPE_MASK 0x00FFFFFFu static const ArchDefinitionEntry g_macho_arch_entries[] = { - { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv6m , llvm::MachO::CPUTypeARM , 14 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_xscale , llvm::MachO::CPUTypeARM , 8 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumb , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv6m , llvm::MachO::CPUTypeARM , 14 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPUTypePowerPC , 1 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPUTypePowerPC , 2 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPUTypePowerPC , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPUTypePowerPC , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPUTypePowerPC , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPUTypePowerPC , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPUTypePowerPC , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPUTypePowerPC , 8 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPUTypePowerPC , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPUTypePowerPC , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPUTypePowerPC , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPUTypePowerPC , 100 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPUTypePowerPC64 , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPUTypePowerPC64 , 100 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPUTypeI386 , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPUTypeI386 , 0x84 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv6m , llvm::MachO::CPU_TYPE_ARM , 14 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_xscale , llvm::MachO::CPU_TYPE_ARM , 8 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumb , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv6m , llvm::MachO::CPU_TYPE_ARM , 14 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPU_TYPE_POWERPC , 1 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPU_TYPE_POWERPC , 2 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPU_TYPE_POWERPC , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPU_TYPE_POWERPC , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPU_TYPE_POWERPC , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPU_TYPE_POWERPC , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPU_TYPE_POWERPC , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPU_TYPE_POWERPC , 8 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPU_TYPE_POWERPC , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPU_TYPE_POWERPC , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPU_TYPE_POWERPC , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPU_TYPE_POWERPC , 100 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPU_TYPE_POWERPC64 , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPU_TYPE_POWERPC64 , 100 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPU_TYPE_I386 , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPU_TYPE_I386 , 0x84 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX }, // Catch any unknown mach architectures so we can always use the object and symbol mach-o files - { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u }, - { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPUArchABI64 , 0 , 0xFF000000u, 0x00000000u } + { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u }, + { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPU_ARCH_ABI64 , 0 , 0xFF000000u, 0x00000000u } }; static const ArchDefinition g_macho_arch_def = { eArchTypeMachO, Modified: head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -52,7 +52,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/PathV1.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/TargetSelect.h" #if defined (USE_STANDARD_JIT) @@ -77,19 +77,16 @@ using namespace lldb_private; //===----------------------------------------------------------------------===// std::string GetBuiltinIncludePath(const char *Argv0) { - llvm::sys::Path P = - llvm::sys::Path::GetMainExecutable(Argv0, - (void*)(intptr_t) GetBuiltinIncludePath); - - if (!P.isEmpty()) { - P.eraseComponent(); // Remove /clang from foo/bin/clang - P.eraseComponent(); // Remove /bin from foo/bin - + SmallString<128> P(llvm::sys::fs::getMainExecutable( + Argv0, (void *)(intptr_t) GetBuiltinIncludePath)); + + if (!P.empty()) { + llvm::sys::path::remove_filename(P); // Remove /clang from foo/bin/clang + llvm::sys::path::remove_filename(P); // Remove /bin from foo/bin + // Get foo/lib/clang//include - P.appendComponent("lib"); - P.appendComponent("clang"); - P.appendComponent(CLANG_VERSION_STRING); - P.appendComponent("include"); + llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING, + "include"); } return P.str(); Modified: head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -490,11 +490,12 @@ IRExecutionUnit::MemoryManager::allocate uint8_t * IRExecutionUnit::MemoryManager::allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID) + unsigned SectionID, + llvm::StringRef SectionName) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - uint8_t *return_value = m_default_mm_ap->allocateCodeSection(Size, Alignment, SectionID); + uint8_t *return_value = m_default_mm_ap->allocateCodeSection(Size, Alignment, SectionID, SectionName); m_parent.m_records.push_back(AllocationRecord((uintptr_t)return_value, lldb::ePermissionsReadable | lldb::ePermissionsExecutable, @@ -515,11 +516,12 @@ uint8_t * IRExecutionUnit::MemoryManager::allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, + llvm::StringRef SectionName, bool IsReadOnly) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - uint8_t *return_value = m_default_mm_ap->allocateDataSection(Size, Alignment, SectionID, IsReadOnly); + uint8_t *return_value = m_default_mm_ap->allocateDataSection(Size, Alignment, SectionID, SectionName, IsReadOnly); m_parent.m_records.push_back(AllocationRecord((uintptr_t)return_value, lldb::ePermissionsReadable | lldb::ePermissionsWritable, @@ -563,28 +565,6 @@ IRExecutionUnit::MemoryManager::dealloca m_default_mm_ap->deallocateFunctionBody(Body); } -uint8_t* -IRExecutionUnit::MemoryManager::startExceptionTable(const llvm::Function* F, - uintptr_t &ActualSize) -{ - return m_default_mm_ap->startExceptionTable(F, ActualSize); -} - -void -IRExecutionUnit::MemoryManager::endExceptionTable(const llvm::Function *F, - uint8_t *TableStart, - uint8_t *TableEnd, - uint8_t* FrameRegister) -{ - m_default_mm_ap->endExceptionTable(F, TableStart, TableEnd, FrameRegister); -} - -void -IRExecutionUnit::MemoryManager::deallocateExceptionTable(void *ET) -{ - m_default_mm_ap->deallocateExceptionTable (ET); -} - lldb::addr_t IRExecutionUnit::GetRemoteAddressForLocal (lldb::addr_t local_address) { Modified: head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -357,6 +357,20 @@ IRForTarget::ResolveFunctionPointers(llv if (value_ptr) *value_ptr = value; + // If we are replacing a function with the nobuiltin attribute, it may + // be called with the builtin attribute on call sites. Remove any such + // attributes since it's illegal to have a builtin call to something + // other than a nobuiltin function. + if (fun->hasFnAttribute(llvm::Attribute::NoBuiltin)) { + llvm::Attribute builtin = llvm::Attribute::get(fun->getContext(), llvm::Attribute::Builtin); + + for (auto u = fun->use_begin(), e = fun->use_end(); u != e; ++u) { + if (auto call = dyn_cast(*u)) { + call->removeAttribute(AttributeSet::FunctionIndex, builtin); + } + } + } + fun->replaceAllUsesWith(value); } Modified: head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -570,9 +570,8 @@ FileSpec::ResolveExecutableLocation () if (file_cstr) { const std::string file_str (file_cstr); - llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str); - const std::string &path_str = path.str(); - llvm::StringRef dir_ref = llvm::sys::path::parent_path(path_str); + std::string path = llvm::sys::FindProgramByName (file_str); + llvm::StringRef dir_ref = llvm::sys::path::parent_path(path); //llvm::StringRef dir_ref = path.getDirname(); if (! dir_ref.empty()) { Modified: head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -10,6 +10,7 @@ #include "DisassemblerLLVMC.h" #include "llvm-c/Disassembler.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler.h" @@ -17,6 +18,7 @@ #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" +#include "llvm/MC/MCRelocationInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MemoryObject.h" @@ -430,23 +432,30 @@ DisassemblerLLVMC::LLVMCDisassembler::LL m_subtarget_info_ap.reset(curr_target->createMCSubtargetInfo(triple, "", features_str)); - m_asm_info_ap.reset(curr_target->createMCAsmInfo(triple)); - + m_asm_info_ap.reset(curr_target->createMCAsmInfo(*curr_target->createMCRegInfo(triple), triple)); + if (m_instr_info_ap.get() == NULL || m_reg_info_ap.get() == NULL || m_subtarget_info_ap.get() == NULL || m_asm_info_ap.get() == NULL) { m_is_valid = false; return; } - m_context_ap.reset(new llvm::MCContext(*m_asm_info_ap.get(), *(m_reg_info_ap.get()), 0)); + m_context_ap.reset(new llvm::MCContext(m_asm_info_ap.get(), m_reg_info_ap.get(), 0)); m_disasm_ap.reset(curr_target->createMCDisassembler(*m_subtarget_info_ap.get())); - if (m_disasm_ap.get()) + if (m_disasm_ap.get() && m_context_ap.get()) { + llvm::OwningPtr RelInfo(curr_target->createMCRelocationInfo(triple, *m_context_ap.get())); + if (!RelInfo) + { + m_is_valid = false; + return; + } m_disasm_ap->setupForSymbolicDisassembly(NULL, - DisassemblerLLVMC::SymbolLookupCallback, - (void *) &owner, - m_context_ap.get()); + DisassemblerLLVMC::SymbolLookupCallback, + (void *) &owner, + m_context_ap.get(), + RelInfo); unsigned asm_printer_variant; if (flavor == ~0U) Modified: head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -25,7 +25,7 @@ #include "Utility/ARM_DWARF_Registers.h" #include "llvm/Support/MathExtras.h" // for SignExtend32 template function - // and CountTrailingZeros_32 function + // and countTrailingZeros function using namespace lldb; using namespace lldb_private; @@ -47,7 +47,7 @@ using namespace lldb_private; static uint32_t CountITSize (uint32_t ITMask) { // First count the trailing zeros of the IT mask. - uint32_t TZ = llvm::CountTrailingZeros_32(ITMask); + uint32_t TZ = llvm::countTrailingZeros(ITMask); if (TZ > 3) { #ifdef LLDB_CONFIGURATION_DEBUG Modified: head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -1476,6 +1476,9 @@ ClangASTType::GetTypeClass () const case clang::Type::Decltype: break; case clang::Type::TemplateSpecialization: break; case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } // We don't know hot to display this type... return lldb::eTypeClassOther; @@ -1912,6 +1915,9 @@ ClangASTType::GetEncoding (uint64_t &cou case clang::Type::Decltype: case clang::Type::TemplateSpecialization: case clang::Type::Atomic: + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } count = 0; @@ -2041,6 +2047,10 @@ ClangASTType::GetFormat () const case clang::Type::TemplateSpecialization: case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: + break; } // We don't know hot to display this type... return lldb::eFormatBytes; @@ -5227,6 +5237,9 @@ ClangASTType::GetDeclContextForType () c case clang::Type::InjectedClassName: break; case clang::Type::DependentName: break; case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } // No DeclContext in this type... return NULL; Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Mon Feb 17 18:25:41 2014 (r262120) +++ head/usr.bin/clang/lldb/Makefile Mon Feb 17 18:50:03 2014 (r262121) @@ -77,6 +77,7 @@ LIBDEPS=\ clangbasic \ clanglex \ \ + llvmoption \ llvmarmasmparser \ llvmarmcodegen \ llvminstrumentation \