From owner-svn-src-all@freebsd.org Thu Apr 20 21:21:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB875D48991; Thu, 20 Apr 2017 21:21:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64A24162C; Thu, 20 Apr 2017 21:21:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KLLVva003133; Thu, 20 Apr 2017 21:21:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KLLSGs003104; Thu, 20 Apr 2017 21:21:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704202121.v3KLLSGs003104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Apr 2017 21:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317228 - in vendor/lldb/dist: cmake/modules include/lldb/Core include/lldb/Expression include/lldb/Utility lldb.xcodeproj packages/Python/lldbsuite/test/functionalities/data-formatter/... X-SVN-Group: vendor 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.23 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: Thu, 20 Apr 2017 21:21:33 -0000 Author: dim Date: Thu Apr 20 21:21:28 2017 New Revision: 317228 URL: https://svnweb.freebsd.org/changeset/base/317228 Log: Vendor import of lldb trunk r300890: https://llvm.org/svn/llvm-project/lldb/trunk@300890 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/main.c (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/history/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py (contents, props changed) vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h (contents, props changed) Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake vendor/lldb/dist/include/lldb/Core/ArchSpec.h vendor/lldb/dist/include/lldb/Expression/DiagnosticManager.h vendor/lldb/dist/include/lldb/Utility/StringLexer.h vendor/lldb/dist/lldb.xcodeproj/project.pbxproj vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py vendor/lldb/dist/source/Commands/CommandObjectCommands.cpp vendor/lldb/dist/source/Commands/CommandObjectFrame.cpp vendor/lldb/dist/source/Core/ArchSpec.cpp vendor/lldb/dist/source/Core/Scalar.cpp vendor/lldb/dist/source/Expression/DiagnosticManager.cpp vendor/lldb/dist/source/Interpreter/CommandHistory.cpp vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/CMakeLists.txt vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_x86_64.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h vendor/lldb/dist/source/Symbol/ClangASTContext.cpp vendor/lldb/dist/source/Utility/StringLexer.cpp vendor/lldb/dist/unittests/Core/ArchSpecTest.cpp Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Thu Apr 20 21:21:28 2017 (r317228) @@ -433,7 +433,9 @@ endif() find_package(Backtrace) +include(CheckIncludeFile) check_include_file(termios.h HAVE_TERMIOS_H) +check_include_file(sys/event.h HAVE_SYS_EVENT_H) # These checks exist in LLVM's configuration, so I want to match the LLVM names # so that the check isn't duplicated, but we translate them into the LLDB names Modified: vendor/lldb/dist/include/lldb/Core/ArchSpec.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/ArchSpec.h Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/include/lldb/Core/ArchSpec.h Thu Apr 20 21:21:28 2017 (r317228) @@ -625,6 +625,7 @@ public: protected: bool IsEqualTo(const ArchSpec &rhs, bool exact_match) const; + void UpdateCore(); llvm::Triple m_triple; Core m_core = kCore_invalid; Modified: vendor/lldb/dist/include/lldb/Expression/DiagnosticManager.h ============================================================================== --- vendor/lldb/dist/include/lldb/Expression/DiagnosticManager.h Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/include/lldb/Expression/DiagnosticManager.h Thu Apr 20 21:21:28 2017 (r317228) @@ -128,6 +128,8 @@ public: m_diagnostics.push_back(diagnostic); } + void CopyDiagnostics(DiagnosticManager &otherDiagnostics); + size_t Printf(DiagnosticSeverity severity, const char *format, ...) __attribute__((format(printf, 3, 4))); size_t PutString(DiagnosticSeverity severity, llvm::StringRef str); Modified: vendor/lldb/dist/include/lldb/Utility/StringLexer.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/StringLexer.h Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/include/lldb/Utility/StringLexer.h Thu Apr 20 21:21:28 2017 (r317228) @@ -41,8 +41,6 @@ public: bool HasAtLeast(Size s); - bool HasAny(Character c); - std::string GetUnlexed(); // This will assert if there are less than s characters preceding the cursor. Modified: vendor/lldb/dist/lldb.xcodeproj/project.pbxproj ============================================================================== --- vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Apr 20 21:21:28 2017 (r317228) @@ -923,6 +923,8 @@ AF33B4BE1C1FA441001B28D9 /* NetBSDSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */; }; AF33B4BF1C1FA441001B28D9 /* NetBSDSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */; }; AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp */; }; + AF3A4AD21EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */; }; + AF3A4AD31EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */; }; AF415AE71D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF415AE51D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp */; }; AF415AE81D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = AF415AE61D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h */; }; AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */; }; @@ -2937,6 +2939,8 @@ AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetBSDSignals.cpp; path = Utility/NetBSDSignals.cpp; sourceTree = ""; }; AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetBSDSignals.h; path = Utility/NetBSDSignals.h; sourceTree = ""; }; AF37E10917C861F20061E18E /* ProcessRunLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessRunLock.cpp; sourceTree = ""; }; + AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteDarwinDevice.cpp; sourceTree = ""; }; + AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteDarwinDevice.h; sourceTree = ""; }; AF3F54AE1B3BA59C00186E73 /* CrashReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrashReason.cpp; sourceTree = ""; }; AF3F54AF1B3BA59C00186E73 /* CrashReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReason.h; sourceTree = ""; }; AF3F54B21B3BA5D500186E73 /* POSIXStopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = POSIXStopInfo.cpp; sourceTree = ""; }; @@ -5426,6 +5430,8 @@ 9455630D1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm */, 26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */, 26C5577C132575AD008FD8FE /* PlatformMacOSX.h */, + AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */, + AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */, AF8AD6331BEC28C400150209 /* PlatformRemoteAppleTV.cpp */, AF8AD6341BEC28C400150209 /* PlatformRemoteAppleTV.h */, AF8AD6351BEC28C400150209 /* PlatformRemoteAppleWatch.cpp */, @@ -6469,6 +6475,7 @@ files = ( AF8AD6381BEC28C400150209 /* PlatformRemoteAppleTV.h in Headers */, 26EFB61C1BFE8D3E00544801 /* PlatformNetBSD.h in Headers */, + AF3A4AD31EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h in Headers */, AF33B4BF1C1FA441001B28D9 /* NetBSDSignals.h in Headers */, AF6335E31C87B21E00F7D554 /* SymbolFilePDB.h in Headers */, 267F685A1CC02EBE0086832B /* RegisterInfos_s390x.h in Headers */, @@ -7284,6 +7291,7 @@ AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in Sources */, 945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources */, 26CEB5F218762056008F575A /* CommandObjectGUI.cpp in Sources */, + AF3A4AD21EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp in Sources */, 2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */, AF77E0A41A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp in Sources */, 4CDB8D6D1DBA91B6006C5B13 /* LibStdcppUniquePointer.cpp in Sources */, Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py Thu Apr 20 21:21:28 2017 (r317228) @@ -23,8 +23,8 @@ class LibCxxAtomicTestCase(TestBase): var.SetPreferSyntheticValue(True) return var - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + @skipIf(compiler=["gcc"]) + @add_test_categories(["libc++"]) def test(self): """Test that std::atomic as defined by libc++ is correctly printed by LLDB""" self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Thu Apr 20 21:21:28 2017 (r317228) @@ -30,8 +30,7 @@ class LibcxxListDataFormatterTestCase(Te self.line4 = line_number('main.cpp', '// Set fourth break point at this line.') - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py Thu Apr 20 21:21:28 2017 (r317228) @@ -17,55 +17,112 @@ class LibcxxSetDataFormatterTestCase(Tes mydir = TestBase.compute_mydir(__file__) - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + def setUp(self): + TestBase.setUp(self) + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + def getVariableType(self, name): + var = self.frame().FindVariable(name) + self.assertTrue(var.IsValid()) + return var.GetType().GetCanonicalType().GetName() + + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) -# bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")) + bkpt = self.target().FindBreakpointByID( + lldbutil.run_break_set_by_source_regexp(self, "Set break point at this line.")) self.runCmd("run", RUN_SUCCEEDED) -# lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+")) -# -# # The stop reason of the thread should be breakpoint. -# self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, -# substrs = ['stopped', -# 'stop reason = breakpoint']) -# -# # This is the function to remove the custom formats in order to have a -# # clean slate for the next test case. -# def cleanup(): -# self.runCmd('type format clear', check=False) -# self.runCmd('type summary clear', check=False) -# self.runCmd('type filter clear', check=False) -# self.runCmd('type synth clear', check=False) -# self.runCmd("settings set target.max-children-count 256", check=False) -# -# # Execute the cleanup function during test case tear down. -# self.addTearDownHook(cleanup) -# -# self.expect('image list', substrs = self.getLibcPlusPlusLibs()) -# -# self.expect("frame variable ii",substrs = ["size=0","{}"]) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"]) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) -# self.expect("frame variable ii[2]",substrs = [" = 2"]) -# self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"]) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ii",substrs = ["size=0","{}"]) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ii",substrs = ["size=0","{}"]) -# self.expect("frame variable ss",substrs = ["size=0","{}"]) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"']) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) -# self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"']) -# self.expect("frame variable ss[2]",substrs = [' = "b"']) -# lldbutil.continue_to_breakpoint(self.process(), bkpt) -# self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"']) + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs=['stopped', + 'stop reason = breakpoint']) + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type format clear', check=False) + self.runCmd('type summary clear', check=False) + self.runCmd('type filter clear', check=False) + self.runCmd('type synth clear', check=False) + self.runCmd( + "settings set target.max-children-count 256", + check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + ii_type = self.getVariableType("ii") + self.assertTrue(ii_type.startswith(self.namespace + "::set"), + "Type: " + ii_type) + + self.expect("frame variable ii", substrs=["size=0", "{}"]) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect( + "frame variable ii", + substrs=["size=6", + "[0] = 0", + "[1] = 1", + "[2] = 2", + "[3] = 3", + "[4] = 4", + "[5] = 5"]) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect( + "frame variable ii", + substrs=["size=7", + "[2] = 2", + "[3] = 3", + "[6] = 6"]) + self.expect("frame variable ii[2]", substrs=[" = 2"]) + self.expect( + "p ii", + substrs=[ + "size=7", + "[2] = 2", + "[3] = 3", + "[6] = 6"]) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect("frame variable ii", substrs=["size=0", "{}"]) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect("frame variable ii", substrs=["size=0", "{}"]) + + ss_type = self.getVariableType("ss") + self.assertTrue(ii_type.startswith(self.namespace + "::set"), + "Type: " + ss_type) + + self.expect("frame variable ss", substrs=["size=0", "{}"]) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect( + "frame variable ss", + substrs=["size=2", + '[0] = "a"', + '[1] = "a very long string is right here"']) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect( + "frame variable ss", + substrs=["size=4", + '[2] = "b"', + '[3] = "c"', + '[0] = "a"', + '[1] = "a very long string is right here"']) + self.expect( + "p ss", + substrs=["size=4", + '[2] = "b"', + '[3] = "c"', + '[0] = "a"', + '[1] = "a very long string is right here"']) + self.expect("frame variable ss[2]", substrs=[' = "b"']) + lldbutil.continue_to_breakpoint(self.process(), bkpt) + self.expect( + "frame variable ss", + substrs=["size=3", + '[0] = "a"', + '[1] = "a very long string is right here"', + '[2] = "c"']) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/Makefile Thu Apr 20 21:21:28 2017 (r317228) @@ -0,0 +1,6 @@ +LEVEL = ../../make + +C_SOURCES := main.c +CFLAGS_EXTRAS += -std=c99 + +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py Thu Apr 20 21:21:28 2017 (r317228) @@ -0,0 +1,99 @@ +""" +Make sure the frame variable -g, -a, and -l flags work. +""" + +from __future__ import print_function + + +import os +import time +import re +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + + +class TestFrameVar(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + # If your test case doesn't stress debug info, the + # set this to true. That way it won't be run once for + # each debug info format. + NO_DEBUG_INFO_TESTCASE = True + + def test_frame_var(self): + self.build() + self.do_test() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + def do_test(self): + exe = os.path.join(os.getcwd(), "a.out") + + # Create a target by the debugger. + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + # Now create a breakpoint in main.c at the source matching + # "Set a breakpoint here" + breakpoint = target.BreakpointCreateBySourceRegex( + "Set a breakpoint here", lldb.SBFileSpec("main.c")) + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() >= 1, + VALID_BREAKPOINT) + + error = lldb.SBError() + # This is the launch info. If you want to launch with arguments or + # environment variables, add them using SetArguments or + # SetEnvironmentEntries + + launch_info = lldb.SBLaunchInfo(None) + process = target.Launch(launch_info, error) + self.assertTrue(process, PROCESS_IS_VALID) + + # Did we hit our breakpoint? + from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint + threads = get_threads_stopped_at_breakpoint(process, breakpoint) + self.assertTrue( + len(threads) == 1, + "There should be a thread stopped at our breakpoint") + + # The hit count for the breakpoint should be 1. + self.assertTrue(breakpoint.GetHitCount() == 1) + + frame = threads[0].GetFrameAtIndex(0) + command_result = lldb.SBCommandReturnObject() + interp = self.dbg.GetCommandInterpreter() + + # Just get args: + result = interp.HandleCommand("frame var -l", command_result) + self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed") + output = command_result.GetOutput() + self.assertTrue("argc" in output, "Args didn't find argc") + self.assertTrue("argv" in output, "Args didn't find argv") + self.assertTrue("test_var" not in output, "Args found a local") + self.assertTrue("g_var" not in output, "Args found a global") + + # Just get locals: + result = interp.HandleCommand("frame var -a", command_result) + self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed") + output = command_result.GetOutput() + self.assertTrue("argc" not in output, "Locals found argc") + self.assertTrue("argv" not in output, "Locals found argv") + self.assertTrue("test_var" in output, "Locals didn't find test_var") + self.assertTrue("g_var" not in output, "Locals found a global") + + # Get the file statics: + result = interp.HandleCommand("frame var -l -a -g", command_result) + self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "frame var -a didn't succeed") + output = command_result.GetOutput() + self.assertTrue("argc" not in output, "Globals found argc") + self.assertTrue("argv" not in output, "Globals found argv") + self.assertTrue("test_var" not in output, "Globals found test_var") + self.assertTrue("g_var" in output, "Globals didn't find g_var") + + + Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/frame_var/main.c Thu Apr 20 21:21:28 2017 (r317228) @@ -0,0 +1,11 @@ +#include + +int g_var = 200; + +int +main(int argc, char **argv) +{ + int test_var = 10; + printf ("Set a breakpoint here: %d %d.\n", test_var, g_var); + return 0; +} Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py Thu Apr 20 21:21:28 2017 (r317228) @@ -0,0 +1,45 @@ +""" +Make sure the !N and !-N commands work properly. +""" + +from __future__ import print_function + + +import os +import time +import re +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + + +class TestHistoryRecall(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + # If your test case doesn't stress debug info, the + # set this to true. That way it won't be run once for + # each debug info format. + NO_DEBUG_INFO_TESTCASE = True + + def test_history_recall(self): + """Test the !N and !-N functionality of the command interpreter.""" + self.sample_test() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + def sample_test(self): + interp = self.dbg.GetCommandInterpreter() + result = lldb.SBCommandReturnObject() + interp.HandleCommand("command history", result, True) + interp.HandleCommand("platform list", result, True) + + interp.HandleCommand("!0", result, False) + self.assertTrue(result.Succeeded(), "!0 command did not work: %s"%(result.GetError())) + self.assertTrue("command history" in result.GetOutput(), "!0 didn't rerun command history") + + interp.HandleCommand("!-1", result, False) + self.assertTrue(result.Succeeded(), "!-1 command did not work: %s"%(result.GetError())) + self.assertTrue("host:" in result.GetOutput(), "!-1 didn't rerun platform list.") Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py Thu Apr 20 21:21:28 2017 (r317228) @@ -39,7 +39,6 @@ class LinuxCoreTestCase(TestBase): super(LinuxCoreTestCase, self).tearDown() @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_i386(self): """Test that lldb can read the process information from an i386 linux core file.""" @@ -58,21 +57,18 @@ class LinuxCoreTestCase(TestBase): self.do_test("linux-mips64el-gnuabi64", self._mips64_n64_pid, self._mips_regions) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_x86_64(self): """Test that lldb can read the process information from an x86_64 linux core file.""" self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_s390x(self): """Test that lldb can read the process information from an s390x linux core file.""" self.do_test("linux-s390x", self._s390x_pid, self._s390x_regions) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_same_pid_running(self): """Test that we read the information from the core correctly even if we have a running @@ -102,7 +98,6 @@ class LinuxCoreTestCase(TestBase): self.RemoveTempFile("linux-x86_64-pid.core") @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_two_cores_same_pid(self): """Test that we handle the situation if we have two core files with the same PID @@ -132,7 +127,6 @@ class LinuxCoreTestCase(TestBase): self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_FPR_SSE(self): # check x86_64 core file Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py Thu Apr 20 21:21:28 2017 (r317228) @@ -23,14 +23,12 @@ class GCoreTestCase(TestBase): _x86_64_pid = 5669 @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_i386(self): """Test that lldb can read the process information from an i386 linux core file.""" self.do_test("linux-i386", self._i386_pid) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_x86_64(self): """Test that lldb can read the process information from an x86_64 linux core file.""" Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py Thu Apr 20 21:21:28 2017 (r317228) @@ -27,14 +27,12 @@ class LinuxCoreThreadsTestCase(TestBase) _x86_64_tid = 5250 @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_i386(self): """Test that lldb can read the process information from an i386 linux core file.""" self.do_test("linux-i386", self._i386_pid, self._i386_tid) @skipIf(oslist=['windows']) - @skipIfDarwin # , fails started happening with r299199 @skipIf(triple='^mips') def test_x86_64(self): """Test that lldb can read the process information from an x86_64 linux core file.""" Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/register_variables/test.c Thu Apr 20 21:21:28 2017 (r317228) @@ -1,17 +1,26 @@ #include +#if defined(__arm__) || defined(__aarch64__) +// Clang does not accept regparm attribute on these platforms. +// Fortunately, the default calling convention passes arguments in registers +// anyway. +#define REGPARM(N) +#else +#define REGPARM(N) __attribute__((regparm(N))) +#endif + struct bar { int m1; int m2; }; -void f1(int a, struct bar *b) __attribute__((noinline)) __attribute__((regparm(2))); +void f1(int a, struct bar *b) __attribute__((noinline)) REGPARM(2); void f1(int a, struct bar *b) { b->m2 = b->m1 + a; // set breakpoint here } -void f2(struct bar *b) __attribute__((noinline)) __attribute__((regparm(1))); +void f2(struct bar *b) __attribute__((noinline)) REGPARM(1); void f2(struct bar *b) { int c = b->m2; Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py Thu Apr 20 21:21:28 2017 (r317228) @@ -57,16 +57,12 @@ class StaticVariableTestCase(TestBase): startstr="(int) A::g_points[1].x = 11") @expectedFailureAll( - oslist=lldbplatformutil.getDarwinOSTriples(), - bugnumber="") - @expectedFailureAll( - compiler=[ - "clang", - "gcc"], + compiler=["gcc"], bugnumber="Compiler emits incomplete debug info") @expectedFailureAll( - oslist=['freebsd'], - bugnumber='llvm.org/pr20550 failing on FreeBSD-11') + compiler=["clang"], + compiler_version=["<", "3.8"], + bugnumber='llvm.org/pr20550') @add_test_categories(['pyapi']) def test_with_python_api(self): """Test Python APIs on file and class static variables.""" @@ -105,11 +101,11 @@ class StaticVariableTestCase(TestBase): if name == 'g_points': self.assertTrue( val.GetValueType() == lldb.eValueTypeVariableStatic) - self.assertTrue(val.GetNumChildren() == 2) + self.assertEqual(val.GetNumChildren(), 2) elif name == 'A::g_points': self.assertTrue( val.GetValueType() == lldb.eValueTypeVariableGlobal) - self.assertTrue(val.GetNumChildren() == 2) + self.assertEqual(val.GetNumChildren(), 2) child1 = val.GetChildAtIndex(1) self.DebugSBValue(child1) child1_x = child1.GetChildAtIndex(0) Modified: vendor/lldb/dist/source/Commands/CommandObjectCommands.cpp ============================================================================== --- vendor/lldb/dist/source/Commands/CommandObjectCommands.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Commands/CommandObjectCommands.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -50,7 +50,11 @@ class CommandObjectCommandsHistory : pub public: CommandObjectCommandsHistory(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "command history", - "Dump the history of commands in this session.", + "Dump the history of commands in this session.\n" + "Commands in the history list can be run again " + "using \"!\". \"!-\" will re-run " + "the command that is commands from the end" + " of the list (counting the current command).", nullptr), m_options() {} Modified: vendor/lldb/dist/source/Commands/CommandObjectFrame.cpp ============================================================================== --- vendor/lldb/dist/source/Commands/CommandObjectFrame.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Commands/CommandObjectFrame.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -655,42 +655,62 @@ protected: if (num_variables > 0) { for (size_t i = 0; i < num_variables; i++) { var_sp = variable_list->GetVariableAtIndex(i); - bool dump_variable = true; - std::string scope_string; - if (dump_variable && m_option_variable.show_scope) - scope_string = GetScopeString(var_sp).str(); - - if (dump_variable) { - // Use the variable object code to make sure we are - // using the same APIs as the public API will be - // using... - valobj_sp = frame->GetValueObjectForFrameVariable( - var_sp, m_varobj_options.use_dynamic); - if (valobj_sp) { - // When dumping all variables, don't print any variables - // that are not in scope to avoid extra unneeded output - if (valobj_sp->IsInScope()) { - if (!valobj_sp->GetTargetSP() - ->GetDisplayRuntimeSupportValues() && - valobj_sp->IsRuntimeSupportValue()) - continue; - - if (!scope_string.empty()) - s.PutCString(scope_string); - - if (m_option_variable.show_decl && - var_sp->GetDeclaration().GetFile()) { - var_sp->GetDeclaration().DumpStopContext(&s, false); - s.PutCString(": "); - } - - options.SetFormat(format); - options.SetVariableFormatDisplayLanguage( - valobj_sp->GetPreferredDisplayLanguage()); - options.SetRootValueObjectName( - var_sp ? var_sp->GetName().AsCString() : nullptr); - valobj_sp->Dump(result.GetOutputStream(), options); + switch (var_sp->GetScope()) + { + case eValueTypeVariableGlobal: + if (!m_option_variable.show_globals) + continue; + break; + case eValueTypeVariableStatic: + if (!m_option_variable.show_globals) + continue; + break; + case eValueTypeVariableArgument: + if (!m_option_variable.show_args) + continue; + break; + case eValueTypeVariableLocal: + if (!m_option_variable.show_locals) + continue; + break; + default: + continue; + break; + + } + std::string scope_string; + if (m_option_variable.show_scope) + scope_string = GetScopeString(var_sp).str(); + + // Use the variable object code to make sure we are + // using the same APIs as the public API will be + // using... + valobj_sp = frame->GetValueObjectForFrameVariable( + var_sp, m_varobj_options.use_dynamic); + if (valobj_sp) { + // When dumping all variables, don't print any variables + // that are not in scope to avoid extra unneeded output + if (valobj_sp->IsInScope()) { + if (!valobj_sp->GetTargetSP() + ->GetDisplayRuntimeSupportValues() && + valobj_sp->IsRuntimeSupportValue()) + continue; + + if (!scope_string.empty()) + s.PutCString(scope_string); + + if (m_option_variable.show_decl && + var_sp->GetDeclaration().GetFile()) { + var_sp->GetDeclaration().DumpStopContext(&s, false); + s.PutCString(": "); } + + options.SetFormat(format); + options.SetVariableFormatDisplayLanguage( + valobj_sp->GetPreferredDisplayLanguage()); + options.SetRootValueObjectName( + var_sp ? var_sp->GetName().AsCString() : nullptr); + valobj_sp->Dump(result.GetOutputStream(), options); } } } Modified: vendor/lldb/dist/source/Core/ArchSpec.cpp ============================================================================== --- vendor/lldb/dist/source/Core/ArchSpec.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Core/ArchSpec.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -834,19 +834,7 @@ lldb::ByteOrder ArchSpec::GetByteOrder() bool ArchSpec::SetTriple(const llvm::Triple &triple) { m_triple = triple; - - llvm::StringRef arch_name(m_triple.getArchName()); - const CoreDefinition *core_def = FindCoreDefinition(arch_name); - if (core_def) { - m_core = core_def->core; - // Set the byte order to the default byte order for an architecture. - // This can be modified if needed for cases when cores handle both - // big and little endian - m_byte_order = core_def->default_byte_order; - } else { - Clear(); - } - + UpdateCore(); return IsValid(); } @@ -994,8 +982,10 @@ void ArchSpec::MergeFrom(const ArchSpec GetTriple().setVendor(other.GetTriple().getVendor()); if (TripleOSIsUnspecifiedUnknown() && !other.TripleOSIsUnspecifiedUnknown()) GetTriple().setOS(other.GetTriple().getOS()); - if (GetTriple().getArch() == llvm::Triple::UnknownArch) + if (GetTriple().getArch() == llvm::Triple::UnknownArch) { GetTriple().setArch(other.GetTriple().getArch()); + UpdateCore(); + } if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment && !TripleVendorWasSpecified()) { if (other.TripleVendorWasSpecified()) @@ -1190,6 +1180,20 @@ bool ArchSpec::IsEqualTo(const ArchSpec return false; } +void ArchSpec::UpdateCore() { + llvm::StringRef arch_name(m_triple.getArchName()); + const CoreDefinition *core_def = FindCoreDefinition(arch_name); + if (core_def) { + m_core = core_def->core; + // Set the byte order to the default byte order for an architecture. + // This can be modified if needed for cases when cores handle both + // big and little endian + m_byte_order = core_def->default_byte_order; + } else { + Clear(); + } +} + //===----------------------------------------------------------------------===// // Helper methods. Modified: vendor/lldb/dist/source/Core/Scalar.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Scalar.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Core/Scalar.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -2745,7 +2745,7 @@ bool Scalar::SignExtend(uint32_t sign_bi if (max_bit_pos == sign_bit_pos) return true; else if (sign_bit_pos < (max_bit_pos - 1)) { - llvm::APInt sign_bit = llvm::APInt::getSignBit(sign_bit_pos + 1); + llvm::APInt sign_bit = llvm::APInt::getSignMask(sign_bit_pos + 1); llvm::APInt bitwize_and = m_integer & sign_bit; if (bitwize_and.getBoolValue()) { const llvm::APInt mask = Modified: vendor/lldb/dist/source/Expression/DiagnosticManager.cpp ============================================================================== --- vendor/lldb/dist/source/Expression/DiagnosticManager.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Expression/DiagnosticManager.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -79,3 +79,12 @@ size_t DiagnosticManager::PutString(Diag AddDiagnostic(str, severity, eDiagnosticOriginLLDB); return str.size(); } + +void DiagnosticManager::CopyDiagnostics(DiagnosticManager &otherDiagnostics) { + for (const DiagnosticList::value_type &other_diagnostic: + otherDiagnostics.Diagnostics()) { + AddDiagnostic( + other_diagnostic->GetMessage(), other_diagnostic->GetSeverity(), + other_diagnostic->getKind(), other_diagnostic->GetCompilerID()); + } +} Modified: vendor/lldb/dist/source/Interpreter/CommandHistory.cpp ============================================================================== --- vendor/lldb/dist/source/Interpreter/CommandHistory.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Interpreter/CommandHistory.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -47,13 +47,13 @@ CommandHistory::FindString(llvm::StringR size_t idx = 0; if (input_str.front() == '-') { - if (input_str.drop_front(2).getAsInteger(0, idx)) + if (input_str.drop_front(1).getAsInteger(0, idx)) return llvm::None; if (idx >= m_history.size()) return llvm::None; idx = m_history.size() - idx; } else { - if (input_str.drop_front().getAsInteger(0, idx)) + if (input_str.getAsInteger(0, idx)) return llvm::None; if (idx >= m_history.size()) return llvm::None; Modified: vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -1810,6 +1810,7 @@ enum ExpressionStrings { const int jit_max_expr_size = 512; // Retrieve the string to JIT for the given expression +#define JIT_TEMPLATE_CONTEXT "void* ctxt = (void*)rsDebugGetContextWrapper(0x%" PRIx64 "); " const char *JITTemplate(ExpressionStrings e) { // Format strings containing the expressions we may need to evaluate. static std::array runtime_expressions = { @@ -1817,57 +1818,65 @@ const char *JITTemplate(ExpressionString "(int*)_" "Z12GetOffsetPtrPKN7android12renderscript10AllocationEjjjj23RsAllocation" "CubemapFace" - "(0x%" PRIx64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", 0, 0)", + "(0x%" PRIx64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", 0, 0)", // eExprGetOffsetPtr // Type* rsaAllocationGetType(Context*, Allocation*) - "(void*)rsaAllocationGetType(0x%" PRIx64 ", 0x%" PRIx64 ")", + JIT_TEMPLATE_CONTEXT "(void*)rsaAllocationGetType(ctxt, 0x%" PRIx64 ")", // eExprAllocGetType // rsaTypeGetNativeData(Context*, Type*, void* typeData, size) Pack the // data in the following way mHal.state.dimX; mHal.state.dimY; // mHal.state.dimZ; mHal.state.lodCount; mHal.state.faces; mElement; into // typeData Need to specify 32 or 64 bit for uint_t since this differs // between devices - "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 6); data[0]", // X dim - "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 6); data[1]", // Y dim - "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 6); data[2]", // Z dim - "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 6); data[5]", // Element ptr + JIT_TEMPLATE_CONTEXT + "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 6); data[0]", // eExprTypeDimX + JIT_TEMPLATE_CONTEXT + "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 6); data[1]", // eExprTypeDimY + JIT_TEMPLATE_CONTEXT + "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 6); data[2]", // eExprTypeDimZ + JIT_TEMPLATE_CONTEXT + "uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 6); data[5]", // eExprTypeElemPtr // rsaElementGetNativeData(Context*, Element*, uint32_t* elemData,size) // Pack mType; mKind; mNormalized; mVectorSize; NumSubElements into // elemData - "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 5); data[0]", // Type - "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 5); data[1]", // Kind - "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 5); data[3]", // Vector Size - "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%" PRIx64 - ", 0x%" PRIx64 ", data, 5); data[4]", // Field Count + JIT_TEMPLATE_CONTEXT + "uint32_t data[5]; (void*)rsaElementGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 5); data[0]", // eExprElementType + JIT_TEMPLATE_CONTEXT + "uint32_t data[5]; (void*)rsaElementGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 5); data[1]", // eExprElementKind + JIT_TEMPLATE_CONTEXT + "uint32_t data[5]; (void*)rsaElementGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 5); data[3]", // eExprElementVec + JIT_TEMPLATE_CONTEXT + "uint32_t data[5]; (void*)rsaElementGetNativeData(ctxt" + ", 0x%" PRIx64 ", data, 5); data[4]", // eExprElementFieldCount // rsaElementGetSubElements(RsContext con, RsElement elem, uintptr_t // *ids, const char **names, size_t *arraySizes, uint32_t dataSize) // Needed for Allocations of structs to gather details about // fields/Subelements Element* of field - "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 + JIT_TEMPLATE_CONTEXT "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 "]; size_t arr_size[%" PRIu32 "];" - "(void*)rsaElementGetSubElements(0x%" PRIx64 ", 0x%" PRIx64 - ", ids, names, arr_size, %" PRIu32 "); ids[%" PRIu32 "]", + "(void*)rsaElementGetSubElements(ctxt, 0x%" PRIx64 + ", ids, names, arr_size, %" PRIu32 "); ids[%" PRIu32 "]", // eExprSubelementsId // Name of field - "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 + JIT_TEMPLATE_CONTEXT "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 "]; size_t arr_size[%" PRIu32 "];" - "(void*)rsaElementGetSubElements(0x%" PRIx64 ", 0x%" PRIx64 - ", ids, names, arr_size, %" PRIu32 "); names[%" PRIu32 "]", + "(void*)rsaElementGetSubElements(ctxt, 0x%" PRIx64 + ", ids, names, arr_size, %" PRIu32 "); names[%" PRIu32 "]", // eExprSubelementsName // Array size of field - "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 + JIT_TEMPLATE_CONTEXT "void* ids[%" PRIu32 "]; const char* names[%" PRIu32 "]; size_t arr_size[%" PRIu32 "];" - "(void*)rsaElementGetSubElements(0x%" PRIx64 ", 0x%" PRIx64 - ", ids, names, arr_size, %" PRIu32 "); arr_size[%" PRIu32 "]"}}; + "(void*)rsaElementGetSubElements(ctxt, 0x%" PRIx64 + ", ids, names, arr_size, %" PRIu32 "); arr_size[%" PRIu32 "]"}}; // eExprSubelementsArrSize return runtime_expressions[e]; } @@ -1979,8 +1988,8 @@ bool RenderScriptRuntime::JITTypePacked( for (uint32_t i = 0; i < num_exprs; ++i) { const char *fmt_str = JITTemplate(ExpressionStrings(eExprTypeDimX + i)); - int written = snprintf(expr_bufs[i], jit_max_expr_size, fmt_str, bits, - *alloc->context.get(), *alloc->type_ptr.get()); + int written = snprintf(expr_bufs[i], jit_max_expr_size, fmt_str, + *alloc->context.get(), bits, *alloc->type_ptr.get()); if (written < 0) { if (log) log->Printf("%s - encoding error in snprintf().", __FUNCTION__); @@ -2105,7 +2114,7 @@ bool RenderScriptRuntime::JITSubelements const char *fmt_str = JITTemplate(ExpressionStrings(eExprSubelementsId + expr_index)); int written = snprintf(expr_buffer, jit_max_expr_size, fmt_str, - field_count, field_count, field_count, context, + context, field_count, field_count, field_count, *elem.element_ptr.get(), field_count, field_index); if (written < 0) { if (log) Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/CMakeLists.txt Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/CMakeLists.txt Thu Apr 20 21:21:28 2017 (r317228) @@ -5,6 +5,7 @@ list(APPEND PLUGIN_PLATFORM_MACOSX_SOURC PlatformRemoteiOS.cpp PlatformRemoteAppleTV.cpp PlatformRemoteAppleWatch.cpp + PlatformRemoteDarwinDevice.cpp ) list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -569,6 +569,8 @@ bool PlatformDarwin::ARMGetSupportedArch #define OSNAME "tvos" #elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 #define OSNAME "watchos" +#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1 +#define OSNAME "bridgeos" #else #define OSNAME "ios" #endif Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Thu Apr 20 21:21:25 2017 (r317227) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Thu Apr 20 21:21:28 2017 (r317228) @@ -508,9 +508,10 @@ PlatformDarwinKernel::GetKernelsAndKexts ConstString file_spec_extension = file_spec.GetFileNameExtension(); Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) - log->Printf("PlatformDarwinKernel examining %s", - file_spec.GetPath().c_str()); + Log *log_verbose(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM | LLDB_LOG_OPTION_VERBOSE)); + + if (log_verbose) + log_verbose->Printf ("PlatformDarwinKernel examining '%s'", file_spec.GetPath().c_str()); PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton; if (ft == llvm::sys::fs::file_type::regular_file || @@ -520,9 +521,21 @@ PlatformDarwinKernel::GetKernelsAndKexts strncmp(filename.GetCString(), "mach", 4) == 0) && file_spec_extension != g_dsym_suffix) { if (KernelHasdSYMSibling(file_spec)) + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kernel binary '%s' with dSYM sibling", file_spec.GetPath().c_str()); + } thisp->m_kernel_binaries_with_dsyms.push_back(file_spec); + } else + { + if (log) + { + log->Printf ("PlatformDarwinKernel registering kernel binary '%s', no dSYM", file_spec.GetPath().c_str()); + } thisp->m_kernel_binaries_without_dsyms.push_back(file_spec); + } return FileSpec::eEnumerateDirectoryResultNext; } } else if (ft == llvm::sys::fs::file_type::directory_file && @@ -556,6 +569,8 @@ PlatformDarwinKernel::GetKernelsAndKexts if (recurse && file_spec_extension != g_dsym_suffix && file_spec_extension != g_kext_suffix && file_spec_extension != g_bundle_suffix) { + if (log_verbose) + log_verbose->Printf ("PlatformDarwinKernel descending into directory '%s'", file_spec.GetPath().c_str()); return FileSpec::eEnumerateDirectoryResultEnter; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***