diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch index 509398da979e8..350ae6ad27c16 100644 --- a/third_party/llvm/generated.patch +++ b/third_party/llvm/generated.patch @@ -1 +1,220 @@ Auto generated patch. Do not edit or delete it, even if empty. +diff -ruN --strip-trailing-cr a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h +--- a/lldb/include/lldb/Core/PluginManager.h ++++ b/lldb/include/lldb/Core/PluginManager.h +@@ -194,7 +194,7 @@ + GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name); + + static Status SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &core_options); ++ const lldb_private::SaveCoreOptions &core_options); + + // ObjectContainer + static bool RegisterPlugin( +diff -ruN --strip-trailing-cr a/lldb/include/lldb/lldb-private-interfaces.h b/lldb/include/lldb/lldb-private-interfaces.h +--- a/lldb/include/lldb/lldb-private-interfaces.h ++++ b/lldb/include/lldb/lldb-private-interfaces.h +@@ -57,7 +57,7 @@ + const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, + const lldb::ProcessSP &process_sp, lldb::addr_t offset); + typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + Status &error); + typedef EmulateInstruction *(*EmulateInstructionCreateInstance)( + const ArchSpec &arch, InstructionType inst_type); +diff -ruN --strip-trailing-cr a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp +--- a/lldb/source/Core/PluginManager.cpp ++++ b/lldb/source/Core/PluginManager.cpp +@@ -702,7 +702,7 @@ + } + + Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options) { ++ const lldb_private::SaveCoreOptions &options) { + Status error; + if (!options.GetOutputFile()) { + error.SetErrorString("No output file specified"); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp ++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +@@ -6351,7 +6351,7 @@ + CreateAllImageInfosPayload(const lldb::ProcessSP &process_sp, + offset_t initial_file_offset, + StreamString &all_image_infos_payload, +- lldb_private::SaveCoreOptions &options) { ++ const lldb_private::SaveCoreOptions &options) { + Target &target = process_sp->GetTarget(); + ModuleList modules = target.GetImages(); + +@@ -6522,17 +6522,16 @@ + }; + + bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + Status &error) { ++ auto core_style = options.GetStyle(); ++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) ++ core_style = SaveCoreStyle::eSaveCoreDirtyOnly; + // The FileSpec and Process are already checked in PluginManager::SaveCore. + assert(options.GetOutputFile().has_value()); + assert(process_sp); + const FileSpec outfile = options.GetOutputFile().value(); + +- // MachO defaults to dirty pages +- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) +- options.SetStyle(eSaveCoreDirtyOnly); +- + Target &target = process_sp->GetTarget(); + const ArchSpec target_arch = target.GetArchitecture(); + const llvm::Triple &target_triple = target_arch.GetTriple(); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h ++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +@@ -62,7 +62,7 @@ + lldb_private::ModuleSpecList &specs); + + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + static bool MagicBytesMatch(lldb::DataBufferSP data_sp, lldb::addr_t offset, +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h +--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h ++++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h +@@ -76,7 +76,7 @@ + public: + MinidumpFileBuilder(lldb::FileUP &&core_file, + const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &save_core_options) ++ const lldb_private::SaveCoreOptions &save_core_options) + : m_process_sp(process_sp), m_core_file(std::move(core_file)), + m_save_core_options(save_core_options){}; + +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp +--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp ++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp +@@ -56,15 +56,16 @@ + } + + bool ObjectFileMinidump::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error) { + // Output file and process_sp are both checked in PluginManager::SaveCore. + assert(options.GetOutputFile().has_value()); + assert(process_sp); + + // Minidump defaults to stacks only. +- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) +- options.SetStyle(SaveCoreStyle::eSaveCoreStackOnly); ++ SaveCoreStyle core_style = options.GetStyle(); ++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) ++ core_style = SaveCoreStyle::eSaveCoreStackOnly; + + llvm::Expected maybe_core_file = FileSystem::Instance().Open( + options.GetOutputFile().value(), +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h +--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h ++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h +@@ -55,7 +55,7 @@ + + // Saves dump in Minidump file format + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + private: +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +@@ -355,7 +355,7 @@ + } + + bool ObjectFilePECOFF::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error) { + // Outfile and process_sp are validated by PluginManager::SaveCore + assert(options.GetOutputFile().has_value()); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +@@ -82,7 +82,7 @@ + lldb_private::ModuleSpecList &specs); + + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + static bool MagicBytesMatch(lldb::DataBufferSP data_sp); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +@@ -21,7 +21,8 @@ + namespace lldb_private { + + bool SaveMiniDump(const lldb::ProcessSP &process_sp, +- SaveCoreOptions &core_options, lldb_private::Status &error) { ++ const SaveCoreOptions &core_options, ++ lldb_private::Status &error) { + if (!process_sp) + return false; + #ifdef _WIN32 +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +@@ -14,7 +14,8 @@ + namespace lldb_private { + + bool SaveMiniDump(const lldb::ProcessSP &process_sp, +- SaveCoreOptions &core_options, lldb_private::Status &error); ++ const SaveCoreOptions &core_options, ++ lldb_private::Status &error); + + } // namespace lldb_private + +diff -ruN --strip-trailing-cr a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py +--- a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py ++++ b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py +@@ -10,11 +10,6 @@ + + + class ProcessSaveCoreTestCase(TestBase): +- def validate_core_pid(self, pid, core_path): +- target = self.dbg.CreateTarget(None) +- process = target.LoadCore(core_path) +- return process.GetProcessID() == pid +- + @skipIfRemote + @skipUnlessWindows + def test_cannot_save_core_unless_process_stopped(self): +@@ -93,24 +88,3 @@ + os.unlink(core) + except OSError: + pass +- +- @skipUnlessPlatform(["linux"]) +- def test_save_core_default_values_for_style_minidump(self): +- """Test we can still save a core for minidump when no +- core style is specified.""" +- self.build() +- exe = self.getBuildArtifact("a.out") +- core = self.getBuildArtifact("core.dmp") +- target = self.dbg.CreateTarget(exe) +- target.BreakpointCreateByName("bar") +- process = target.LaunchSimple(None, None, self.get_process_working_directory()) +- self.assertState(process.GetState(), lldb.eStateStopped) +- pid = process.GetProcessID() +- options = lldb.SBSaveCoreOptions() +- minidump_path = core + ".minidump" +- options.SetOutputFile(lldb.SBFileSpec(minidump_path)) +- options.SetPluginName("minidump") +- error = process.SaveCore(options) +- self.assertSuccess(error, error.GetCString()) +- self.assertTrue(os.path.isfile(minidump_path)) +- self.assertTrue(self.validate_core_pid(pid, minidump_path)) diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 37dca70a487c4..9a6a758cccc37 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" - LLVM_COMMIT = "a0a9bf5152507beacd2a72dda42d054391494c4a" - LLVM_SHA256 = "0ffb2aae087c2648f6bf5afc015fad84d2e2be834d5d359a0e52a6c5b60e6258" + LLVM_COMMIT = "1a9acd786d493b00c08d1611f51420d421b74cf1" + LLVM_SHA256 = "98c2979eac2524f2cf156150867a190357668266b82708655dcbf6ec7c483465" tf_http_archive( name = name, diff --git a/third_party/shardy/temporary.patch b/third_party/shardy/temporary.patch index 1b5228bcf2060..46881d7a4c44f 100644 --- a/third_party/shardy/temporary.patch +++ b/third_party/shardy/temporary.patch @@ -1,15 +1,240 @@ -diff --git i/third_party/llvm/workspace.bzl w/third_party/llvm/workspace.bzl -index 63c6e1b..37dca70 100644 ---- i/third_party/llvm/workspace.bzl -+++ w/third_party/llvm/workspace.bzl +diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch +index 509398d..350ae6a 100644 +--- a/third_party/llvm/generated.patch ++++ b/third_party/llvm/generated.patch +@@ -1 +1,220 @@ + Auto generated patch. Do not edit or delete it, even if empty. ++diff -ruN --strip-trailing-cr a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h ++--- a/lldb/include/lldb/Core/PluginManager.h +++++ b/lldb/include/lldb/Core/PluginManager.h ++@@ -194,7 +194,7 @@ ++ GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name); ++ ++ static Status SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &core_options); +++ const lldb_private::SaveCoreOptions &core_options); ++ ++ // ObjectContainer ++ static bool RegisterPlugin( ++diff -ruN --strip-trailing-cr a/lldb/include/lldb/lldb-private-interfaces.h b/lldb/include/lldb/lldb-private-interfaces.h ++--- a/lldb/include/lldb/lldb-private-interfaces.h +++++ b/lldb/include/lldb/lldb-private-interfaces.h ++@@ -57,7 +57,7 @@ ++ const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, ++ const lldb::ProcessSP &process_sp, lldb::addr_t offset); ++ typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ Status &error); ++ typedef EmulateInstruction *(*EmulateInstructionCreateInstance)( ++ const ArchSpec &arch, InstructionType inst_type); ++diff -ruN --strip-trailing-cr a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp ++--- a/lldb/source/Core/PluginManager.cpp +++++ b/lldb/source/Core/PluginManager.cpp ++@@ -702,7 +702,7 @@ ++ } ++ ++ Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options) { +++ const lldb_private::SaveCoreOptions &options) { ++ Status error; ++ if (!options.GetOutputFile()) { ++ error.SetErrorString("No output file specified"); ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp ++--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp ++@@ -6351,7 +6351,7 @@ ++ CreateAllImageInfosPayload(const lldb::ProcessSP &process_sp, ++ offset_t initial_file_offset, ++ StreamString &all_image_infos_payload, ++- lldb_private::SaveCoreOptions &options) { +++ const lldb_private::SaveCoreOptions &options) { ++ Target &target = process_sp->GetTarget(); ++ ModuleList modules = target.GetImages(); ++ ++@@ -6522,17 +6522,16 @@ ++ }; ++ ++ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ Status &error) { +++ auto core_style = options.GetStyle(); +++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) +++ core_style = SaveCoreStyle::eSaveCoreDirtyOnly; ++ // The FileSpec and Process are already checked in PluginManager::SaveCore. ++ assert(options.GetOutputFile().has_value()); ++ assert(process_sp); ++ const FileSpec outfile = options.GetOutputFile().value(); ++ ++- // MachO defaults to dirty pages ++- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) ++- options.SetStyle(eSaveCoreDirtyOnly); ++- ++ Target &target = process_sp->GetTarget(); ++ const ArchSpec target_arch = target.GetArchitecture(); ++ const llvm::Triple &target_triple = target_arch.GetTriple(); ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h ++--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h ++@@ -62,7 +62,7 @@ ++ lldb_private::ModuleSpecList &specs); ++ ++ static bool SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ lldb_private::Status &error); ++ ++ static bool MagicBytesMatch(lldb::DataBufferSP data_sp, lldb::addr_t offset, ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h ++--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h +++++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h ++@@ -76,7 +76,7 @@ ++ public: ++ MinidumpFileBuilder(lldb::FileUP &&core_file, ++ const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &save_core_options) +++ const lldb_private::SaveCoreOptions &save_core_options) ++ : m_process_sp(process_sp), m_core_file(std::move(core_file)), ++ m_save_core_options(save_core_options){}; ++ ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp ++--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp +++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp ++@@ -56,15 +56,16 @@ ++ } ++ ++ bool ObjectFileMinidump::SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ lldb_private::Status &error) { ++ // Output file and process_sp are both checked in PluginManager::SaveCore. ++ assert(options.GetOutputFile().has_value()); ++ assert(process_sp); ++ ++ // Minidump defaults to stacks only. ++- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) ++- options.SetStyle(SaveCoreStyle::eSaveCoreStackOnly); +++ SaveCoreStyle core_style = options.GetStyle(); +++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) +++ core_style = SaveCoreStyle::eSaveCoreStackOnly; ++ ++ llvm::Expected maybe_core_file = FileSystem::Instance().Open( ++ options.GetOutputFile().value(), ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h ++--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h +++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h ++@@ -55,7 +55,7 @@ ++ ++ // Saves dump in Minidump file format ++ static bool SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ lldb_private::Status &error); ++ ++ private: ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ++--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ++@@ -355,7 +355,7 @@ ++ } ++ ++ bool ObjectFilePECOFF::SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ lldb_private::Status &error) { ++ // Outfile and process_sp are validated by PluginManager::SaveCore ++ assert(options.GetOutputFile().has_value()); ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ++--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ++@@ -82,7 +82,7 @@ ++ lldb_private::ModuleSpecList &specs); ++ ++ static bool SaveCore(const lldb::ProcessSP &process_sp, ++- lldb_private::SaveCoreOptions &options, +++ const lldb_private::SaveCoreOptions &options, ++ lldb_private::Status &error); ++ ++ static bool MagicBytesMatch(lldb::DataBufferSP data_sp); ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp ++--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp ++@@ -21,7 +21,8 @@ ++ namespace lldb_private { ++ ++ bool SaveMiniDump(const lldb::ProcessSP &process_sp, ++- SaveCoreOptions &core_options, lldb_private::Status &error) { +++ const SaveCoreOptions &core_options, +++ lldb_private::Status &error) { ++ if (!process_sp) ++ return false; ++ #ifdef _WIN32 ++diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h ++--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h ++@@ -14,7 +14,8 @@ ++ namespace lldb_private { ++ ++ bool SaveMiniDump(const lldb::ProcessSP &process_sp, ++- SaveCoreOptions &core_options, lldb_private::Status &error); +++ const SaveCoreOptions &core_options, +++ lldb_private::Status &error); ++ ++ } // namespace lldb_private ++ ++diff -ruN --strip-trailing-cr a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py ++--- a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py +++++ b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py ++@@ -10,11 +10,6 @@ ++ ++ ++ class ProcessSaveCoreTestCase(TestBase): ++- def validate_core_pid(self, pid, core_path): ++- target = self.dbg.CreateTarget(None) ++- process = target.LoadCore(core_path) ++- return process.GetProcessID() == pid ++- ++ @skipIfRemote ++ @skipUnlessWindows ++ def test_cannot_save_core_unless_process_stopped(self): ++@@ -93,24 +88,3 @@ ++ os.unlink(core) ++ except OSError: ++ pass ++- ++- @skipUnlessPlatform(["linux"]) ++- def test_save_core_default_values_for_style_minidump(self): ++- """Test we can still save a core for minidump when no ++- core style is specified.""" ++- self.build() ++- exe = self.getBuildArtifact("a.out") ++- core = self.getBuildArtifact("core.dmp") ++- target = self.dbg.CreateTarget(exe) ++- target.BreakpointCreateByName("bar") ++- process = target.LaunchSimple(None, None, self.get_process_working_directory()) ++- self.assertState(process.GetState(), lldb.eStateStopped) ++- pid = process.GetProcessID() ++- options = lldb.SBSaveCoreOptions() ++- minidump_path = core + ".minidump" ++- options.SetOutputFile(lldb.SBFileSpec(minidump_path)) ++- options.SetPluginName("minidump") ++- error = process.SaveCore(options) ++- self.assertSuccess(error, error.GetCString()) ++- self.assertTrue(os.path.isfile(minidump_path)) ++- self.assertTrue(self.validate_core_pid(pid, minidump_path)) +diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl +index 37dca70..9a6a758 100644 +--- a/third_party/llvm/workspace.bzl ++++ b/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" -- LLVM_COMMIT = "0b92e70dfb7a3b49c24157d0a1b93d127f622683" -- LLVM_SHA256 = "0a6d078cee61bcd60250f039a419235215096a564e0f5bb98f8872445fb09742" -+ LLVM_COMMIT = "a0a9bf5152507beacd2a72dda42d054391494c4a" -+ LLVM_SHA256 = "0ffb2aae087c2648f6bf5afc015fad84d2e2be834d5d359a0e52a6c5b60e6258" +- LLVM_COMMIT = "a0a9bf5152507beacd2a72dda42d054391494c4a" +- LLVM_SHA256 = "0ffb2aae087c2648f6bf5afc015fad84d2e2be834d5d359a0e52a6c5b60e6258" ++ LLVM_COMMIT = "1a9acd786d493b00c08d1611f51420d421b74cf1" ++ LLVM_SHA256 = "98c2979eac2524f2cf156150867a190357668266b82708655dcbf6ec7c483465" tf_http_archive( name = name, diff --git a/third_party/shardy/workspace.bzl b/third_party/shardy/workspace.bzl index cc916b08a7c97..4f6e12b896ea3 100644 --- a/third_party/shardy/workspace.bzl +++ b/third_party/shardy/workspace.bzl @@ -3,8 +3,8 @@ load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): - SHARDY_COMMIT = "67053a45680dd5c6f97e859f81d86331d30ec562" - SHARDY_SHA256 = "2127d9aa520339dc09370b93860b38d5855da7126b11d24e47c2580503237dae" + SHARDY_COMMIT = "ab840bbf78d00282c726f25e207e4fae1ad0ac69" + SHARDY_SHA256 = "5c2bbe69e695bb6894ca1ece8df85a58a7ba8eb88ec7cd9904ca706c4435850d" tf_http_archive( name = "shardy", diff --git a/third_party/tsl/third_party/llvm/generated.patch b/third_party/tsl/third_party/llvm/generated.patch index 509398da979e8..350ae6ad27c16 100644 --- a/third_party/tsl/third_party/llvm/generated.patch +++ b/third_party/tsl/third_party/llvm/generated.patch @@ -1 +1,220 @@ Auto generated patch. Do not edit or delete it, even if empty. +diff -ruN --strip-trailing-cr a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h +--- a/lldb/include/lldb/Core/PluginManager.h ++++ b/lldb/include/lldb/Core/PluginManager.h +@@ -194,7 +194,7 @@ + GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name); + + static Status SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &core_options); ++ const lldb_private::SaveCoreOptions &core_options); + + // ObjectContainer + static bool RegisterPlugin( +diff -ruN --strip-trailing-cr a/lldb/include/lldb/lldb-private-interfaces.h b/lldb/include/lldb/lldb-private-interfaces.h +--- a/lldb/include/lldb/lldb-private-interfaces.h ++++ b/lldb/include/lldb/lldb-private-interfaces.h +@@ -57,7 +57,7 @@ + const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, + const lldb::ProcessSP &process_sp, lldb::addr_t offset); + typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + Status &error); + typedef EmulateInstruction *(*EmulateInstructionCreateInstance)( + const ArchSpec &arch, InstructionType inst_type); +diff -ruN --strip-trailing-cr a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp +--- a/lldb/source/Core/PluginManager.cpp ++++ b/lldb/source/Core/PluginManager.cpp +@@ -702,7 +702,7 @@ + } + + Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options) { ++ const lldb_private::SaveCoreOptions &options) { + Status error; + if (!options.GetOutputFile()) { + error.SetErrorString("No output file specified"); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp ++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +@@ -6351,7 +6351,7 @@ + CreateAllImageInfosPayload(const lldb::ProcessSP &process_sp, + offset_t initial_file_offset, + StreamString &all_image_infos_payload, +- lldb_private::SaveCoreOptions &options) { ++ const lldb_private::SaveCoreOptions &options) { + Target &target = process_sp->GetTarget(); + ModuleList modules = target.GetImages(); + +@@ -6522,17 +6522,16 @@ + }; + + bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + Status &error) { ++ auto core_style = options.GetStyle(); ++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) ++ core_style = SaveCoreStyle::eSaveCoreDirtyOnly; + // The FileSpec and Process are already checked in PluginManager::SaveCore. + assert(options.GetOutputFile().has_value()); + assert(process_sp); + const FileSpec outfile = options.GetOutputFile().value(); + +- // MachO defaults to dirty pages +- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) +- options.SetStyle(eSaveCoreDirtyOnly); +- + Target &target = process_sp->GetTarget(); + const ArchSpec target_arch = target.GetArchitecture(); + const llvm::Triple &target_triple = target_arch.GetTriple(); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h ++++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +@@ -62,7 +62,7 @@ + lldb_private::ModuleSpecList &specs); + + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + static bool MagicBytesMatch(lldb::DataBufferSP data_sp, lldb::addr_t offset, +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h +--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h ++++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h +@@ -76,7 +76,7 @@ + public: + MinidumpFileBuilder(lldb::FileUP &&core_file, + const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &save_core_options) ++ const lldb_private::SaveCoreOptions &save_core_options) + : m_process_sp(process_sp), m_core_file(std::move(core_file)), + m_save_core_options(save_core_options){}; + +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp +--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp ++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp +@@ -56,15 +56,16 @@ + } + + bool ObjectFileMinidump::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error) { + // Output file and process_sp are both checked in PluginManager::SaveCore. + assert(options.GetOutputFile().has_value()); + assert(process_sp); + + // Minidump defaults to stacks only. +- if (options.GetStyle() == SaveCoreStyle::eSaveCoreUnspecified) +- options.SetStyle(SaveCoreStyle::eSaveCoreStackOnly); ++ SaveCoreStyle core_style = options.GetStyle(); ++ if (core_style == SaveCoreStyle::eSaveCoreUnspecified) ++ core_style = SaveCoreStyle::eSaveCoreStackOnly; + + llvm::Expected maybe_core_file = FileSystem::Instance().Open( + options.GetOutputFile().value(), +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h +--- a/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h ++++ b/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h +@@ -55,7 +55,7 @@ + + // Saves dump in Minidump file format + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + private: +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +@@ -355,7 +355,7 @@ + } + + bool ObjectFilePECOFF::SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error) { + // Outfile and process_sp are validated by PluginManager::SaveCore + assert(options.GetOutputFile().has_value()); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +@@ -82,7 +82,7 @@ + lldb_private::ModuleSpecList &specs); + + static bool SaveCore(const lldb::ProcessSP &process_sp, +- lldb_private::SaveCoreOptions &options, ++ const lldb_private::SaveCoreOptions &options, + lldb_private::Status &error); + + static bool MagicBytesMatch(lldb::DataBufferSP data_sp); +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +@@ -21,7 +21,8 @@ + namespace lldb_private { + + bool SaveMiniDump(const lldb::ProcessSP &process_sp, +- SaveCoreOptions &core_options, lldb_private::Status &error) { ++ const SaveCoreOptions &core_options, ++ lldb_private::Status &error) { + if (!process_sp) + return false; + #ifdef _WIN32 +diff -ruN --strip-trailing-cr a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +--- a/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h ++++ b/lldb/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +@@ -14,7 +14,8 @@ + namespace lldb_private { + + bool SaveMiniDump(const lldb::ProcessSP &process_sp, +- SaveCoreOptions &core_options, lldb_private::Status &error); ++ const SaveCoreOptions &core_options, ++ lldb_private::Status &error); + + } // namespace lldb_private + +diff -ruN --strip-trailing-cr a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py +--- a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py ++++ b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py +@@ -10,11 +10,6 @@ + + + class ProcessSaveCoreTestCase(TestBase): +- def validate_core_pid(self, pid, core_path): +- target = self.dbg.CreateTarget(None) +- process = target.LoadCore(core_path) +- return process.GetProcessID() == pid +- + @skipIfRemote + @skipUnlessWindows + def test_cannot_save_core_unless_process_stopped(self): +@@ -93,24 +88,3 @@ + os.unlink(core) + except OSError: + pass +- +- @skipUnlessPlatform(["linux"]) +- def test_save_core_default_values_for_style_minidump(self): +- """Test we can still save a core for minidump when no +- core style is specified.""" +- self.build() +- exe = self.getBuildArtifact("a.out") +- core = self.getBuildArtifact("core.dmp") +- target = self.dbg.CreateTarget(exe) +- target.BreakpointCreateByName("bar") +- process = target.LaunchSimple(None, None, self.get_process_working_directory()) +- self.assertState(process.GetState(), lldb.eStateStopped) +- pid = process.GetProcessID() +- options = lldb.SBSaveCoreOptions() +- minidump_path = core + ".minidump" +- options.SetOutputFile(lldb.SBFileSpec(minidump_path)) +- options.SetPluginName("minidump") +- error = process.SaveCore(options) +- self.assertSuccess(error, error.GetCString()) +- self.assertTrue(os.path.isfile(minidump_path)) +- self.assertTrue(self.validate_core_pid(pid, minidump_path)) diff --git a/third_party/tsl/third_party/llvm/workspace.bzl b/third_party/tsl/third_party/llvm/workspace.bzl index 37dca70a487c4..9a6a758cccc37 100644 --- a/third_party/tsl/third_party/llvm/workspace.bzl +++ b/third_party/tsl/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" - LLVM_COMMIT = "a0a9bf5152507beacd2a72dda42d054391494c4a" - LLVM_SHA256 = "0ffb2aae087c2648f6bf5afc015fad84d2e2be834d5d359a0e52a6c5b60e6258" + LLVM_COMMIT = "1a9acd786d493b00c08d1611f51420d421b74cf1" + LLVM_SHA256 = "98c2979eac2524f2cf156150867a190357668266b82708655dcbf6ec7c483465" tf_http_archive( name = name,