diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 13 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 2 |
2 files changed, 10 insertions, 5 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 diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index f9a5b10bb4b..96c245cb8bb 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -57,7 +57,7 @@ llvm::StringRef CommandObject::GetHelp() { return m_cmd_help_short; } llvm::StringRef CommandObject::GetHelpLong() { return m_cmd_help_long; } llvm::StringRef CommandObject::GetSyntax() { - if (m_cmd_syntax.empty()) + if (!m_cmd_syntax.empty()) return m_cmd_syntax; StreamString syntax_str; |