return "skip on the iOS Simulator" if configuration.lldb_platform_name == 'ios-simulator' else None
return skipTestIfFn(is_ios_simulator)(func)
-def skipIfiOS(func):
- return skipIfPlatform(["ios"])(func)
-
-def skipIftvOS(func):
- return skipIfPlatform(["tvos"])(func)
-
-def skipIfwatchOS(func):
- return skipIfPlatform(["watchos"])(func)
-
-def skipIfbridgeOS(func):
- return skipIfPlatform(["bridgeos"])(func)
-
-def skipIfDarwinEmbedded(func):
- """Decorate the item to skip tests that should be skipped on Darwin armv7/arm64 targets."""
- return skipIfPlatform(
- lldbplatform.translate(
- lldbplatform.darwin_embedded))(func)
def skipIfFreeBSD(func):
"""Decorate the item to skip tests that should be skipped on FreeBSD."""
# Calling this function now succeeds, but we follow the typedef return type through to
# const char *, and thus don't invoke the Summary formatter.
-
- # clang's libstdc++ on ios arm64 inlines std::string::c_str() always;
- # skip this part of the test.
- triple = self.dbg.GetSelectedPlatform().GetTriple()
- do_cstr_test = True
- if triple == "arm64-apple-ios" or triple == "arm64-apple-tvos" or triple == "armv7k-apple-watchos" or triple == "arm64-apple-bridgeos":
- do_cstr_test = False
- if do_cstr_test:
- self.expect("print str.c_str()",
- substrs=['Hello world'])
+ self.expect("print str.c_str()",
+ substrs=['Hello world'])
@expectedFailureAll(
archs=[
"i[3-6]86",
- "x86_64",
- "arm64",
- 'armv7',
- 'armv7k'],
+ "x86_64"],
bugnumber="llvm.org/pr23069, <rdar://problem/28721938>")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
@expectedFailureAll(triple='mips*', bugnumber="llvm.org/pr23069")
bugnumber='http://llvm.org/pr23504',
oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0'])
@skipIf(archs=["i386", "i686"])
- @skipIf(debug_info="gmodules", archs=['arm64', 'armv7', 'armv7k']) # compile error with gmodules for iOS
def test_with(self):
"""Test that we can p *objcObject"""
self.build()
OBJC_SOURCES := main.m
include $(LEVEL)/Makefile.rules
-LDFLAGS += -framework Foundation
+LDFLAGS += -framework Cocoa
-#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
int main()
{
# here.
@skipIfWindows
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
- @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch
def test_fd_leak_basic(self):
self.do_test([])
# here.
@skipIfWindows
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
- @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch
def test_fd_leak_log(self):
self.do_test(["log enable -f '/dev/null' lldb commands"])
# here.
@skipIfWindows
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
- @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch
def test_fd_leak_multitarget(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
@skipUnlessDarwin
@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656605")
- @expectedFailureAll(archs=['armv7', 'armv7k'], bugnumber="rdar://problem/34561607") # NSIndexPath formatter isn't working for 32-bit arm
def test_nsindexpath_with_run_command(self):
"""Test formatters for NSIndexPath."""
self.appkit_tester_impl(self.nsindexpath_data_formatter_commands)
if arch in ["", 'x86_64', 'i386', 'i686']:
breakpoint_opcodes = ["int3"]
instructions = [' mov', ' addl ', 'ret']
- elif arch in ["arm", "aarch64", "arm64", "armv7", "armv7k"]:
+ elif arch in ["arm", "aarch64"]:
breakpoint_opcodes = ["brk", "udf"]
instructions = [' add ', ' ldr ', ' str ']
elif re.match("mips", arch):
@skipUnlessDarwin
@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems
def test(self):
if self.getArchitecture() == 'x86_64':
source = os.path.join(os.getcwd(), "main.cpp")
threads = lldbutil.get_threads_stopped_at_breakpoint(
process, breakpoint)
- if self.TraceOn():
- for t in process.threads:
- print(t)
- if t.GetStopReason() != lldb.eStopReasonBreakpoint:
- self.runCmd("bt")
self.assertTrue(len(threads) == 1,
"Stopped at breakpoint in exec'ed process.")
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_array(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_bad_reference(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
@expectedFailureAll(oslist=['macosx'], archs=['i386'], bugnumber="rdar://28656408")
def test_diagnose_dereference_function_return(self):
TestBase.setUp(self)
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_this(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_inheritance(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_local_variable(self):
TestBase.setUp(self)
self.build()
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_virtual_method_call(self):
TestBase.setUp(self)
self.build()
"linux",
"freebsd"],
bugnumber="llvm.org/pr24778 llvm.org/pr22627")
- @skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so arg expansion won't happen
def test(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
lib_%:
$(MAKE) -f $*.mk
- if [ "$(OS)" = "Darwin" -a -f libloadunload_d.dylib ]; then install_name_tool -id @executable_path/libloadunload_d.dylib libloadunload_d.dylib; fi
hidden_lib_d:
$(MAKE) -C hidden
Does nothing in case of non-remote platforms.
"""
if lldb.remote_platform:
- ext = 'so'
- if self.platformIsDarwin():
- ext = 'dylib'
-
- shlibs = ['libloadunload_a.' + ext, 'libloadunload_b.' + ext,
- 'libloadunload_c.' + ext, 'libloadunload_d.' + ext]
- wd = lldb.remote_platform.GetWorkingDirectory()
cwd = os.getcwd()
+ shlibs = ['libloadunload_a.so', 'libloadunload_b.so',
+ 'libloadunload_c.so', 'libloadunload_d.so']
+ wd = lldb.remote_platform.GetWorkingDirectory()
for f in shlibs:
err = lldb.remote_platform.Put(
lldb.SBFileSpec(os.path.join(cwd, f)),
"Unable copy '%s' to '%s'.\n>>> %s" %
(f, wd, err.GetCString()))
if hidden_dir:
- shlib = 'libloadunload_d.' + ext
+ shlib = 'libloadunload_d.so'
hidden_dir = os.path.join(wd, 'hidden')
hidden_file = os.path.join(hidden_dir, shlib)
err = lldb.remote_platform.MakeDirectory(hidden_dir)
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # Test file depends on AppKit which is not present on iOS etc.
def test(self):
self.mtc_dylib_path = findMainThreadCheckerDylib()
if self.mtc_dylib_path == "":
NO_DEBUG_INFO_TESTCASE = True
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_attach_to_process_by_id(self):
"""Test attach by process id"""
self.build()
process = target.GetProcess()
self.assertTrue(process, PROCESS_IS_VALID)
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_attach_to_process_from_different_dir_by_id(self):
"""Test attach by process id"""
try:
process = target.GetProcess()
self.assertTrue(process, PROCESS_IS_VALID)
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_attach_to_process_by_name(self):
"""Test attach by process name"""
self.build()
@skipIfWindows
@skipIfiOSSimulator
- @skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc
def test_attach_to_process_by_id_denied(self):
"""Test attach by process id denied"""
self.build()
@skipIfFreeBSD # Times out on FreeBSD llvm.org/pr23731
@skipIfWindows # setpgid call does not exist on Windows
@expectedFailureAndroid("http://llvm.org/pr23762", api_levels=[16])
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_setpgid(self):
self.build()
exe = os.path.join(os.getcwd(), 'a.out')
self.runCmd("register read xmm0")
self.runCmd("register read ymm15") # may be available
self.runCmd("register read bnd0") # may be available
- elif self.getArchitecture() in ['arm', 'armv7', 'arm64']:
+ elif self.getArchitecture() in ['arm']:
self.runCmd("register read s0")
self.runCmd("register read q15") # may be available
if self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
gpr = "eax"
vector = "xmm0"
- elif self.getArchitecture() in ['arm64', 'aarch64']:
- gpr = "w0"
- vector = "v0"
- elif self.getArchitecture() in ['arm', 'armv7']:
+ elif self.getArchitecture() in ['arm']:
gpr = "r0"
vector = "q0"
("xmm15",
"{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}",
False))
- elif self.getArchitecture() in ['arm64', 'aarch64']:
- reg_list = [
- # reg value
- # must-have
- ("fpsr", "0xfbf79f9f", True),
- ("s0", "1.25", True),
- ("s31", "0.75", True),
- ("d1", "123", True),
- ("d17", "987", False),
- ("v1", "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f}", True),
- ("v14",
- "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}",
- False),
- ]
- elif self.getArchitecture() in ['armv7', 'armv7k'] and self.platformIsDarwin():
- reg_list = [
- # reg value
- # must-have
- ("fpsr", "0xfbf79f9f", True),
- ("s0", "1.25", True),
- ("s31", "0.75", True),
- ("d1", "123", True),
- ("d17", "987", False),
- ("q1", "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f}", True),
- ("q14",
- "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}",
- False),
- ]
elif self.getArchitecture() in ['arm']:
reg_list = [
# reg value
return ("clang" in self.getCompiler() and self.getArchitecture() ==
"aarch64" and self.getPlatform() == "linux")
- # ABIMacOSX_arm can't fetch simple values inside a structure
- def affected_by_radar_34562999(self):
- return (self.getArchitecture() == 'armv7' or self.getArchitecture() == 'armv7k') and self.platformIsDarwin()
-
@expectedFailureAll(oslist=["freebsd"], archs=["i386"])
@expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="<rdar://problem/28719652>")
@expectedFailureAll(
#self.assertTrue(in_float == return_float)
- if not self.affected_by_radar_34562999():
- self.return_and_test_struct_value("return_one_int")
- self.return_and_test_struct_value("return_two_int")
- self.return_and_test_struct_value("return_three_int")
- self.return_and_test_struct_value("return_four_int")
- if not self.affected_by_pr33042():
- self.return_and_test_struct_value("return_five_int")
-
- self.return_and_test_struct_value("return_two_double")
- self.return_and_test_struct_value("return_one_double_two_float")
- self.return_and_test_struct_value("return_one_int_one_float_one_int")
-
- self.return_and_test_struct_value("return_one_pointer")
- self.return_and_test_struct_value("return_two_pointer")
- self.return_and_test_struct_value("return_one_float_one_pointer")
- self.return_and_test_struct_value("return_one_int_one_pointer")
- self.return_and_test_struct_value("return_three_short_one_float")
-
- self.return_and_test_struct_value("return_one_int_one_double")
- self.return_and_test_struct_value("return_one_int_one_double_one_int")
- self.return_and_test_struct_value(
- "return_one_short_one_double_one_short")
- self.return_and_test_struct_value("return_one_float_one_int_one_float")
- self.return_and_test_struct_value("return_two_float")
- # I am leaving out the packed test until we have a way to tell CLANG
- # about alignment when reading DWARF for packed types.
- #self.return_and_test_struct_value ("return_one_int_one_double_packed")
- self.return_and_test_struct_value("return_one_int_one_long")
+ self.return_and_test_struct_value("return_one_int")
+ self.return_and_test_struct_value("return_two_int")
+ self.return_and_test_struct_value("return_three_int")
+ self.return_and_test_struct_value("return_four_int")
+ if not self.affected_by_pr33042():
+ self.return_and_test_struct_value("return_five_int")
+
+ self.return_and_test_struct_value("return_two_double")
+ self.return_and_test_struct_value("return_one_double_two_float")
+ self.return_and_test_struct_value("return_one_int_one_float_one_int")
+
+ self.return_and_test_struct_value("return_one_pointer")
+ self.return_and_test_struct_value("return_two_pointer")
+ self.return_and_test_struct_value("return_one_float_one_pointer")
+ self.return_and_test_struct_value("return_one_int_one_pointer")
+ self.return_and_test_struct_value("return_three_short_one_float")
+
+ self.return_and_test_struct_value("return_one_int_one_double")
+ self.return_and_test_struct_value("return_one_int_one_double_one_int")
+ self.return_and_test_struct_value(
+ "return_one_short_one_double_one_short")
+ self.return_and_test_struct_value("return_one_float_one_int_one_float")
+ self.return_and_test_struct_value("return_two_float")
+ # I am leaving out the packed test until we have a way to tell CLANG
+ # about alignment when reading DWARF for packed types.
+ #self.return_and_test_struct_value ("return_one_int_one_double_packed")
+ self.return_and_test_struct_value("return_one_int_one_long")
@expectedFailureAll(oslist=["freebsd"], archs=["i386"])
@expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="<rdar://problem/28719652>")
archs=["i386"])
@expectedFailureAll(compiler=["gcc"], archs=["x86_64", "i386"])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
- @skipIfDarwinEmbedded # <rdar://problem/33976032> ABIMacOSX_arm64 doesn't get structs this big correctly
def test_vector_values(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
"3.9"],
archs=["i386"],
bugnumber="llvm.org/pr28549")
- @expectedFailureAll(oslist=["ios", "tvos", "bridgeos"], bugnumber="<rdar://problem/34026777>") # lldb doesn't step past last source line in function on arm64
def test_step_in_with_python(self):
"""Test stepping in using avoid-no-debug with dwarf."""
self.build()
@expectedFailureAll(
hostoslist=["windows"],
bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIf(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k']) # <rdar://problem/34582291> problem with armv7 and step-over and stop-hook firing on ios etc systems
def test(self):
"""Test the stop-hook mechanism."""
self.build()
# Occasionally hangs on Windows, may be same as other issues.
@skipIfWindows
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_create_after_attach_with_popen(self):
"""Test thread creation after process attach."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
@skipIfRemote
@skipIfWindows # Windows doesn't have fork.
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_create_after_attach_with_fork(self):
"""Test thread creation after process attach."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"])
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working
def test_python(self):
"""Test that we obey thread conditioned breakpoints."""
self.build()
# hits break in another thread in testrun
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522')
@add_test_categories(['pyapi'])
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563348') # Two threads seem to end up with the same my_value when built for armv7.
def test_python(self):
"""Test that we obey thread conditioned breakpoints."""
self.build()
# On different platforms the "_sigtramp" and "__kill" frames are likely to be different.
# This test could probably be adapted to run on linux/*bsd easily enough.
@skipUnlessDarwin
- @expectedFailureAll(oslist=["ios", "tvos", "bridgeos"], bugnumber="<rdar://problem/34006863>") # lldb skips 1 frame on arm64 above _sigtramp
def test(self):
"""Test that we can backtrace correctly with _sigtramp on the stack"""
self.build()
# The hit count should be 0 initially.
self.expect("watchpoint list -v 1", substrs=['hit_count = 0'])
- # debugserver on ios doesn't give an error, it creates another watchpoint,
- # only expect errors on non-darwin platforms.
- if not self.platformIsDarwin():
- # Try setting a watchpoint at byteArray[1]
- self.expect("watchpoint set variable byteArray[1]", error=True,
- substrs=['Watchpoint creation failed'])
+ # Try setting a watchpoint at byteArray[1]
+ self.expect("watchpoint set variable byteArray[1]", error=True,
+ substrs=['Watchpoint creation failed'])
self.runCmd("process continue")
# We should be stopped due to the watchpoint.
# The stop reason of the thread should be watchpoint.
- if self.platformIsDarwin():
- # On darwin we'll hit byteArray[3] which is watchpoint 2
- self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT,
- substrs=['stopped', 'stop reason = watchpoint 2'])
- else:
- self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT,
- substrs=['stopped', 'stop reason = watchpoint 3'])
+ self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT,
+ substrs=['stopped', 'stop reason = watchpoint 3'])
# Resume inferior.
self.runCmd("process continue")
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
- @expectedFailureAll(oslist=["ios", "tvos", "bridgeos"], bugnumber="<rdar://problem/34027183>") # watchpoint tests aren't working on arm64
def test(self):
"""Test stepping over watchpoints."""
self.build()
void test1(int a) {
printf("test1(%d)\n", a);
- test2(a+1);//% self.runCmd("step")
+ test2(a+1);//% self.dbg.HandleCommand("step")
//% self.expect("expression b", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["24"])
}
"""Test thread-local storage."""
self.build()
exe = os.path.join(os.getcwd(), "a.out")
- target = self.dbg.CreateTarget(exe)
- if self.platformIsDarwin():
- self.registerSharedLibrariesWithTarget(target, ['liba.dylib'])
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
line1 = line_number('main.c', '// thread breakpoint')
lldbutil.run_break_set_by_file_and_line(
LEVEL = ../../../make
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
-
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
-
-CFLAGS ?= -g -O0
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
-
+CFLAGS = -g -O0
LDFLAGS = $(CFLAGS) -lobjc -framework Foundation
all: a.out libTest.dylib libTestExt.dylib
if self.getArchitecture() == 'i386':
self.skipTest("requires modern objc runtime")
self.build()
- self.shlib_names = ["libTestExt.dylib", "libTest.dylib"]
self.common_setup()
line = line_number('TestExt/TestExt.m', '// break here')
def common_setup(self):
exe = os.path.join(os.getcwd(), "a.out")
- target = self.dbg.CreateTarget(exe)
- self.registerSharedLibrariesWithTarget(target, self.shlib_names)
-
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
LEVEL = ../../../make
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
+myclass.o: myclass.h myclass.m
+ $(CC) myclass.m -c -o myclass.o
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+repro: myclass.o repro.m
+ $(CC) -g -O0 myclass.o repro.m -framework Foundation
-CFLAGS ?= -g -O0
-CFLAGS_NO_DEBUG =
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
- CFLAGS_NO_DEBUG += -arch $(ARCH)
-endif
-
-all: aout
-
-aout:
- $(CC) $(CFLAGS_NO_DEBUG) myclass.m -c -o myclass.o
- $(CC) $(CFLAGS) myclass.o repro.m -framework Foundation
-
-clean::
- rm -f myclass.o
+cleanup:
+ rm -r myclass.o
include $(LEVEL)/Makefile.rules
@no_debug_info_test
def test_imp_ivar_type(self):
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
- self.build()
+ execute_command("make repro")
+
+ def cleanup():
+ execute_command("make cleanup")
+ self.addTearDownHook(cleanup)
+
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
@skipUnlessDarwin
@add_test_categories(['pyapi'])
- @skipIf(debug_info=no_match(["gmodules"]), oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'arm64']) # this test program only builds for ios with -gmodules
def test_with_python_api(self):
"""Test passing structs to Objective-C methods."""
self.build()
#import <Foundation/Foundation.h>
-#include <TargetConditionals.h>
-
-#if TARGET_OS_IPHONE
-@import CoreGraphics;
-typedef CGRect NSRect;
-#endif
struct things_to_sum {
int a;
self.runCmd("run", RUN_SUCCEEDED)
# check that we correctly see the const char*, even with dynamic types
# on
- self.expect("frame variable -raw-output my_string", substrs=['const char *'])
+ self.expect("frame variable my_string", substrs=['const char *'])
self.expect(
- "frame variable my_string --raw-output --dynamic-type run-target",
+ "frame variable my_string --dynamic-type run-target",
substrs=['const char *'])
# check that expr also gets it right
- self.expect("e -R -- my_string", substrs=['const char *'])
- self.expect("expr -R -d run -- my_string", substrs=['const char *'])
+ self.expect("expr my_string", substrs=['const char *'])
+ self.expect("expr -d run -- my_string", substrs=['const char *'])
# but check that we get the real Foolie as such
self.expect("frame variable my_foolie", substrs=['FoolMeOnce *'])
self.expect(
import use_lldb_suite
import lldb
-windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, darwin_embedded, freebsd, netbsd, bsd_all, android = range(
- 14)
+windows, linux, macosx, darwin, ios, darwin_all, freebsd, netbsd, bsd_all, android = range(
+ 10)
__name_lookup = {
windows: ["windows"],
macosx: ["macosx"],
darwin: ["darwin"],
ios: ["ios"],
- tvos: ["tvos"],
- watchos: ["watchos"],
- bridgeos: ["bridgeos"],
- darwin_all: ["macosx", "darwin", "ios", "tvos", "watchos", "bridgeos"],
- darwin_embedded: ["ios", "tvos", "watchos", "bridgeos"],
+ darwin_all: ["macosx", "darwin", "ios"],
freebsd: ["freebsd"],
netbsd: ["netbsd"],
bsd_all: ["freebsd", "netbsd"],
if arch in ['x86_64', 'i386']:
test_case.expect("register read eax", substrs=['eax = 0x'])
- elif arch in ['arm', 'armv7', 'armv7k']:
+ elif arch in ['arm']:
test_case.expect("register read r0", substrs=['r0 = 0x'])
- elif arch in ['aarch64', 'arm64']:
+ elif arch in ['aarch64']:
test_case.expect("register read x0", substrs=['x0 = 0x'])
elif re.match("mips", arch):
test_case.expect("register read zero", substrs=['zero = 0x'])
# This function removes all files from the current working directory while leaving
# the directories in place. The cleaup is required to reduce the disk space required
- # by the test suite while leaving the directories untouched is neccessary because
+ # by the test suit while leaving the directories untached is neccessary because
# sub-directories might belong to an other test
def clean_working_directory():
# TODO: Make it working on Windows when we need it for remote debugging support
CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
-
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
-
-CFLAGS ?= -g -O0
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
all: clean
mkdir hide.app
mkdir hide.app/Contents
- $(CC) $(CFLAGS) -g main.c
+ $(CC) -g main.c
mv a.out.dSYM hide.app/Contents
strip -x a.out
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
- if self.platformIsDarwin():
- lib1 = os.path.join(os.getcwd(), 'libindirect.dylib')
- lib2 = os.path.join(os.getcwd(), 'libreexport.dylib')
- self.registerSharedLibrariesWithTarget(target, [lib1, lib2])
-
self.main_source_spec = lldb.SBFileSpec(self.main_source)
break1 = target.BreakpointCreateBySourceRegex(
import re
import sys
-from lldbsuite.test.decorators import *
+from lldbsuite.test import decorators
from lldbsuite.test import lldbtest
from lldbsuite.test import lldbtest_config
+@decorators.skipUnlessDarwin
class DarwinNSLogOutputTestCase(lldbtest.TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = lldbtest.TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @skipIfRemote # this test is currently written using lldb commands & assumes running on local system
-
def setUp(self):
# Call super's setUp().
super(DarwinNSLogOutputTestCase, self).setUp()
inferior_set_up = lldb.SBValue()
retry = 5
while retry > 0:
- arch = self.getArchitecture()
- # when running the testsuite against a remote arm device, it may take
- # a little longer for the process to start up. Use a "can't possibly take
- # longer than this" value.
- if arch == 'arm64' or arch == 'armv7':
- time.sleep(10)
- else:
- time.sleep(1)
+ time.sleep(1)
process.SendAsyncInterrupt()
self.assertTrue(self.wait_for_stop(process, listener), "Check that process is paused")
inferior_set_up = process.GetTarget().CreateValueFromExpression("threads_up_and_running", "threads_up_and_running")
@skipUnlessDarwin
@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in [
'i386', 'x86_64'], "requires i386 or x86_64")
- @skipIfDarwinEmbedded # this test file assumes we're targetting an x86 system
def test_sbdebugger_create_target_with_file_and_target_triple(self):
"""Test the SBDebugger.CreateTargetWithFileAndTargetTriple() API."""
# Invoke the default build rule.
@skipUnlessDarwin
@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in [
'i386', 'x86_64'], "requires i386 or x86_64")
- @skipIfDarwinEmbedded # this test file assumes we're targetting an x86 system
def test_process_launch_for_universal(self):
"""Test process launch of a universal binary."""
from lldbsuite.test.lldbutil import print_registers
@skipUnlessDarwin
@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in [
'i386', 'x86_64'], "requires i386 or x86_64")
- @skipIfDarwinEmbedded # this test file assumes we're targetting an x86 system
def test_process_attach_with_wrong_arch(self):
"""Test that when we attach to a binary from the wrong fork of a universal binary, we fix up the ABI correctly."""
# Now keep the architecture at 32 bit, but switch the binary we launch to
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
-ifeq (,$(filter $(OS), Windows_NT Android Darwin))
+ifeq (,$(filter $(OS), Windows_NT Android))
ifneq (,$(filter YES,$(ENABLE_THREADS)))
LDFLAGS += -pthread
endif
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
#include <vector>
int main (int argc, char const *argv[])
# Make sure on arm targets we dont mismatch PC value on the basis of thumb bit.
# Frame PC will not have thumb bit set in case of a thumb
# instruction as PC.
- if self.getArchitecture() in ['arm', 'armv7', 'armv7k']:
+ if self.getArchitecture() in ['arm']:
pc_value_int &= ~1
self.assertTrue(
pc_value_int == frame.GetPC(),
@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_id_api(self):
"""Create target, spawn a process, and attach to it with process id."""
self.build(dictionary=self.d)
@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_name_api(self):
"""Create target, spawn a process, and attach to it with process name."""
self.build(dictionary=self.d)
#include <stdio.h>
-#include <unistd.h>
+
int main(int argc, char const *argv[])
{
lldb_enable_attach();
// Waiting to be attached by the debugger, otherwise.
char line[100];
- while (1)
- sleep (1); // Waiting to be attached...
+ while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached...
+ printf("input line=>%s\n", line);
+ }
printf("Exiting now\n");
}
REGs = lldbutil.get_ESRs(frame)
if self.platformIsDarwin():
- if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
- num = len(REGs)
+ num = len(REGs)
+ if self.TraceOn():
+ print(
+ "\nNumber of exception state registers: %d" %
+ num)
+ for reg in REGs:
+ self.assertTrue(reg)
if self.TraceOn():
print(
- "\nNumber of exception state registers: %d" %
- num)
- for reg in REGs:
- self.assertTrue(reg)
- if self.TraceOn():
- print(
- "%s => %s" %
- (reg.GetName(), reg.GetValue()))
+ "%s => %s" %
+ (reg.GetName(), reg.GetValue()))
else:
self.assertIsNone(REGs)
REGs = lldbutil.get_registers(
frame, "Exception State Registers")
if self.platformIsDarwin():
- if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
- self.assertIsNotNone(REGs)
+ self.assertIsNotNone(REGs)
else:
self.assertIsNone(REGs)
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
- @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR."""
self.build()
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
- @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT."""
self.build()
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
- @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR without redirecting STDIN."""
self.build()
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
@interface ThisClassTestsThings : NSObject
@end
mydir = TestBase.compute_mydir(__file__)
- # hardware watchpoints are not reported with a hardware index # on armv7 on ios devices
- def affected_by_radar_34564183(self):
- return (self.getArchitecture() == 'armv7' or self.getArchitecture() == 'armv7k') and self.platformIsDarwin()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# meaningful hardware index at this point. Exercise the printed repr of
# SBWatchpointLocation.
print(watchpoint)
- if not self.affected_by_radar_34564183():
- self.assertTrue(watchpoint.GetHardwareIndex() != -1)
+ self.assertTrue(watchpoint.GetHardwareIndex() != -1)
# SBWatchpoint.GetDescription() takes a description level arg.
print(lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull))
self.expect("disassemble -n numberfn",
substrs=["5ah"])
- @skipIfDarwinEmbedded # <rdar://problem/34446098> debugserver on ios etc can't write files
def test_run_args_and_env_vars(self):
"""Test that run-args and env-vars are passed to the launched process."""
self.build()
"The host environment variable 'MY_HOST_ENV_VAR1' successfully passed.",
"The host environment variable 'MY_HOST_ENV_VAR2' successfully passed."])
- @skipIfDarwinEmbedded # <rdar://problem/34446098> debugserver on ios etc can't write files
def test_set_error_output_path(self):
"""Test that setting target.error/output-path for the launched process works."""
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- self.runCmd("process launch -- " + args_in)
+ self.runCmd("process launch -o stdout.txt -- " + args_in)
if lldb.remote_platform:
- src_file_spec = lldb.SBFileSpec('output.txt', False)
- dst_file_spec = lldb.SBFileSpec('output.txt', True)
+ src_file_spec = lldb.SBFileSpec('stdout.txt', False)
+ dst_file_spec = lldb.SBFileSpec('stdout.txt', True)
lldb.remote_platform.Get(src_file_spec, dst_file_spec)
- with open('output.txt', 'r') as f:
+ with open('stdout.txt', 'r') as f:
output = f.read()
- self.RemoveTempFile("output.txt")
+ self.RemoveTempFile("stdout.txt")
self.assertEqual(output, args_out)
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
/* This program writes its arguments (separated by '\0') to stdout. */
int
main(int argc, char const *argv[])
{
int i;
-
- FILE *output = fopen ("output.txt", "w");
- if (output == NULL)
- exit (1);
-
for (i = 1; i < argc; ++i)
- fwrite(argv[i], strlen(argv[i])+1, 1, output);
-
- fclose (output);
+ fwrite(argv[i], strlen(argv[i])+1, 1, stdout);
return 0;
}
mydir = TestBase.compute_mydir(__file__)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@expectedFailureAll(
# Test that lldb-mi is ready to execute next commands
self.expect(self.child_prompt, exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_abort(self):
self.expect("\^done")
self.expect("\*stopped,reason=\"exited-normally\"")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_arguments_set(self):
self.runCmd("-interpreter-exec command \"print argv[4]\"")
self.expect("\\\"fourth=\\\\\\\"4th arg\\\\\\\"\\\"", exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_arguments_reset(self):
self.runCmd("-data-evaluate-expression argc")
self.expect("\^done,value=\"1\"")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_next(self):
self.runCmd("-exec-next --frame 10")
#self.expect("\^error: Frame index 10 is out of range")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_next_instruction(self):
self.runCmd("-exec-next-instruction --frame 10")
#self.expect("\^error: Frame index 10 is out of range")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_step(self):
self.runCmd("-exec-step --frame 10")
#self.expect("\^error: Frame index 10 is out of range")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_step_instruction(self):
self.runCmd("-exec-step-instruction --frame 10")
#self.expect("\^error: Frame index 10 is out of range")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_exec_finish(self):
mydir = TestBase.compute_mydir(__file__)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_disassemble(self):
self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}",
"{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; symbol stub for: printf\"}"])
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_read_memory_bytes_global(self):
"\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"2021222300\"}\]" %
(addr, addr + size))
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_read_memory_bytes_local(self):
self.runCmd('-data-read-memory-bytes --thread 1 &array')
self.expect(r'\^error')
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_list_register_names(self):
self.runCmd("-data-list-register-names 0")
self.expect("\^done,register-names=\[\".+?\"\]")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_list_register_values(self):
self.expect(
"\^done,register-values=\[{number=\"0\",value=\"0x[0-9a-f]+\"}\]")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_info_line(self):
self.runCmd("-data-info-line main.cpp:0")
self.expect("\^error,msg=\"error: zero is an invalid line number")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_data_evaluate_expression(self):
"\*stopped,reason=\"exception-received\",exception=\"invalid address \(fault address: 0x0\)\",thread-id=\"1\",stopped-threads=\"all\""])
@skipUnlessDarwin
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stopped_when_segfault_remote(self):
"""Test that 'lldb-mi --interpreter' notifies after it was stopped when segfault occurred (remote)."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_list_arguments(self):
"""Test that 'lldb-mi --interpreter' can shows arguments."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_list_locals(self):
"""Test that 'lldb-mi --interpreter' can shows local variables."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_list_variables(self):
"""Test that 'lldb-mi --interpreter' can shows local variables and arguments."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_info_depth(self):
"""Test that 'lldb-mi --interpreter' can shows depth of the stack."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipUnlessDarwin
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_info_frame(self):
"""Test that 'lldb-mi --interpreter' can show information about current frame."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_list_frames(self):
"""Test that 'lldb-mi --interpreter' can lists the frames on the stack."""
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stack_select_frame(self):
"""Test that 'lldb-mi --interpreter' can choose current frame."""
mydir = TestBase.compute_mydir(__file__)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_executable_option_file(self):
# Test that lldb-mi is ready when executable was loaded
self.expect(self.child_prompt, exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_executable_option_absolute_path(self):
self.expect("\^running")
self.expect("\*stopped,reason=\"exited-normally\"")
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_executable_option_relative_path(self):
# Test that lldb-mi is ready when executable was loaded
self.expect(self.child_prompt, exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
self.expect("\^done,value=\"10\"")
self.expect(self.child_prompt, exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
# Test that lldb-mi is ready after execution of --source start_script
self.expect(self.child_prompt, exactly=True)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_log_option(self):
for f in logFile:
os.remove(f)
- @skipIfRemote # We do not currently support remote debugging via the MI.
@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_log_directory_option(self):
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def attach_with_vAttach(self):
# Start the inferior, start the debug monitor, nothing is attached yet.
procs = self.prep_debug_monitor_and_inferior(
AUXV_SUPPORT_FEATURE_NAME = "qXfer:auxv:read"
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def has_auxv_support(self):
inferior_args = ["message:main entered", "sleep:5"]
procs = self.prep_debug_monitor_and_inferior(
gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def gather_expedited_registers(self):
# Setup the stub and set the gdb remote command stream.
"qHostInfo is missing the following required "
"keys: " + str(missing_keys))
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_qHostInfo_returns_at_least_one_key_val_pair_debugserver(self):
self.init_debugserver_test()
self.build()
self.get_qHostInfo_response()
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@llgs_test
def test_qHostInfo_returns_at_least_one_key_val_pair_llgs(self):
self.init_llgs_test()
self.get_qHostInfo_response()
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_qHostInfo_contains_darwin_required_keys_debugserver(self):
self.init_debugserver_test()
self.validate_darwin_minimum_host_info_keys(host_info_dict)
@skipUnlessDarwin
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@llgs_test
def test_qHostInfo_contains_darwin_required_keys_llgs(self):
self.init_llgs_test()
class TestGdbRemoteKill(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def attach_commandline_kill_after_initial_stop(self):
procs = self.prep_debug_monitor_and_inferior()
self.assertTrue(lldbgdbserverutils.process_is_running(pid, True))
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qProcessInfo_returns_running_process_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertEqual(reported_pid, procs["inferior"].pid)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_attach_commandline_qProcessInfo_reports_correct_pid_debugserver(
self):
self.init_debugserver_test()
self.assertTrue(endian in ["little", "big", "pdp"])
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qProcessInfo_reports_valid_endian_debugserver(self):
self.init_debugserver_test()
self.build()
@skipUnlessDarwin
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qProcessInfo_contains_cputype_cpusubtype_debugserver_darwin(self):
self.init_debugserver_test()
self.build()
@skipUnlessDarwin
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qProcessInfo_does_not_contain_triple_debugserver_darwin(self):
self.init_debugserver_test()
self.build()
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def grp_register_save_restore_works(self, with_suffix):
# Start up the process, use thread suffix, grab main thread id.
inferior_args = ["message:main entered", "sleep:5"]
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_single_step_only_steps_one_instruction_with_s_debugserver(self):
self.init_debugserver_test()
context = self.expect_gdbremote_sequence()
self.assertIsNotNone(context)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_QListThreadsInStopReply_supported_debugserver(self):
self.init_debugserver_test()
self.ENABLE_THREADS_IN_STOP_REPLY_ENTRIES, thread_count)
self.assertEqual(len(stop_reply_threads), thread_count)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_stop_reply_reports_multiple_threads_debugserver(self):
self.init_debugserver_test()
stop_reply_threads = self.gather_stop_reply_threads(None, thread_count)
self.assertEqual(len(stop_reply_threads), 0)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_no_QListThreadsInStopReply_supplies_no_threads_debugserver(self):
self.init_debugserver_test()
for tid in threads:
self.assertTrue(tid in stop_reply_threads)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_stop_reply_reports_correct_threads_debugserver(self):
self.init_debugserver_test()
self.set_inferior_startup_launch()
self.stop_reply_contains_thread_pcs(5)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
@debugserver_test
def test_stop_reply_contains_thread_pcs_debugserver(self):
self.init_debugserver_test()
mydir = TestBase.compute_mydir(__file__)
THREAD_COUNT = 5
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
- @skipIfDarwinEmbedded # <rdar://problem/27005337>
def gather_stop_replies_via_qThreadStopInfo(self, thread_count):
# Set up the inferior args.
inferior_args = []
def vCont_supports_S(self):
self.vCont_supports_mode("S")
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_vCont_supports_c_debugserver(self):
self.init_debugserver_test()
self.build()
self.vCont_supports_c()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@llgs_test
def test_vCont_supports_c_llgs(self):
self.init_llgs_test()
self.build()
self.vCont_supports_c()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_vCont_supports_C_debugserver(self):
self.init_debugserver_test()
self.build()
self.vCont_supports_C()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@llgs_test
def test_vCont_supports_C_llgs(self):
self.init_llgs_test()
self.build()
self.vCont_supports_C()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_vCont_supports_s_debugserver(self):
self.init_debugserver_test()
self.build()
self.vCont_supports_s()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@llgs_test
def test_vCont_supports_s_llgs(self):
self.init_llgs_test()
self.build()
self.vCont_supports_s()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_vCont_supports_S_debugserver(self):
self.init_debugserver_test()
self.build()
self.vCont_supports_S()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@llgs_test
def test_vCont_supports_S_llgs(self):
self.init_llgs_test()
self.build()
self.vCont_supports_S()
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_debugserver(
self):
"aarch64"],
bugnumber="llvm.org/pr24739")
@skipIf(triple='^mips')
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_llgs(self):
self.init_llgs_test()
self.build()
self.single_step_only_steps_one_instruction(
use_Hc_packet=True, step_instruction="vCont;s")
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
@debugserver_test
def test_single_step_only_steps_one_instruction_with_vCont_s_thread_debugserver(
self):
"aarch64"],
bugnumber="llvm.org/pr24739")
@skipIf(triple='^mips')
- @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
def test_single_step_only_steps_one_instruction_with_vCont_s_thread_llgs(
self):
self.init_llgs_test()
mydir = TestBase.compute_mydir(__file__)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_exe_starts_debugserver(self):
self.init_debugserver_test()
server = self.connect_to_debug_monitor()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_start_no_ack_mode_debugserver(self):
self.init_debugserver_test()
self.start_no_ack_mode()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_thread_suffix_supported_debugserver(self):
self.init_debugserver_test()
self.thread_suffix_supported()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_list_threads_in_stop_reply_supported_debugserver(self):
self.init_debugserver_test()
self.list_threads_in_stop_reply_supported()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_c_packet_works_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertIsNotNone(context)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_inferior_print_exit_debugserver(self):
self.init_debugserver_test()
self.build()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_first_launch_stop_reply_thread_matches_first_qC_debugserver(self):
self.init_debugserver_test()
self.build()
procs["inferior"].pid, False))
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_attach_commandline_continue_app_exits_debugserver(self):
self.init_debugserver_test()
self.build()
@debugserver_test
@expectedFailureDarwin("llvm.org/pr25486")
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_returns_one_valid_result_debugserver(self):
self.init_debugserver_test()
self.build()
@debugserver_test
@expectedFailureDarwin("llvm.org/pr25486")
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_returns_all_valid_results_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertTrue('flags' in generic_regs)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_contains_required_generics_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertTrue(len(register_sets) >= 1)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_contains_at_least_one_register_set_debugserver(
self):
self.init_debugserver_test()
self.assertEqual(len(threads), 1)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qThreadInfo_contains_thread_launch_debugserver(self):
self.init_debugserver_test()
self.build()
self.qThreadInfo_contains_thread()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qThreadInfo_contains_thread_attach_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertEqual(threads[0], QC_thread_id)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qThreadInfo_matches_qC_launch_debugserver(self):
self.init_debugserver_test()
self.build()
self.qThreadInfo_matches_qC()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qThreadInfo_matches_qC_attach_debugserver(self):
self.init_debugserver_test()
self.build()
reg_index += 1
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_debugserver(
self):
self.init_debugserver_test()
self.p_returns_correct_data_size_for_each_qRegisterInfo()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_debugserver(
self):
self.init_debugserver_test()
self.assertEqual(int(context.get("thread_id"), 16), thread)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_Hg_switches_to_3_threads_launch_debugserver(self):
self.init_debugserver_test()
self.build()
self.Hg_switches_to_3_threads()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_Hg_switches_to_3_threads_attach_debugserver(self):
self.init_debugserver_test()
self.build()
@unittest2.expectedFailure()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_Hc_then_Csignal_signals_correct_thread_launch_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertEqual(read_contents, MEMORY_CONTENTS)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_m_packet_reads_memory_debugserver(self):
self.init_debugserver_test()
self.build()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qMemoryRegionInfo_is_supported_debugserver(self):
self.init_debugserver_test()
self.build()
self.assert_address_within_memory_region(code_address, mem_region_dict)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qMemoryRegionInfo_reports_code_address_as_executable_debugserver(
self):
self.init_debugserver_test()
stack_address, mem_region_dict)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qMemoryRegionInfo_reports_stack_address_as_readable_writeable_debugserver(
self):
self.init_debugserver_test()
self.assert_address_within_memory_region(heap_address, mem_region_dict)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qMemoryRegionInfo_reports_heap_address_as_readable_writeable_debugserver(
self):
self.init_debugserver_test()
self.assertIsNotNone(context)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_software_breakpoint_set_and_remove_work_debugserver(self):
self.init_debugserver_test()
if self.getArchitecture() == "arm":
@skipUnlessPlatform(oslist=['linux'])
@expectedFailureAndroid
@skipIf(archs=no_match(['arm', 'aarch64']))
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_hardware_breakpoint_set_and_remove_work_debugserver(self):
self.init_debugserver_test()
if self.getArchitecture() == "arm":
self.assertTrue(len(supported_dict) > 0)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qSupported_returns_known_stub_features_debugserver(self):
self.init_debugserver_test()
self.build()
self.assertEqual(printed_message, TEST_MESSAGE + "X")
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_written_M_content_reads_back_correctly_debugserver(self):
self.init_debugserver_test()
self.build()
# Come back to this. I have the test rigged to verify that at least some
# of the bit-flip writes work.
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_P_writes_all_gpr_registers_debugserver(self):
self.init_debugserver_test()
self.build()
# Note: as of this moment, a hefty number of the GPR writes are failing
# with E32 (everything except rax-rdx, rdi, rsi, rbp).
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_P_and_p_thread_suffix_work_debugserver(self):
self.init_debugserver_test()
self.build()
stub_socket.shutdown(socket.SHUT_RDWR)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_reverse_connect_works_debugserver(self):
self.init_debugserver_test(use_named_pipe=False)
self.set_inferior_startup_launch()
self.fail("failed to launch inferior: " + fail_reason)
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_start_inferior_debugserver(self):
self.init_debugserver_test()
self.build()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_inferior_exit_0_debugserver(self):
self.init_debugserver_test()
self.build()
self.expect_gdbremote_sequence()
@debugserver_test
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_inferior_exit_42_debugserver(self):
self.init_debugserver_test()
self.build()
class TestGdbRemoteAbort(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def inferior_abort_received(self):
procs = self.prep_debug_monitor_and_inferior(inferior_args=["abort"])
self.assertIsNotNone(procs)
GDB_REMOTE_STOP_CODE_BAD_ACCESS = 0x91
- @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def inferior_seg_fault_received(self, expected_signo):
procs = self.prep_debug_monitor_and_inferior(
inferior_args=["segfault"])
remote_path = lldbutil.append_to_process_working_directory(
"lldb-stdout-redirect.txt")
self.runCmd(
- 'process launch -- {remote}'.format(remote=remote_path))
+ 'process launch -o {remote}'.format(remote=remote_path))
# copy remote_path to local host
self.runCmd('platform get-file {remote} "{local}"'.format(
remote=remote_path, local=self.golden_filename))
int
main (int argc, char const *argv[])
{
- FILE *out = stdout;
-
- // By default, output to stdout
- // If a filename is provided as the command line argument,
- // output to that file.
- if (argc == 2 && argv[1] && argv[1][0] != '\0')
- {
- out = fopen (argv[1], "w");
- }
-
T a = T_VALUE_1;
T* a_ptr = &a;
T& a_ref = a;
a_union_zero_t a_union_zero_array_unbounded[] = {{ T_VALUE_1 }, { T_VALUE_2 }};
#ifdef T_PRINTF_FORMAT
- fprintf (out, "%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
- fprintf (out, "%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
- fprintf (out, "%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
-
- fprintf (out, "%s[2]: a_array_bounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[0]);
- fprintf (out, "%s[2]: a_array_bounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[1]);
-
- fprintf (out, "%s[]: a_array_unbounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[0]);
- fprintf (out, "%s[]: a_array_unbounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[1]);
-
- fprintf (out, "(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
- fprintf (out, "(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
- fprintf (out, "(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
- fprintf (out, "(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
- fprintf (out, "(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
- fprintf (out, "(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
-
- fprintf (out, "(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
- fprintf (out, "(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
- fprintf (out, "(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
- fprintf (out, "(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
- fprintf (out, "(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
- fprintf (out, "(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
+ printf ("%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
+ printf ("%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
+ printf ("%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
+
+ printf ("%s[2]: a_array_bounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[0]);
+ printf ("%s[2]: a_array_bounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[1]);
+
+ printf ("%s[]: a_array_unbounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[0]);
+ printf ("%s[]: a_array_unbounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[1]);
+
+ printf ("(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
+ printf ("(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
+ printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
+ printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
+ printf ("(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
+ printf ("(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
+
+ printf ("(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
+ printf ("(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
+ printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
+ printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
+ printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
+ printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
- fprintf (out, "(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
- fprintf (out, "(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
- fprintf (out, "(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
+ printf ("(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
+ printf ("(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
+ printf ("(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
- fprintf (out, "(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
- fprintf (out, "(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
- fprintf (out, "(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
+ printf ("(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
+ printf ("(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
+ printf ("(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
- fprintf (out, "(a_struct_t[2]) a_struct_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].a);
- fprintf (out, "(a_struct_t[2]) a_struct_array_bounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].b);
- fprintf (out, "(a_struct_t[2]) a_struct_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].a);
- fprintf (out, "(a_struct_t[2]) a_struct_array_bounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].b);
+ printf ("(a_struct_t[2]) a_struct_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].a);
+ printf ("(a_struct_t[2]) a_struct_array_bounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].b);
+ printf ("(a_struct_t[2]) a_struct_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].a);
+ printf ("(a_struct_t[2]) a_struct_array_bounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].b);
- fprintf (out, "(a_struct_t[]) a_struct_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].a);
- fprintf (out, "(a_struct_t[]) a_struct_array_unbounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].b);
- fprintf (out, "(a_struct_t[]) a_struct_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].a);
- fprintf (out, "(a_struct_t[]) a_struct_array_unbounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].b);
+ printf ("(a_struct_t[]) a_struct_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].a);
+ printf ("(a_struct_t[]) a_struct_array_unbounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].b);
+ printf ("(a_struct_t[]) a_struct_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].a);
+ printf ("(a_struct_t[]) a_struct_array_unbounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].b);
- fprintf (out, "(a_union_zero_t[2]) a_union_zero_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[0].a);
- fprintf (out, "(a_union_zero_t[2]) a_union_zero_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[1].a);
+ printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[0].a);
+ printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[1].a);
- fprintf (out, "(a_union_zero_t[]) a_union_zero_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[0].a);
- fprintf (out, "(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
+ printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[0].a);
+ printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
#endif
puts("About to exit, break here to check values..."); // Here is the line we will break on to check variables.
#ifdef TEST_BLOCK_CAPTURED_VARS
void (^myBlock)() = ^() {
- fprintf (out, "%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
- fprintf (out, "%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
- fprintf (out, "%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
-
- fprintf (out, "(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
- fprintf (out, "(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
- fprintf (out, "(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
- fprintf (out, "(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
- fprintf (out, "(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
- fprintf (out, "(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
+ printf ("%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
+ printf ("%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
+ printf ("%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
+
+ printf ("(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
+ printf ("(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
+ printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
+ printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
+ printf ("(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
+ printf ("(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
- fprintf (out, "(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
- fprintf (out, "(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
- fprintf (out, "(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
- fprintf (out, "(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
- fprintf (out, "(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
- fprintf (out, "(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
+ printf ("(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
+ printf ("(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
+ printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
+ printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
+ printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
+ printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
- fprintf (out, "(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
- fprintf (out, "(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
- fprintf (out, "(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
+ printf ("(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
+ printf ("(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
+ printf ("(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
- fprintf (out, "(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
- fprintf (out, "(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
- fprintf (out, "(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
+ printf ("(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
+ printf ("(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
+ printf ("(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
- fprintf (out, "That's All Folks!\n"); // Break here to test block captured variables.
+ printf ("That's All Folks!\n"); // Break here to test block captured variables.
};
myBlock();
#endif
-
- if (out != stdout)
- fclose (out);
-
return 0;
}