[LLDB][SBSaveCore] Fix bug where default values are not propagated. (#101770)

In #100443, Mach-o and Minidump now only call process API's that take a
`SaveCoreOption` as the container for the style and information if a
thread should be included in the core or not. This introduced a bug
where in subsequent method calls we were not honoring the defaults of
both implementations.

~~To solve this I have made a copy of each SaveCoreOptions that is
mutable by the respective plugin. Originally I wanted to leave the
SaveCoreOptions as non const so these default value mutations could be
shown back to the user. Changing that behavior is outside of the scope
of this bugfix, but is context for why we are making a copy.~~

Removed const on the savecoreoptions so defaults can be inspected by the
user

CC: @Michael137
This commit is contained in:
Jacob Lalonde
2024-08-02 18:38:05 -07:00
committed by GitHub
parent 259ca9ee9c
commit 34766d0d48
13 changed files with 45 additions and 21 deletions

View File

@@ -355,7 +355,7 @@ size_t ObjectFilePECOFF::GetModuleSpecifications(
}
bool ObjectFilePECOFF::SaveCore(const lldb::ProcessSP &process_sp,
const lldb_private::SaveCoreOptions &options,
lldb_private::SaveCoreOptions &options,
lldb_private::Status &error) {
// Outfile and process_sp are validated by PluginManager::SaveCore
assert(options.GetOutputFile().has_value());