Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def affected_by_pr33042(self):
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(
Expand Down Expand Up @@ -142,33 +146,34 @@ def test_with_python(self):

#self.assertTrue(in_float == return_float)

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")
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")

@expectedFailureAll(oslist=["freebsd"], archs=["i386"])
@expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="<rdar://problem/28719652>")
Expand All @@ -181,6 +186,7 @@ def test_with_python(self):
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def test_step_over_with_python(self):
"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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def setUp(self):
@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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CreateAfterAttachTestCase(TestBase):
# 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))
Expand All @@ -33,6 +34,7 @@ def test_create_after_attach_with_popen(self):
@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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ThreadSpecificBreakTestCase(TestBase):

@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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase):
# 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class SigtrampUnwind(TestBase):
# 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ def test_multiple_watchpoints_on_same_word(self):
# The hit count should be 0 initially.
self.expect("watchpoint list -v 1", substrs=['hit_count = 0'])

# Try setting a watchpoint at byteArray[1]
self.expect("watchpoint set variable byteArray[1]", error=True,
substrs=['Watchpoint creation failed'])
# 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'])

self.runCmd("process continue")

Expand All @@ -90,8 +93,13 @@ def test_multiple_watchpoints_on_same_word(self):

# We should be stopped due to the watchpoint.
# The stop reason of the thread should be watchpoint.
self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT,
substrs=['stopped', 'stop reason = watchpoint 3'])
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'])

# Resume inferior.
self.runCmd("process continue")
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def getCategories(self):
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()
Expand Down
2 changes: 1 addition & 1 deletion lldb/packages/Python/lldbsuite/test/lang/c/inlines/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void test2(int b) {

void test1(int a) {
printf("test1(%d)\n", a);
test2(a+1);//% self.dbg.HandleCommand("step")
test2(a+1);//% self.runCmd("step")
//% self.expect("expression b", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["24"])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def test(self):
"""Test thread-local storage."""
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
if self.platformIsDarwin():
self.registerSharedLibrariesWithTarget(target, ['liba.dylib'])

line1 = line_number('main.c', '// thread breakpoint')
lldbutil.run_break_set_by_file_and_line(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
LEVEL = ../../../make

CFLAGS = -g -O0
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

LDFLAGS = $(CFLAGS) -lobjc -framework Foundation

all: a.out libTest.dylib libTestExt.dylib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_frame_var_after_stop_at_implementation(self):
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')
Expand All @@ -46,4 +47,7 @@ def test_frame_var_after_stop_at_implementation(self):

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)
28 changes: 22 additions & 6 deletions lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
LEVEL = ../../../make

myclass.o: myclass.h myclass.m
$(CC) myclass.m -c -o myclass.o
CC ?= clang
ifeq "$(ARCH)" ""
ARCH = x86_64
endif

repro: myclass.o repro.m
$(CC) -g -O0 myclass.o repro.m -framework Foundation
ifeq "$(OS)" ""
OS = $(shell uname -s)
endif

cleanup:
rm -r myclass.o
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

include $(LEVEL)/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class ObjCiVarIMPTestCase(TestBase):
@no_debug_info_test
def test_imp_ivar_type(self):
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
execute_command("make repro")

def cleanup():
execute_command("make cleanup")
self.addTearDownHook(cleanup)

self.build()
exe = os.path.join(os.getcwd(), "a.out")

# Create a target from the debugger.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def setUp(self):

@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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#import <Foundation/Foundation.h>
#include <TargetConditionals.h>

#if TARGET_OS_IPHONE
@import CoreGraphics;
typedef CGRect NSRect;
#endif

struct things_to_sum {
int a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def test_charstar_dyntype(self):
self.runCmd("run", RUN_SUCCEEDED)
# check that we correctly see the const char*, even with dynamic types
# on
self.expect("frame variable my_string", substrs=['const char *'])
self.expect("frame variable -raw-output my_string", substrs=['const char *'])
self.expect(
"frame variable my_string --dynamic-type run-target",
"frame variable my_string --raw-output --dynamic-type run-target",
substrs=['const char *'])
# check that expr also gets it right
self.expect("expr my_string", substrs=['const char *'])
self.expect("expr -d run -- my_string", substrs=['const char *'])
self.expect("e -R -- my_string", substrs=['const char *'])
self.expect("expr -R -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(
Expand Down
10 changes: 7 additions & 3 deletions lldb/packages/Python/lldbsuite/test/lldbplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
import use_lldb_suite
import lldb

windows, linux, macosx, darwin, ios, darwin_all, freebsd, netbsd, bsd_all, android = range(
10)
windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, darwin_embedded, freebsd, netbsd, bsd_all, android = range(
14)

__name_lookup = {
windows: ["windows"],
linux: ["linux"],
macosx: ["macosx"],
darwin: ["darwin"],
ios: ["ios"],
darwin_all: ["macosx", "darwin", "ios"],
tvos: ["tvos"],
watchos: ["watchos"],
bridgeos: ["bridgeos"],
darwin_all: ["macosx", "darwin", "ios", "tvos", "watchos", "bridgeos"],
darwin_embedded: ["ios", "tvos", "watchos", "bridgeos"],
freebsd: ["freebsd"],
netbsd: ["netbsd"],
bsd_all: ["freebsd", "netbsd"],
Expand Down
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def check_first_register_readable(test_case):

if arch in ['x86_64', 'i386']:
test_case.expect("register read eax", substrs=['eax = 0x'])
elif arch in ['arm']:
elif arch in ['arm', 'armv7', 'armv7k']:
test_case.expect("register read r0", substrs=['r0 = 0x'])
elif arch in ['aarch64']:
elif arch in ['aarch64', 'arm64']:
test_case.expect("register read x0", substrs=['x0 = 0x'])
elif re.match("mips", arch):
test_case.expect("register read zero", substrs=['zero = 0x'])
Expand Down
2 changes: 1 addition & 1 deletion lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def setPlatformWorkingDir(self):

# 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 suit while leaving the directories untached is neccessary because
# by the test suite while leaving the directories untouched 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
Expand Down
15 changes: 14 additions & 1 deletion lldb/packages/Python/lldbsuite/test/macosx/add-dsym/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
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) -g main.c
$(CC) $(CFLAGS) -g main.c
mv a.out.dSYM hide.app/Contents
strip -x a.out

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def test_with_python_api(self):
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@
import re
import sys

from lldbsuite.test import decorators
from lldbsuite.test.decorators import *
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ def wait_until_program_setup_complete(self, process, listener):
inferior_set_up = lldb.SBValue()
retry = 5
while retry > 0:
time.sleep(1)
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)
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def setUp(self):
@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.
Expand All @@ -47,6 +48,7 @@ def test_sbdebugger_create_target_with_file_and_target_triple(self):
@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
Expand Down Expand Up @@ -117,6 +119,7 @@ def test_process_launch_for_universal(self):
@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
Expand Down
2 changes: 1 addition & 1 deletion lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ CXXFLAGS += $(subst -fmodules,, $(CFLAGS))
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
ifeq (,$(filter $(OS), Windows_NT Android))
ifeq (,$(filter $(OS), Windows_NT Android Darwin))
ifneq (,$(filter YES,$(ENABLE_THREADS)))
LDFLAGS += -pthread
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#include <vector>

int main (int argc, char const *argv[])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_get_arg_vals_for_call_stack(self):
# 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']:
if self.getArchitecture() in ['arm', 'armv7', 'armv7k']:
pc_value_int &= ~1
self.assertTrue(
pc_value_int == frame.GetPC(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_with_process_launch_api(self):
@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)
Expand Down Expand Up @@ -108,6 +109,7 @@ def test_with_attach_to_process_with_id_api(self):
@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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <stdio.h>

#include <unistd.h>
int main(int argc, char const *argv[])
{
lldb_enable_attach();
Expand All @@ -10,9 +10,8 @@ int main(int argc, char const *argv[])

// Waiting to be attached by the debugger, otherwise.
char line[100];
while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached...
printf("input line=>%s\n", line);
}
while (1)
sleep (1); // Waiting to be attached...

printf("Exiting now\n");
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,18 @@ def test_iter_registers(self):

REGs = lldbutil.get_ESRs(frame)
if self.platformIsDarwin():
num = len(REGs)
if self.TraceOn():
print(
"\nNumber of exception state registers: %d" %
num)
for reg in REGs:
self.assertTrue(reg)
if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
num = len(REGs)
if self.TraceOn():
print(
"%s => %s" %
(reg.GetName(), reg.GetValue()))
"\nNumber of exception state registers: %d" %
num)
for reg in REGs:
self.assertTrue(reg)
if self.TraceOn():
print(
"%s => %s" %
(reg.GetName(), reg.GetValue()))
else:
self.assertIsNone(REGs)

Expand All @@ -99,7 +100,8 @@ def test_iter_registers(self):
REGs = lldbutil.get_registers(
frame, "Exception State Registers")
if self.platformIsDarwin():
self.assertIsNotNone(REGs)
if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
self.assertIsNotNone(REGs)
else:
self.assertIsNone(REGs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_stdin_redirection(self):
@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()
Expand All @@ -72,6 +73,7 @@ def test_stdout_redirection(self):
@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()
Expand All @@ -85,6 +87,7 @@ def test_stderr_redirection(self):
@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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>

@interface ThisClassTestsThings : NSObject
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class WatchpointIteratorTestCase(TestBase):

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)
Expand Down Expand Up @@ -99,7 +103,8 @@ def test_watch_iter(self):
# meaningful hardware index at this point. Exercise the printed repr of
# SBWatchpointLocation.
print(watchpoint)
self.assertTrue(watchpoint.GetHardwareIndex() != -1)
if not self.affected_by_radar_34564183():
self.assertTrue(watchpoint.GetHardwareIndex() != -1)

# SBWatchpoint.GetDescription() takes a description level arg.
print(lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull))
Expand Down
2 changes: 2 additions & 0 deletions lldb/packages/Python/lldbsuite/test/settings/TestSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def test_disassembler_settings(self):
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()
Expand Down Expand Up @@ -286,6 +287,7 @@ def unset_env_variables():
"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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ def do_test_args(self, args_in, args_out):
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)

self.runCmd("process launch -o stdout.txt -- " + args_in)
self.runCmd("process launch -- " + args_in)

if lldb.remote_platform:
src_file_spec = lldb.SBFileSpec('stdout.txt', False)
dst_file_spec = lldb.SBFileSpec('stdout.txt', True)
src_file_spec = lldb.SBFileSpec('output.txt', False)
dst_file_spec = lldb.SBFileSpec('output.txt', True)
lldb.remote_platform.Get(src_file_spec, dst_file_spec)

with open('stdout.txt', 'r') as f:
with open('output.txt', 'r') as f:
output = f.read()

self.RemoveTempFile("stdout.txt")
self.RemoveTempFile("output.txt")

self.assertEqual(output, args_out)
10 changes: 9 additions & 1 deletion lldb/packages/Python/lldbsuite/test/settings/quoting/main.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#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, stdout);
fwrite(argv[i], strlen(argv[i])+1, 1, output);

fclose (output);

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase):

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(
Expand All @@ -37,6 +38,7 @@ def test_lldbmi_exec_run(self):
# 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):
Expand Down Expand Up @@ -87,6 +89,7 @@ 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):
Expand Down Expand Up @@ -131,6 +134,7 @@ 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):
Expand Down Expand Up @@ -159,6 +163,7 @@ 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):
Expand Down Expand Up @@ -214,6 +219,7 @@ 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):
Expand Down Expand Up @@ -273,6 +279,7 @@ 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):
Expand Down Expand Up @@ -355,6 +362,7 @@ 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):
Expand Down Expand Up @@ -430,6 +438,7 @@ 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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):

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):
Expand Down Expand Up @@ -86,6 +87,7 @@ 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):
Expand Down Expand Up @@ -128,6 +130,7 @@ 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):
Expand Down Expand Up @@ -267,6 +270,7 @@ 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):
Expand All @@ -293,6 +297,7 @@ 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):
Expand Down Expand Up @@ -321,6 +326,7 @@ 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):
Expand Down Expand Up @@ -375,6 +381,7 @@ 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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def test_lldbmi_stopped_when_segfault_local(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)."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase):

@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."""

Expand Down Expand Up @@ -89,6 +90,7 @@ def test_lldbmi_stack_list_arguments(self):

@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."""

Expand Down Expand Up @@ -243,6 +245,7 @@ def test_lldbmi_stack_list_locals(self):

@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."""

Expand Down Expand Up @@ -389,6 +392,7 @@ def test_lldbmi_stack_list_variables(self):

@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."""

Expand Down Expand Up @@ -423,6 +427,7 @@ def test_lldbmi_stack_info_depth(self):
@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."""

Expand Down Expand Up @@ -465,6 +470,7 @@ def test_lldbmi_stack_info_frame(self):

@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."""

Expand All @@ -488,6 +494,7 @@ def test_lldbmi_stack_list_frames(self):

@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."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):

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):
Expand Down Expand Up @@ -59,6 +60,7 @@ def test_lldbmi_executable_option_unknown_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):
Expand All @@ -83,6 +85,7 @@ 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):
Expand Down Expand Up @@ -126,6 +129,7 @@ def test_lldbmi_executable_option_unknown_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
Expand Down Expand Up @@ -168,6 +172,7 @@ def test_lldbmi_source_option_start_script(self):
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
Expand Down Expand Up @@ -232,6 +237,7 @@ def test_lldbmi_source_option_start_script_error(self):
# 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):
Expand Down Expand Up @@ -264,6 +270,7 @@ 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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TestGdbRemoteAttach(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_with_vAttach(self):
# Start the inferior, start the debug monitor, nothing is attached yet.
procs = self.prep_debug_monitor_and_inferior(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):

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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TestGdbRemoteExpeditedRegisters(
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,22 @@ def validate_darwin_minimum_host_info_keys(self, host_info_dict):
"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.build()
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()
Expand All @@ -119,6 +122,7 @@ def test_qHostInfo_contains_darwin_required_keys_debugserver(self):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def qProcessInfo_returns_running_process(self):
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()
Expand Down Expand Up @@ -67,6 +68,7 @@ def attach_commandline_qProcessInfo_reports_correct_pid(self):
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()
Expand Down Expand Up @@ -99,6 +101,7 @@ def qProcessInfo_reports_valid_endian(self):
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()
Expand Down Expand Up @@ -159,6 +162,7 @@ def qProcessInfo_does_not_contain_keys(self, absent_key_set):

@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()
Expand All @@ -180,6 +184,7 @@ def test_qProcessInfo_contains_triple_llgs_linux(self):

@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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):

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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TestGdbRemoteSingleStep(gdbremote_testcase.GdbRemoteTestCaseBase):

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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def QListThreadsInStopReply_supported(self):
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()
Expand All @@ -196,6 +197,7 @@ def stop_reply_reports_multiple_threads(self, thread_count):
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()
Expand All @@ -216,6 +218,7 @@ def no_QListThreadsInStopReply_supplies_no_threads(self, thread_count):
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()
Expand Down Expand Up @@ -252,6 +255,7 @@ def stop_reply_reports_correct_threads(self, thread_count):
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()
Expand Down Expand Up @@ -290,6 +294,7 @@ def test_stop_reply_contains_thread_pcs_llgs(self):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class TestGdbRemote_qThreadStopInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
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 = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,54 +39,63 @@ def vCont_supports_s(self):
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):
Expand All @@ -109,13 +118,15 @@ def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_debugserver(
"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.set_inferior_startup_launch()
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):
Expand All @@ -138,6 +149,7 @@ def test_single_step_only_steps_one_instruction_with_vCont_s_thread_debugserver(
"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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcod
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()
Expand All @@ -46,6 +47,7 @@ def start_no_ack_mode(self):
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()
Expand All @@ -68,6 +70,7 @@ def thread_suffix_supported(self):
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()
Expand All @@ -89,6 +92,7 @@ def list_threads_in_stop_reply_supported(self):
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()
Expand All @@ -114,6 +118,7 @@ def c_packet_works(self):
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()
Expand Down Expand Up @@ -146,6 +151,7 @@ def inferior_print_exit(self):
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()
Expand Down Expand Up @@ -181,6 +187,7 @@ def first_launch_stop_reply_thread_matches_first_qC(self):
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()
Expand Down Expand Up @@ -216,6 +223,7 @@ def attach_commandline_continue_app_exits(self):
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()
Expand Down Expand Up @@ -254,6 +262,7 @@ def qRegisterInfo_returns_one_valid_result(self):

@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()
Expand Down Expand Up @@ -286,6 +295,7 @@ def qRegisterInfo_returns_all_valid_results(self):

@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()
Expand Down Expand Up @@ -332,6 +342,7 @@ def qRegisterInfo_contains_required_generics(self):
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()
Expand Down Expand Up @@ -367,6 +378,7 @@ def qRegisterInfo_contains_at_least_one_register_set(self):
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()
Expand Down Expand Up @@ -446,6 +458,7 @@ def qThreadInfo_contains_thread(self):
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()
Expand All @@ -460,6 +473,7 @@ def test_qThreadInfo_contains_thread_launch_llgs(self):
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()
Expand Down Expand Up @@ -502,6 +516,7 @@ def qThreadInfo_matches_qC(self):
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()
Expand All @@ -516,6 +531,7 @@ def test_qThreadInfo_matches_qC_launch_llgs(self):
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()
Expand Down Expand Up @@ -579,6 +595,7 @@ def p_returns_correct_data_size_for_each_qRegisterInfo(self):
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()
Expand All @@ -595,6 +612,7 @@ def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
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()
Expand Down Expand Up @@ -643,6 +661,7 @@ def Hg_switches_to_3_threads(self):
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()
Expand All @@ -657,6 +676,7 @@ def test_Hg_switches_to_3_threads_launch_llgs(self):
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()
Expand Down Expand Up @@ -783,6 +803,7 @@ def Hc_then_Csignal_signals_correct_thread(self, segfault_signo):

@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()
Expand Down Expand Up @@ -852,6 +873,7 @@ def m_packet_reads_memory(self):
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()
Expand All @@ -877,6 +899,7 @@ def qMemoryRegionInfo_is_supported(self):
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()
Expand Down Expand Up @@ -939,6 +962,7 @@ def qMemoryRegionInfo_reports_code_address_as_executable(self):
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()
Expand Down Expand Up @@ -1003,6 +1027,7 @@ def qMemoryRegionInfo_reports_stack_address_as_readable_writeable(self):
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()
Expand Down Expand Up @@ -1067,6 +1092,7 @@ def qMemoryRegionInfo_reports_heap_address_as_readable_writeable(self):
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()
Expand Down Expand Up @@ -1215,6 +1241,7 @@ def breakpoint_set_and_remove_work(self, want_hardware=False):
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":
Expand All @@ -1241,6 +1268,7 @@ def test_software_breakpoint_set_and_remove_work_llgs(self):
@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":
Expand Down Expand Up @@ -1280,6 +1308,7 @@ def qSupported_returns_known_stub_features(self):
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()
Expand Down Expand Up @@ -1353,6 +1382,7 @@ def written_M_content_reads_back_correctly(self):
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()
Expand Down Expand Up @@ -1402,6 +1432,7 @@ def P_writes_all_gpr_registers(self):
# 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()
Expand Down Expand Up @@ -1526,6 +1557,7 @@ def P_and_p_thread_suffix_work(self):
# 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def reverse_connect_works(self):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def start_inferior(self):
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()
Expand Down Expand Up @@ -80,6 +81,7 @@ def inferior_exit_0(self):
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()
Expand Down Expand Up @@ -112,6 +114,7 @@ def inferior_exit_42(self):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TestGdbRemoteSegFault(gdbremote_testcase.GdbRemoteTestCaseBase):

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"])
Expand Down
2 changes: 1 addition & 1 deletion lldb/packages/Python/lldbsuite/test/types/AbstractBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def process_launch_o(self, localPath):
remote_path = lldbutil.append_to_process_working_directory(
"lldb-stdout-redirect.txt")
self.runCmd(
'process launch -o {remote}'.format(remote=remote_path))
'process launch -- {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))
Expand Down
142 changes: 78 additions & 64 deletions lldb/packages/Python/lldbsuite/test/types/basic_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ typedef struct a_union_nonzero_tag {
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;
Expand Down Expand Up @@ -123,89 +133,93 @@ main (int argc, char const *argv[])
a_union_zero_t a_union_zero_array_unbounded[] = {{ T_VALUE_1 }, { T_VALUE_2 }};

#ifdef T_PRINTF_FORMAT
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, "%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 ("(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_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_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_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_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[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[]) 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_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_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[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[]) 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);
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);

#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)() = ^() {
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, "%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 ("(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_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_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_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_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_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 ("That's All Folks!\n"); // Break here to test block captured variables.
fprintf (out, "That's All Folks!\n"); // Break here to test block captured variables.
};

myBlock();
#endif

if (out != stdout)
fclose (out);

return 0;
}