diff options
author | Eugene Zemtsov <ezemtsov@google.com> | 2017-07-24 22:52:39 +0000 |
---|---|---|
committer | Eugene Zemtsov <ezemtsov@google.com> | 2017-07-24 22:52:39 +0000 |
commit | 7cff7d466413b4c9634b6f84335e6baeff232929 (patch) | |
tree | 9a84c6bf79cf40e326967b0f30d39878c701f5b3 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | 3e2ef40812204da7098c917c37ad4c8306fb65c7 (diff) | |
download | bcm5719-llvm-7cff7d466413b4c9634b6f84335e6baeff232929.tar.gz bcm5719-llvm-7cff7d466413b4c9634b6f84335e6baeff232929.zip |
Extend 'target symbols add' to load symbols from a given module
Now -shlib flag can be provided alongside with names of symbols files:
(lldb) target symbols add --shlib stripper-lib.so unstripper-lib.so
This is helpful when default matching mechanisms by name and UUID
can't find a module, and the user needs to explicitly specify
which module the given symbol file belongs to.
Differential Revision: https://reviews.llvm.org/D35607
llvm-svn: 308933
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index a80acf19be2..bb1b3f8ae7d 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -3969,7 +3969,8 @@ public: "Add a debug symbol file to one of the target's current modules by " "specifying a path to a debug symbols file, or using the options " "to specify a module to download symbols for.", - "target symbols add [<symfile>]", eCommandRequiresTarget), + "target symbols add <cmd-options> [<symfile>]", + eCommandRequiresTarget), m_option_group(), m_file_option( LLDB_OPT_SET_1, false, "shlib", 's', @@ -4289,18 +4290,22 @@ protected: if (uuid_option_set) { result.AppendError("specify either one or more paths to symbol files " "or use the --uuid option without arguments"); - } else if (file_option_set) { - result.AppendError("specify either one or more paths to symbol files " - "or use the --file option without arguments"); } else if (frame_option_set) { result.AppendError("specify either one or more paths to symbol files " "or use the --frame option without arguments"); + } else if (file_option_set && argc > 1) { + result.AppendError("specify at most one symbol file path when " + "--shlib option is set"); } else { PlatformSP platform_sp(target->GetPlatform()); for (auto &entry : args.entries()) { if (!entry.ref.empty()) { module_spec.GetSymbolFileSpec().SetFile(entry.ref, true); + if (file_option_set) { + module_spec.GetFileSpec() = + m_file_option.GetOptionValue().GetCurrentValue(); + } if (platform_sp) { FileSpec symfile_spec; if (platform_sp |