mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 05:46:45 +00:00
[lldb] Specify aguments of image list
Register positional argument details in `CommandObjectTargetModulesList`. I recently learned that `image list` takes a module name, but the help info does not indicate this. With this change, `help image list` will show that it accepts zero or more module names. This makes it easier to get info about specific modules, without having to find/grep through the full image list. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D125154
This commit is contained in:
parent
4f1e64b54f
commit
760298adc2
@ -50,6 +50,7 @@
|
||||
#include "lldb/Utility/LLDBLog.h"
|
||||
#include "lldb/Utility/State.h"
|
||||
#include "lldb/Utility/Timer.h"
|
||||
#include "lldb/lldb-enumerations.h"
|
||||
#include "lldb/lldb-private-enumerations.h"
|
||||
|
||||
#include "llvm/ADT/ScopeExit.h"
|
||||
@ -2901,8 +2902,10 @@ public:
|
||||
CommandObjectTargetModulesList(CommandInterpreter &interpreter)
|
||||
: CommandObjectParsed(
|
||||
interpreter, "target modules list",
|
||||
"List current executable and dependent shared library images.",
|
||||
"target modules list [<cmd-options>]") {}
|
||||
"List current executable and dependent shared library images.") {
|
||||
CommandArgumentData module_arg{eArgTypeShlibName, eArgRepeatStar};
|
||||
m_arguments.push_back({module_arg});
|
||||
}
|
||||
|
||||
~CommandObjectTargetModulesList() override = default;
|
||||
|
||||
|
@ -104,6 +104,13 @@ class HelpCommandTestCase(TestBase):
|
||||
self.expect("help image du line", substrs=[
|
||||
'Dump the line table for one or more compilation units'])
|
||||
|
||||
@no_debug_info_test
|
||||
def test_help_image_list_shows_positional_args(self):
|
||||
"""Command 'help image list' should describe positional args."""
|
||||
# 'image' is an alias for 'target modules'.
|
||||
self.expect("help image list", substrs=[
|
||||
'<shlib-name> [...]'])
|
||||
|
||||
@no_debug_info_test
|
||||
def test_help_target_variable_syntax(self):
|
||||
"""Command 'help target variable' should display <variable-name> ..."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user