2015-08-13 22:05:54 +00:00
|
|
|
"""
|
2015-02-20 16:34:33 +00:00
|
|
|
Test lldb-mi -file-xxx commands.
|
2014-11-25 10:41:57 +00:00
|
|
|
"""
|
|
|
|
|
2015-10-23 17:04:29 +00:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2015-10-27 20:12:05 +00:00
|
|
|
import use_lldb_suite
|
2015-10-22 20:06:20 +00:00
|
|
|
|
2015-01-27 18:03:50 +00:00
|
|
|
import lldbmi_testcase
|
2015-11-03 02:06:18 +00:00
|
|
|
from lldbsuite.test.lldbtest import *
|
2014-11-25 10:41:57 +00:00
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
class MiFileTestCase(lldbmi_testcase.MiTestCaseBase):
|
|
|
|
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
2014-11-25 10:41:57 +00:00
|
|
|
|
2015-08-13 20:50:17 +00:00
|
|
|
@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
|
2015-02-18 20:31:30 +00:00
|
|
|
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
2015-02-20 16:34:33 +00:00
|
|
|
def test_lldbmi_file_exec_and_symbols_file(self):
|
2014-11-25 10:41:57 +00:00
|
|
|
"""Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols exe."""
|
2015-01-27 18:03:50 +00:00
|
|
|
|
|
|
|
self.spawnLldbMi(args = None)
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Test that -file-exec-and-symbols works for filename
|
2015-01-27 18:03:50 +00:00
|
|
|
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
|
|
|
|
self.expect("\^done")
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Run
|
2015-01-27 18:03:50 +00:00
|
|
|
self.runCmd("-exec-run")
|
|
|
|
self.expect("\^running")
|
|
|
|
self.expect("\*stopped,reason=\"exited-normally\"")
|
2014-11-25 10:41:57 +00:00
|
|
|
|
2015-08-13 20:50:17 +00:00
|
|
|
@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
|
2015-02-18 20:31:30 +00:00
|
|
|
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
2015-02-20 16:34:33 +00:00
|
|
|
def test_lldbmi_file_exec_and_symbols_absolute_path(self):
|
2014-11-25 10:41:57 +00:00
|
|
|
"""Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols fullpath/exe."""
|
2015-01-27 18:03:50 +00:00
|
|
|
|
|
|
|
self.spawnLldbMi(args = None)
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Test that -file-exec-and-symbols works for absolute path
|
2015-01-27 18:03:50 +00:00
|
|
|
import os
|
2015-02-20 16:34:33 +00:00
|
|
|
path = os.path.join(os.getcwd(), self.myexe)
|
|
|
|
self.runCmd("-file-exec-and-symbols \"%s\"" % path)
|
2015-01-27 18:03:50 +00:00
|
|
|
self.expect("\^done")
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Run
|
2015-01-27 18:03:50 +00:00
|
|
|
self.runCmd("-exec-run")
|
|
|
|
self.expect("\^running")
|
|
|
|
self.expect("\*stopped,reason=\"exited-normally\"")
|
2014-11-25 10:41:57 +00:00
|
|
|
|
2015-08-13 20:50:17 +00:00
|
|
|
@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
|
2015-02-18 20:31:30 +00:00
|
|
|
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
2015-02-20 16:34:33 +00:00
|
|
|
def test_lldbmi_file_exec_and_symbols_relative_path(self):
|
2014-11-25 10:41:57 +00:00
|
|
|
"""Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols relpath/exe."""
|
2015-01-27 18:03:50 +00:00
|
|
|
|
|
|
|
self.spawnLldbMi(args = None)
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Test that -file-exec-and-symbols works for relative path
|
|
|
|
path = "./%s" % self.myexe
|
|
|
|
self.runCmd("-file-exec-and-symbols %s" % path)
|
2015-01-27 18:03:50 +00:00
|
|
|
self.expect("\^done")
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Run
|
2015-01-27 18:03:50 +00:00
|
|
|
self.runCmd("-exec-run")
|
|
|
|
self.expect("\^running")
|
|
|
|
self.expect("\*stopped,reason=\"exited-normally\"")
|
2014-11-25 10:41:57 +00:00
|
|
|
|
2015-08-13 20:50:17 +00:00
|
|
|
@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
|
2015-02-18 20:31:30 +00:00
|
|
|
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
2015-02-20 16:34:33 +00:00
|
|
|
def test_lldbmi_file_exec_and_symbols_unknown_path(self):
|
2014-11-25 10:41:57 +00:00
|
|
|
"""Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols badpath/exe."""
|
|
|
|
|
2015-01-27 18:03:50 +00:00
|
|
|
self.spawnLldbMi(args = None)
|
|
|
|
|
2015-02-20 16:34:33 +00:00
|
|
|
# Test that -file-exec-and-symbols fails on unknown path
|
|
|
|
path = "unknown_dir/%s" % self.myexe
|
|
|
|
self.runCmd("-file-exec-and-symbols %s" % path)
|
2015-01-27 18:03:50 +00:00
|
|
|
self.expect("\^error")
|