For the reproducer feature I need to be able to export and import the current LLDB configuration. To realize this I've extended the existing functionality to print settings. With the help of a new formatting option, we can now write the settings and their values to a file structured as regular commands.
Concretely the functionality works as follows:
(lldb) settings export /path/to/file
This file contains a bunch of settings set commands, followed by the setting's name and value.
settings set use-external-editor false settings set use-color true settings set auto-one-line-summaries true settings set auto-indent true
Loading the settings again is as simple as sourcing the newly created file:
(lldb) command source /path/to/file
I had to make a few small changes here to make this work:
- When a value is not set settings set <setting> is equal to settings clear <setting>. This is because not all settings have a meaningful default For example for settings set we used to print unknown which is not a value the user can set.
- I introduced a new printing option and group for printing options as commands. This relates to printing everything on a single line for things like arrays and dicts.