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/TestMiGdbSetShow.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/TestMiGdbSetShow.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py index 5daf3fe0939..9b575c49bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py @@ -208,3 +208,44 @@ class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done") self.runCmd("-var-evaluate-expression var_a") self.expect("\^done,value=\"10\"") + + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @expectedFailureAll( + bugnumber="llvm.org/pr31485: data-disassemble doesn't follow flavor settings") + def test_lldbmi_gdb_set_disassembly_flavor(self): + """Test that 'lldb-mi --interpreter' works for -gdb-set disassembly-flavor.""" + + self.spawnLldbMi(args=None) + + # Load executable + self.runCmd("-file-exec-and-symbols %s" % self.myexe) + self.expect("\^done") + + # Run to BP_printf + line = line_number('main.cpp', '// BP_printf') + self.runCmd("-break-insert main.cpp:%d" % line) + self.expect("\^done,bkpt={number=\"1\"") + self.runCmd("-exec-run") + self.expect("\^running") + self.expect("\*stopped,reason=\"breakpoint-hit\".+addr=\"(0x[0-9a-f]+)\"") + + # Get starting and ending address from $pc + pc = int(self.child.match.group(1), base=16) + s_addr, e_addr = pc, pc + 1 + + # Test default output (att) + self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr)) + self.expect("movl ") + + # Test intel style + self.runCmd("-gdb-set disassembly-flavor intel") + self.expect("\^done") + self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr)) + self.expect("mov ") + + # Test AT&T style + self.runCmd("-gdb-set disassembly-flavor intel") + self.expect("\^done") + self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr)) + self.expect("movl ") |