summaryrefslogtreecommitdiff
path: root/lldb/test/API/commands/platform/basic/TestPlatformCommand.py
AgeCommit message (Collapse)Author
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2022-06-17[lldb][tests] Automatically call compute_mydir (NFC)Dave Lee
Eliminate boilerplate of having each test manually assign to `mydir` by calling `compute_mydir` in lldbtest.py. Differential Revision: https://reviews.llvm.org/D128077
2022-04-08[lldb] Skip a bunch of tests that shouldn't run remotelyJonas Devlieghere
Skip a bunch of tests that don't really make sense to run remotely.
2022-01-12[lldb] Don't print "Command Options Usage:" for an alias with no optionsDavid Spickett
"shell" is an alias to "platform shell -h --". Previously you would get this help text: (lldb) help shell Run a shell command on the host. Expects 'raw' input (see 'help raw-input'.) Syntax: shell <shell-command> Command Options Usage: 'shell' is an abbreviation for 'platform shell -h --' Since the code doesn't handle the base command having options but the alias removing them. With these changes you get: (lldb) help shell Run a shell command on the host. Expects 'raw' input (see 'help raw-input'.) Syntax: shell <shell-command> 'shell' is an abbreviation for 'platform shell -h --' Note that we already handle a non-alias command having no options, for example "quit": (lldb) help quit Quit the LLDB debugger. Syntax: quit [exit-code] Reviewed By: JDevlieghere, jingham Differential Revision: https://reviews.llvm.org/D117004
2020-09-02[lldb/Target] Add custom interpreter option to `platform shell`Med Ismail Bennani
This patch adds the ability to use a custom interpreter with the `platform shell` command. If the user set the `-s|--shell` option with the path to a binary, lldb passes it down to the platform's `RunShellProcess` method and set it as the shell to use in `ProcessLaunchInfo to run commands. Note that not all the Platforms support running shell commands with custom interpreters (i.e. RemoteGDBServer is only expected to use the default shell). This patch also makes some refactoring and cleanups, like swapping CString for StringRef when possible and updating `SBPlatformShellCommand` with new methods and a new constructor. rdar://67759256 Differential Revision: https://reviews.llvm.org/D86667 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-05-15[lldb/Commands] Add ability to run shell command on the host.Med Ismail Bennani
This patch introduces the `(-h|--host)` option to the `platform shell` command. It allows the user to run shell commands from the host platform (always available) without putting lldb in the background. Since the default behaviour of `platform shell` is to run the command of the selected platform, having such a choice can be quite handy when debugging remote targets, for instances. This patch also introduces a `shell` alias, to improve the command discoverability and make it more convenient to use for the user. rdar://62856024 Differential Revision: https://reviews.llvm.org/D79659 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-11[lldb][test] Remove symlink for API tests.Jordan Rupprecht
Summary: Moves lldbsuite tests to lldb/test/API. This is a largely mechanical change, moved with the following steps: ``` rm lldb/test/API/testcases mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}} mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done ``` lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure. Reviewers: labath, JDevlieghere Tags: #lldb Differential Revision: https://reviews.llvm.org/D71151