diff options
author | Jason Molenda <jason@molenda.com> | 2021-08-11 13:37:31 -0700 |
---|---|---|
committer | Jason Molenda <jason@molenda.com> | 2021-08-11 13:37:31 -0700 |
commit | 8c31efeed6007bade1e4ddda2ceccab311661cbc (patch) | |
tree | 377dbb83efe5a2daef75ec6fb11c1454edd352cf /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | 7f3c3d7aa491ddd761ba821519ef795c90292947 (diff) | |
download | llvm-8c31efeed6007bade1e4ddda2ceccab311661cbc.zip llvm-8c31efeed6007bade1e4ddda2ceccab311661cbc.tar.gz llvm-8c31efeed6007bade1e4ddda2ceccab311661cbc.tar.bz2 |
Add the ability to process save-core stack-memory-only corefiles
Add a field to the qMemoryRegionInfo packet where the remote stub
can describe the type of memory -- heap, stack. Keep track of
memory regions that are stack memory in lldb. Add a new "--style
stack" to process save-core to request that only stack memory be
included in the corefile.
Differential Revision: https://reviews.llvm.org/D107625
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 1a8ed02..c65b661 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1166,7 +1166,9 @@ protected: static constexpr OptionEnumValueElement g_corefile_save_style[] = { {eSaveCoreFull, "full", "Create a core file with all memory saved"}, {eSaveCoreDirtyOnly, "modified-memory", - "Create a corefile with only modified memory saved"}}; + "Create a corefile with only modified memory saved"}, + {eSaveCoreStackOnly, "stack", + "Create a corefile with only stack memory saved"}}; static constexpr OptionEnumValues SaveCoreStyles() { return OptionEnumValues(g_corefile_save_style); @@ -1237,11 +1239,12 @@ protected: Status error = PluginManager::SaveCore(process_sp, output_file, corefile_style); if (error.Success()) { - if (corefile_style == SaveCoreStyle::eSaveCoreDirtyOnly) { + if (corefile_style == SaveCoreStyle::eSaveCoreDirtyOnly || + corefile_style == SaveCoreStyle::eSaveCoreStackOnly) { result.AppendMessageWithFormat( - "\nModified-memory only corefile " - "created. This corefile may not show \n" - "library/framework/app binaries " + "\nModified-memory or stack-memory only corefile " + "created. This corefile may \n" + "not show library/framework/app binaries " "on a different system, or when \n" "those binaries have " "been updated/modified. Copies are not included\n" |