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/Core/Module.cpp | |
parent | a2b7720618b7cadb6e8dd07941261a0bf6837986 (diff) | |
download | bcm5719-llvm-e0c70f1b2c4f05ca1e3333015faac4c87d814403.tar.gz bcm5719-llvm-e0c70f1b2c4f05ca1e3333015faac4c87d814403.zip |
<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/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 0967ef7100d..d8420ab8af1 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1287,7 +1287,7 @@ Module::LoadScriptingResourceInTarget (Target *target, Error& error, Stream* fee } StreamString scripting_stream; scripting_fspec.Dump(&scripting_stream); - const bool can_reload = false; + const bool can_reload = true; const bool init_lldb_globals = false; bool did_load = script_interpreter->LoadScriptingModule(scripting_stream.GetData(), can_reload, init_lldb_globals, error); if (!did_load) |