diff options
author | Hafiz Abid Qadeer <hafiz_abid@mentor.com> | 2017-01-05 13:23:47 +0000 |
---|---|---|
committer | Hafiz Abid Qadeer <hafiz_abid@mentor.com> | 2017-01-05 13:23:47 +0000 |
commit | 5e9bfc671bf24e58b239dd993149b66aada7cf4c (patch) | |
tree | 683e2fb290de778c83b01830c2fadcf6fe1936fe /lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py | |
parent | 763f1c453b59970c76c93f919b1514ab5c533c70 (diff) | |
download | bcm5719-llvm-5e9bfc671bf24e58b239dd993149b66aada7cf4c.tar.gz bcm5719-llvm-5e9bfc671bf24e58b239dd993149b66aada7cf4c.zip |
[lldb-mi] Fix implementation for a few mi commands
Summary:
Some of the mi commands implemented in lldb-mi are incomplete/not confirming to the spec.
- `gdb-show` and `gdb-set` doesn't support getting/setting `disassembly-flavor`
- `environment-cd` should also change the working directory for inferior
- debugger CLI output should be printed as console-stream-output record, rather than being dumped directly
to stdout
- `target-select` should provide inner error message in mi response
Related bug report:
- https://llvm.org/bugs/show_bug.cgi?id=28026
- https://llvm.org/bugs/show_bug.cgi?id=28718
- https://llvm.org/bugs/show_bug.cgi?id=30265
Reviewers: ki.stfu, abidh
Subscribers: abidh, ki.stfu, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D24711
llvm-svn: 291104
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py new file mode 100644 index 00000000000..044bfb10c31 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py @@ -0,0 +1,36 @@ +""" +Test lldb-mi -environment-cd command. +""" + +from __future__ import print_function + + +import lldbmi_testcase +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class MiEnvironmentCdTestCase(lldbmi_testcase.MiTestCaseBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + def test_lldbmi_environment_cd(self): + """Test that 'lldb-mi --interpreter' changes working directory for inferior.""" + + self.spawnLldbMi(args=None) + + # Load executable + self.runCmd("-file-exec-and-symbols %s" % self.myexe) + self.expect("\^done") + + # cd to a different directory + self.runCmd("-environment-cd /tmp") + self.expect("\^done") + + # Run to the end + self.runCmd("-exec-run") + self.expect("\^running") + self.expect("@\"cwd: /tmp\\r\\n\"", exactly=True) |