[Lldb-commits] [lldb] [lldb] Make deep copies of Status explicit (NFC) (PR #107170)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-x86_64-debian-dylib` running on `gribozavr4` while building `lldb` at step 5 "build-unified-tree". Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/6830 Here is the relevant piece of the build log for the reference ``` Step 5 (build-unified-tree) failure: build (failure) ... 85.597 [357/96/6522] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_ARM64.cpp.o 85.635 [356/96/6523] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangASTSource.cpp.o 85.642 [355/96/6524] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_32.cpp.o 85.651 [354/96/6525] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/CodeViewRegisterMapping.cpp.o 85.746 [353/96/6526] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunication.cpp.o 85.767 [352/96/6527] Building CXX object tools/lldb/source/Plugins/ObjectFile/ELF/CMakeFiles/lldbPluginObjectFileELF.dir/ObjectFileELF.cpp.o 85.797 [351/96/6528] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbFPOProgramToDWARFExpression.cpp.o 85.864 [350/96/6529] Building CXX object tools/lldb/source/Plugins/Process/minidump/CMakeFiles/lldbPluginProcessMinidump.dir/RegisterContextMinidump_x86_64.cpp.o 85.876 [349/96/6530] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbSymUid.cpp.o 85.958 [348/96/6531] Building CXX object tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o FAILED: tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source/Plugins/Process/Linux -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/../clang/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -MF tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o.d -o tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/NativeProcessLinux.cpp.o -c /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1100:13: error: object of type 'lldb_private::Status' cannot be assigned because its copy assignment operator is implicitly deleted error = ^ /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy assignment operator is implicitly deleted because 'Status' has a user-declared move constructor Status(Status &&other) = default; ^ /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1911:12: error: call to implicitly-deleted copy constructor of 'lldb_private::Status' return resume_result; ^ /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include/lldb/Utility/Status.h:71:3: note: copy constructor is implicitly deleted because 'Status' has a user-declared move constru
[Lldb-commits] [lldb] b934570 - [lldb] Update ScriptInterpreterLua for Status changes (NFC)
Author: Jonas Devlieghere Date: 2024-09-07T17:03:59-07:00 New Revision: b93457073762bb347b6c7f39c23636dec036a815 URL: https://github.com/llvm/llvm-project/commit/b93457073762bb347b6c7f39c23636dec036a815 DIFF: https://github.com/llvm/llvm-project/commit/b93457073762bb347b6c7f39c23636dec036a815.diff LOG: [lldb] Update ScriptInterpreterLua for Status changes (NFC) The Status constructor that takes an error has been removed in favor of Status::FromError. Added: Modified: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp Removed: diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp index ea74a500518e31..896fc6951b85c6 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp @@ -358,16 +358,16 @@ Status ScriptInterpreterLua::SetBreakpointCommandCallback( Status ScriptInterpreterLua::RegisterBreakpointCallback( BreakpointOptions &bp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp) { - Status error; auto data_up = std::make_unique(extra_args_sp); - error = m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text); - if (error.Fail()) -return error; + llvm::Error err = + m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text); + if (err) +return Status::FromError(std::move(err)); auto baton_sp = std::make_shared(std::move(data_up)); bp_options.SetCallback(ScriptInterpreterLua::BreakpointCallbackFunction, baton_sp); - return error; + return {}; } void ScriptInterpreterLua::SetWatchpointCommandCallback( @@ -379,16 +379,16 @@ void ScriptInterpreterLua::SetWatchpointCommandCallback( Status ScriptInterpreterLua::RegisterWatchpointCallback( WatchpointOptions *wp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp) { - Status error; auto data_up = std::make_unique(); - error = m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text); - if (error.Fail()) -return error; + llvm::Error err = + m_lua->RegisterWatchpointCallback(data_up.get(), command_body_text); + if (err) +return Status::FromError(std::move(err)); auto baton_sp = std::make_shared(std::move(data_up)); wp_options->SetCallback(ScriptInterpreterLua::WatchpointCallbackFunction, baton_sp); - return error; + return {}; } lldb::ScriptInterpreterSP ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/107731 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Jonas Devlieghere (JDevlieghere) Changes Reverts llvm/llvm-project#107159 as this is still causing `TestSkinnyCorefile.py` to time out. https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/11099/ https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/5544/ --- Patch is 42.04 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/107731.diff 25 Files Affected: - (modified) lldb/include/lldb/API/SBMemoryRegionInfo.h (+1-1) - (modified) lldb/include/lldb/API/SBSaveCoreOptions.h (-11) - (modified) lldb/include/lldb/Symbol/SaveCoreOptions.h (+2-9) - (removed) lldb/include/lldb/Target/CoreFileMemoryRanges.h (-50) - (modified) lldb/include/lldb/Target/Process.h (+23-2) - (modified) lldb/include/lldb/Utility/RangeMap.h (-2) - (modified) lldb/include/lldb/lldb-enumerations.h (-1) - (modified) lldb/include/lldb/lldb-forward.h (-1) - (modified) lldb/include/lldb/lldb-private-interfaces.h (+1) - (modified) lldb/source/API/SBSaveCoreOptions.cpp (-11) - (modified) lldb/source/Commands/CommandObjectProcess.cpp (-1) - (modified) lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (+2-4) - (modified) lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h (-1) - (modified) lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp (+14-21) - (modified) lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h (+2-3) - (modified) lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h (-1) - (modified) lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (-1) - (modified) lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h (-1) - (modified) lldb/source/Symbol/SaveCoreOptions.cpp (-14) - (modified) lldb/source/Target/CMakeLists.txt (-1) - (removed) lldb/source/Target/CoreFileMemoryRanges.cpp (-49) - (modified) lldb/source/Target/Process.cpp (+22-53) - (modified) lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py (-149) - (modified) lldb/unittests/Process/Utility/CMakeLists.txt (-1) - (removed) lldb/unittests/Process/Utility/CoreFileMemoryRangesTest.cpp (-108) ``diff diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h index f9a5dc993d7cb6..be55de4ead1fa8 100644 --- a/lldb/include/lldb/API/SBMemoryRegionInfo.h +++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h @@ -120,7 +120,7 @@ class LLDB_API SBMemoryRegionInfo { private: friend class SBProcess; friend class SBMemoryRegionInfoList; - friend class SBSaveCoreOptions; + friend class lldb_private::ScriptInterpreter; lldb_private::MemoryRegionInfo &ref(); diff --git a/lldb/include/lldb/API/SBSaveCoreOptions.h b/lldb/include/lldb/API/SBSaveCoreOptions.h index c076d3ce6f7575..ba48ba5eaea5a0 100644 --- a/lldb/include/lldb/API/SBSaveCoreOptions.h +++ b/lldb/include/lldb/API/SBSaveCoreOptions.h @@ -80,17 +80,6 @@ class LLDB_API SBSaveCoreOptions { /// \return True if the thread was removed, false if it was not in the list. bool RemoveThread(lldb::SBThread thread); - /// Add a memory region to save in the core file. - /// - /// \param region The memory region to save. - /// \returns An empty SBError upon success, or an error if the region is - /// invalid. - /// \note Ranges that overlapped will be unioned into a single region, this - /// also supercedes stack minification. Specifying full regions and a - /// non-custom core style will include the specified regions and union them - /// with all style specific regions. - SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); - /// Reset all options. void Clear(); diff --git a/lldb/include/lldb/Symbol/SaveCoreOptions.h b/lldb/include/lldb/Symbol/SaveCoreOptions.h index d90d08026016dc..f4fed4676fa4ae 100644 --- a/lldb/include/lldb/Symbol/SaveCoreOptions.h +++ b/lldb/include/lldb/Symbol/SaveCoreOptions.h @@ -10,15 +10,13 @@ #define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H #include "lldb/Utility/FileSpec.h" -#include "lldb/Utility/RangeMap.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-types.h" #include -#include #include #include -using MemoryRanges = lldb_private::RangeVector; - namespace lldb_private { class SaveCoreOptions { @@ -40,12 +38,8 @@ class SaveCoreOptions { Status AddThread(lldb::ThreadSP thread_sp); bool RemoveThread(lldb::ThreadSP thread_sp); bool ShouldThreadBeSaved(lldb::tid_t tid) const; - bool HasSpecifiedThreads() const; Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const; - const MemoryRanges &GetCoreFileMemoryRanges() const; - - void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo ®ion); void Clear(); @@ -57,7 +51,6 @@ class SaveCoreOptions { std::optional m_style; lldb::ProcessSP m_process_sp; std::unordered_set m_threads_to_save; - MemoryRanges m_regions_to_save; }; } // namespace lldb_p
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/107731 Reverts llvm/llvm-project#107159 as this is still causing `TestSkinnyCorefile.py` to time out. https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/11099/ https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/5544/ >From b5a631fa2c3b681cab1ea53a5ea903d56d1283e9 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Sat, 7 Sep 2024 17:08:51 -0700 Subject: [PATCH] Revert "[LLDB] Reappply SBSaveCore AddMemoryList (#107159)" This reverts commit d4d4e77918118f1444dc5ca230d4fdf82bb05b74. --- lldb/include/lldb/API/SBMemoryRegionInfo.h| 2 +- lldb/include/lldb/API/SBSaveCoreOptions.h | 11 -- lldb/include/lldb/Symbol/SaveCoreOptions.h| 11 +- .../lldb/Target/CoreFileMemoryRanges.h| 50 -- lldb/include/lldb/Target/Process.h| 25 ++- lldb/include/lldb/Utility/RangeMap.h | 2 - lldb/include/lldb/lldb-enumerations.h | 1 - lldb/include/lldb/lldb-forward.h | 1 - lldb/include/lldb/lldb-private-interfaces.h | 1 + lldb/source/API/SBSaveCoreOptions.cpp | 11 -- lldb/source/Commands/CommandObjectProcess.cpp | 1 - .../ObjectFile/Mach-O/ObjectFileMachO.cpp | 6 +- .../ObjectFile/Mach-O/ObjectFileMachO.h | 1 - .../Minidump/MinidumpFileBuilder.cpp | 35 ++-- .../ObjectFile/Minidump/MinidumpFileBuilder.h | 5 +- .../ObjectFile/Minidump/ObjectFileMinidump.h | 1 - .../ObjectFile/PECOFF/ObjectFilePECOFF.cpp| 1 - .../ObjectFile/PECOFF/ObjectFilePECOFF.h | 1 - lldb/source/Symbol/SaveCoreOptions.cpp| 14 -- lldb/source/Target/CMakeLists.txt | 1 - lldb/source/Target/CoreFileMemoryRanges.cpp | 49 -- lldb/source/Target/Process.cpp| 75 +++-- .../TestProcessSaveCoreMinidump.py| 149 -- lldb/unittests/Process/Utility/CMakeLists.txt | 1 - .../Utility/CoreFileMemoryRangesTest.cpp | 108 - 25 files changed, 67 insertions(+), 496 deletions(-) delete mode 100644 lldb/include/lldb/Target/CoreFileMemoryRanges.h delete mode 100644 lldb/source/Target/CoreFileMemoryRanges.cpp delete mode 100644 lldb/unittests/Process/Utility/CoreFileMemoryRangesTest.cpp diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h index f9a5dc993d7cb6..be55de4ead1fa8 100644 --- a/lldb/include/lldb/API/SBMemoryRegionInfo.h +++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h @@ -120,7 +120,7 @@ class LLDB_API SBMemoryRegionInfo { private: friend class SBProcess; friend class SBMemoryRegionInfoList; - friend class SBSaveCoreOptions; + friend class lldb_private::ScriptInterpreter; lldb_private::MemoryRegionInfo &ref(); diff --git a/lldb/include/lldb/API/SBSaveCoreOptions.h b/lldb/include/lldb/API/SBSaveCoreOptions.h index c076d3ce6f7575..ba48ba5eaea5a0 100644 --- a/lldb/include/lldb/API/SBSaveCoreOptions.h +++ b/lldb/include/lldb/API/SBSaveCoreOptions.h @@ -80,17 +80,6 @@ class LLDB_API SBSaveCoreOptions { /// \return True if the thread was removed, false if it was not in the list. bool RemoveThread(lldb::SBThread thread); - /// Add a memory region to save in the core file. - /// - /// \param region The memory region to save. - /// \returns An empty SBError upon success, or an error if the region is - /// invalid. - /// \note Ranges that overlapped will be unioned into a single region, this - /// also supercedes stack minification. Specifying full regions and a - /// non-custom core style will include the specified regions and union them - /// with all style specific regions. - SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); - /// Reset all options. void Clear(); diff --git a/lldb/include/lldb/Symbol/SaveCoreOptions.h b/lldb/include/lldb/Symbol/SaveCoreOptions.h index d90d08026016dc..f4fed4676fa4ae 100644 --- a/lldb/include/lldb/Symbol/SaveCoreOptions.h +++ b/lldb/include/lldb/Symbol/SaveCoreOptions.h @@ -10,15 +10,13 @@ #define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H #include "lldb/Utility/FileSpec.h" -#include "lldb/Utility/RangeMap.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-types.h" #include -#include #include #include -using MemoryRanges = lldb_private::RangeVector; - namespace lldb_private { class SaveCoreOptions { @@ -40,12 +38,8 @@ class SaveCoreOptions { Status AddThread(lldb::ThreadSP thread_sp); bool RemoveThread(lldb::ThreadSP thread_sp); bool ShouldThreadBeSaved(lldb::tid_t tid) const; - bool HasSpecifiedThreads() const; Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const; - const MemoryRanges &GetCoreFileMemoryRanges() const; - - void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo ®ion); void Clear(); @@ -57,7 +51,6 @@ class SaveCoreOptions { std::optional m_style; lldb::ProcessSP m_process_sp;
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
JDevlieghere wrote: CC @Jlalond https://github.com/llvm/llvm-project/pull/107731 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] bb34346 - Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (#107731)
Author: Jonas Devlieghere Date: 2024-09-07T17:10:20-07:00 New Revision: bb343468ffa8c2190fcdd0f704d370c75d3b5edd URL: https://github.com/llvm/llvm-project/commit/bb343468ffa8c2190fcdd0f704d370c75d3b5edd DIFF: https://github.com/llvm/llvm-project/commit/bb343468ffa8c2190fcdd0f704d370c75d3b5edd.diff LOG: Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (#107731) Reverts llvm/llvm-project#107159 as this is still causing `TestSkinnyCorefile.py` to time out. https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/11099/ https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/5544/ Added: Modified: lldb/include/lldb/API/SBMemoryRegionInfo.h lldb/include/lldb/API/SBSaveCoreOptions.h lldb/include/lldb/Symbol/SaveCoreOptions.h lldb/include/lldb/Target/Process.h lldb/include/lldb/Utility/RangeMap.h lldb/include/lldb/lldb-enumerations.h lldb/include/lldb/lldb-forward.h lldb/include/lldb/lldb-private-interfaces.h lldb/source/API/SBSaveCoreOptions.cpp lldb/source/Commands/CommandObjectProcess.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h lldb/source/Symbol/SaveCoreOptions.cpp lldb/source/Target/CMakeLists.txt lldb/source/Target/Process.cpp lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py lldb/unittests/Process/Utility/CMakeLists.txt Removed: lldb/include/lldb/Target/CoreFileMemoryRanges.h lldb/source/Target/CoreFileMemoryRanges.cpp lldb/unittests/Process/Utility/CoreFileMemoryRangesTest.cpp diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h index f9a5dc993d7cb6..be55de4ead1fa8 100644 --- a/lldb/include/lldb/API/SBMemoryRegionInfo.h +++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h @@ -120,7 +120,7 @@ class LLDB_API SBMemoryRegionInfo { private: friend class SBProcess; friend class SBMemoryRegionInfoList; - friend class SBSaveCoreOptions; + friend class lldb_private::ScriptInterpreter; lldb_private::MemoryRegionInfo &ref(); diff --git a/lldb/include/lldb/API/SBSaveCoreOptions.h b/lldb/include/lldb/API/SBSaveCoreOptions.h index c076d3ce6f7575..ba48ba5eaea5a0 100644 --- a/lldb/include/lldb/API/SBSaveCoreOptions.h +++ b/lldb/include/lldb/API/SBSaveCoreOptions.h @@ -80,17 +80,6 @@ class LLDB_API SBSaveCoreOptions { /// \return True if the thread was removed, false if it was not in the list. bool RemoveThread(lldb::SBThread thread); - /// Add a memory region to save in the core file. - /// - /// \param region The memory region to save. - /// \returns An empty SBError upon success, or an error if the region is - /// invalid. - /// \note Ranges that overlapped will be unioned into a single region, this - /// also supercedes stack minification. Specifying full regions and a - /// non-custom core style will include the specified regions and union them - /// with all style specific regions. - SBError AddMemoryRegionToSave(const SBMemoryRegionInfo ®ion); - /// Reset all options. void Clear(); diff --git a/lldb/include/lldb/Symbol/SaveCoreOptions.h b/lldb/include/lldb/Symbol/SaveCoreOptions.h index d90d08026016dc..f4fed4676fa4ae 100644 --- a/lldb/include/lldb/Symbol/SaveCoreOptions.h +++ b/lldb/include/lldb/Symbol/SaveCoreOptions.h @@ -10,15 +10,13 @@ #define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H #include "lldb/Utility/FileSpec.h" -#include "lldb/Utility/RangeMap.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-types.h" #include -#include #include #include -using MemoryRanges = lldb_private::RangeVector; - namespace lldb_private { class SaveCoreOptions { @@ -40,12 +38,8 @@ class SaveCoreOptions { Status AddThread(lldb::ThreadSP thread_sp); bool RemoveThread(lldb::ThreadSP thread_sp); bool ShouldThreadBeSaved(lldb::tid_t tid) const; - bool HasSpecifiedThreads() const; Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const; - const MemoryRanges &GetCoreFileMemoryRanges() const; - - void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo ®ion); void Clear(); @@ -57,7 +51,6 @@ class SaveCoreOptions { std::optional m_style; lldb::ProcessSP m_process_sp; std::unordered_set m_threads_to_save; - MemoryRanges m_regions_to_save; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/CoreFileMemoryRanges.h b/lldb/include/lldb/Target/CoreFileMemoryRanges.h deleted file mode 100644 index 503ecd691e5948..0
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
jasonmolenda wrote: I'll look more closely later when I have time, but ObjectFileMachO::SaveCore called `Process::CalculateCoreFileSaveRanges` with an `options` of `eSaveCoreDirtyOnly` (so, `GetCoreFileSaveRangesDirtyOnly()`), it's returning gigantic memory regions to be saved to the corefile. I tried doing a "full" style coredump of the test binary (using an lldb with this patch applied) and it was around 4.6GB. Then I tried a `-s modified-memory` corefile and it had dumped 34GB before I killed the process. Running an lldb without this PR, a dirty-memory-only coredump of this process is 10MB. https://github.com/llvm/llvm-project/pull/107731 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
Jlalond wrote: > I'll look more closely later when I have time, but ObjectFileMachO::SaveCore > called `Process::CalculateCoreFileSaveRanges` with an `options` of > `eSaveCoreDirtyOnly` (so, `GetCoreFileSaveRangesDirtyOnly()`), it's returning > gigantic memory regions to be saved to the corefile. I tried doing a "full" > style coredump of the test binary (using an lldb with this patch applied) and > it was around 4.6GB. Then I tried a `-s modified-memory` corefile and it had > dumped 34GB before I killed the process. Running an lldb without this PR, a > dirty-memory-only coredump of this process is 10MB. Sorry about causing some problems on Saturday no less. My guess is this is from the finalize core save ranges, specifically how we roll up all the memory ranges. My first thinking out loud question is why this isn't happening on Linux Minidumps, but I know MacOS and Linux differ on what the kernel says if the page is dirty. I'll look into it on Monday and appreciate the investigation assistance https://github.com/llvm/llvm-project/pull/107731 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits