diff options
author | Enrico Granata <egranata@apple.com> | 2013-05-31 01:03:09 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-05-31 01:03:09 +0000 |
commit | e0c70f1b2c4f05ca1e3333015faac4c87d814403 (patch) | |
tree | 6c593471f230f1a4e8bac55ae6c7ff9c4e00dfe4 /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | a2b7720618b7cadb6e8dd07941261a0bf6837986 (diff) | |
download | llvm-e0c70f1b2c4f05ca1e3333015faac4c87d814403.zip llvm-e0c70f1b2c4f05ca1e3333015faac4c87d814403.tar.gz llvm-e0c70f1b2c4f05ca1e3333015faac4c87d814403.tar.bz2 |
<rdar://problem/11109316>
command script import now does reloads - for real
If you invoke command script import foo and it detects that foo has already been imported, it will
- invoke reload(foo) to reload the module in Python
- re-invoke foo.__lldb_init_module
This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing
Usual caveats with Python imports persist. Among these:
- if you have objects lurking around, reloading the module won't magically update them to reflect changes
- if module A imports module B, reloading A won't reload B
These are Python-specific issues independent of LLDB that would require more extensive design work
The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not
llvm-svn: 182977
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 278fdc0..5964eac 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1355,7 +1355,7 @@ protected: void OptionParsingStarting () { - m_allow_reload = false; + m_allow_reload = true; } const OptionDefinition* @@ -1426,7 +1426,7 @@ protected: OptionDefinition CommandObjectCommandsScriptImport::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_1, false, "allow-reload", 'r', no_argument, NULL, 0, eArgTypeNone, "Allow the script to be loaded even if it was already loaded before (for Python, the __lldb_init_module function will be called again, but the module will not be reloaded from disk)."}, + { LLDB_OPT_SET_1, false, "allow-reload", 'r', no_argument, NULL, 0, eArgTypeNone, "Allow the script to be loaded even if it was already loaded before. This argument exists for backwards compatibility, but reloading is always allowed, whether you specify it or not."}, { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; |