aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
commitf3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch)
tree48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages
parent2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff)
downloadsrc-f3fbd1c0586ff6ec7895991e6c28f61a503c36a8.tar.gz
src-f3fbd1c0586ff6ec7895991e6c28f61a503c36a8.zip
Vendor import of lldb release_39 branch r276489:vendor/lldb/lldb-release_39-r276489
Notes
Notes: svn path=/vendor/lldb/dist/; revision=303241 svn path=/vendor/lldb/lldb-release_39-r276489/; revision=303242; tag=vendor/lldb/lldb-release_39-r276489
Diffstat (limited to 'packages')
-rw-r--r--packages/Python/lldbsuite/support/encoded_file.py48
-rw-r--r--packages/Python/lldbsuite/support/funcutils.py16
-rw-r--r--packages/Python/lldbsuite/support/gmodules.py30
-rw-r--r--packages/Python/lldbsuite/support/optional_with.py (renamed from packages/Python/lldbsuite/test/test_runner/lib/lldb_utils.py)26
-rw-r--r--packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py3
-rw-r--r--packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py3
-rw-r--r--packages/Python/lldbsuite/test/api/listeners/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/api/listeners/TestListener.py55
-rw-r--r--packages/Python/lldbsuite/test/api/listeners/main.c7
-rw-r--r--packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py14
-rw-r--r--packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py6
-rw-r--r--packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp46
-rw-r--r--packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py2
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py4
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py8
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py3
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py9
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py7
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py7
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py3
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py4
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py4
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py3
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py5
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py7
-rw-r--r--packages/Python/lldbsuite/test/configuration.py9
-rw-r--r--packages/Python/lldbsuite/test/decorators.py524
-rw-r--r--packages/Python/lldbsuite/test/dosep.py61
-rw-r--r--packages/Python/lldbsuite/test/dotest.py174
-rw-r--r--packages/Python/lldbsuite/test/dotest_args.py2
-rw-r--r--packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py8
-rw-r--r--packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py42
-rw-r--r--packages/Python/lldbsuite/test/expression_command/anonymous-struct/main.cpp26
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py9
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py17
-rw-r--r--packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/fixits/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py81
-rw-r--r--packages/Python/lldbsuite/test/expression_command/fixits/main.cpp25
-rw-r--r--packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py8
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py40
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/main.cpp17
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py72
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c7
-rw-r--r--packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py10
-rw-r--r--packages/Python/lldbsuite/test/expression_command/multiline/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py57
-rw-r--r--packages/Python/lldbsuite/test/expression_command/multiline/main.c6
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/test/TestExprs.py16
-rw-r--r--packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py10
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py89
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp7
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/main.cpp9
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/test.cpp107
-rw-r--r--packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/unwind_expression/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py83
-rw-r--r--packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/apropos_with_process/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py44
-rw-r--r--packages/Python/lldbsuite/test/functionalities/apropos_with_process/main.cpp15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py33
-rw-r--r--packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py22
-rw-r--r--packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py77
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py121
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py43
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/main.cpp25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py59
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile (renamed from packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py101
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp (renamed from packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/main.cpp)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py39
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py100
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.c16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.h1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/main.c17
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_alias/.categories1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_alias/TestCommandScriptAlias.py37
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_alias/tcsacmd.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py86
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py17
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py69
-rw-r--r--packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py71
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m86
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py17
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py84
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py113
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py52
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp26
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py89
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py46
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp20
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py56
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp29
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py36
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py70
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp29
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py60
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm30
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py31
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py61
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/TestExec.py38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/format/TestFormats.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py36
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py23
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py13
-rw-r--r--packages/Python/lldbsuite/test/functionalities/llvm/TestLLVM.py60
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/cache/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py64
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/cache/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py48
-rw-r--r--packages/Python/lldbsuite/test/functionalities/nested_alias/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py68
-rw-r--r--packages/Python/lldbsuite/test/functionalities/nested_alias/main.cpp22
-rw-r--r--packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py164
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/altmain.c6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/altmain.corebin0 -> 40960 bytes
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/postmortem/linux-core/altmain.outbin0 -> 2330 bytes
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/i386.corebin0 -> 28672 bytes
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/postmortem/linux-core/i386.outbin0 -> 1971 bytes
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/main.c17
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.corebin0 -> 16384 bytes
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.outbin0 -> 2824 bytes
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/x86_64.corebin0 -> 40960 bytes
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/postmortem/linux-core/x86_64.outbin0 -> 2575 bytes
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/wow64_minidump/TestWow64MiniDump.py76
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/wow64_minidump/fizzbuzz.cpp31
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/wow64_minidump/fizzbuzz_wow64.dmpbin0 -> 9280561 bytes
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py48
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ptr_refs/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py43
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ptr_refs/main.c27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py17
-rw-r--r--packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py34
-rw-r--r--packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py64
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py13
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py134
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py21
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py68
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/basic/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py118
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/basic/main.c37
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py54
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/main.cpp38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/global_location/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py54
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/global_location/main.c38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/multiple/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py69
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/multiple/main.m138
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/main.c24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py68
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/main.c58
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/ehframe/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py51
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c20
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py13
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py13
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py60
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/watchpoint_command.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/main.c2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/Makefile (renamed from packages/Python/lldbsuite/test/lang/c/inlines/Makefile)2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py117
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c66
-rw-r--r--packages/Python/lldbsuite/test/help/TestApropos.py22
-rw-r--r--packages/Python/lldbsuite/test/help/TestHelp.py50
-rw-r--r--packages/Python/lldbsuite/test/issue_verification/TestInvalidDecorator.py.park13
-rw-r--r--packages/Python/lldbsuite/test/issue_verification/TestRerunTimeout.py.park8
-rw-r--r--packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py20
-rw-r--r--packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py12
-rw-r--r--packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py21
-rw-r--r--packages/Python/lldbsuite/test/lang/c/bitfields/main.c14
-rw-r--r--packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py18
-rw-r--r--packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py17
-rw-r--r--packages/Python/lldbsuite/test/lang/c/enum_types/main.c11
-rw-r--r--packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/c/inlines/TestRedefinitionsInInlines.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/inlines/main.c19
-rw-r--r--packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py17
-rw-r--r--packages/Python/lldbsuite/test/lang/c/register_variables/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py150
-rw-r--r--packages/Python/lldbsuite/test/lang/c/register_variables/test.c12
-rw-r--r--packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/c/step-target/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py113
-rw-r--r--packages/Python/lldbsuite/test/lang/c/step-target/main.c40
-rw-r--r--packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py16
-rw-r--r--packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/struct_types/TestStructTypes.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/tls_globals/a.c6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/tls_globals/main.c14
-rw-r--r--packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unions/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py46
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unions/main.c18
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py17
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py18
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp23
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/extern_c/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/extern_c/TestExternCSymbols.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/extern_c/main.cpp29
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py50
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h12
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/inlines/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py52
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/inlines/inlines.cpp (renamed from packages/Python/lldbsuite/test/lang/c/inlines/inlines.c)2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/inlines/inlines.h (renamed from packages/Python/lldbsuite/test/lang/c/inlines/inlines.h)0
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/lambdas/TestLambdas.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp17
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py197
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/main.cpp73
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py74
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py17
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile19
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py57
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.cpp16
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk9
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.cpp12
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk9
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/foo.h18
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/main.cpp16
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp21
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/template/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py87
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/template/main.cpp72
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py11
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unicode-literals/Makefile (renamed from packages/Python/lldbsuite/test/lang/cpp/rdar12991846/Makefile)0
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py (renamed from packages/Python/lldbsuite/test/lang/cpp/rdar12991846/TestRdar12991846.py)15
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unicode-literals/main.cpp (renamed from packages/Python/lldbsuite/test/lang/cpp/rdar12991846/main.cpp)0
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py22
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual/main.cpp25
-rw-r--r--packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime2
-rw-r--r--packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/main.m52
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py15
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py9
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-protocols/TestIvarProtocols.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py17
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-property/main.m13
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-runtime-ivars/TestRuntimeIvars.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py8
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py68
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/main.m7
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/variadic_methods/TestVariadicMethods.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/variadic_methods/main.m31
-rw-r--r--packages/Python/lldbsuite/test/lang/objcxx/objcxx-ivar-vector/TestIvarVector.py6
-rw-r--r--packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py4
-rw-r--r--packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py4
-rw-r--r--packages/Python/lldbsuite/test/lldbinline.py35
-rw-r--r--packages/Python/lldbsuite/test/lldbpexpect.py96
-rw-r--r--packages/Python/lldbsuite/test/lldbplatform.py44
-rw-r--r--packages/Python/lldbsuite/test/lldbplatformutil.py125
-rw-r--r--packages/Python/lldbsuite/test/lldbtest.py1064
-rw-r--r--packages/Python/lldbsuite/test/lldbutil.py47
-rw-r--r--packages/Python/lldbsuite/test/logging/TestLogging.py8
-rw-r--r--packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py2
-rw-r--r--packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py2
-rw-r--r--packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py3
-rw-r--r--packages/Python/lldbsuite/test/macosx/nslog/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py148
-rw-r--r--packages/Python/lldbsuite/test/macosx/nslog/main.m18
-rw-r--r--packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py2
-rw-r--r--packages/Python/lldbsuite/test/macosx/queues/TestQueues.py3
-rw-r--r--packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py3
-rw-r--r--packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py53
-rw-r--r--packages/Python/lldbsuite/test/macosx/universal/main.c14
-rw-r--r--packages/Python/lldbsuite/test/make/Makefile.rules37
-rw-r--r--packages/Python/lldbsuite/test/make/test_common.h42
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_base.py42
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_darwin.py4
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_linux.py (renamed from packages/Python/lldbsuite/test/plugins/builder_linux2.py)0
-rw-r--r--packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py4
-rw-r--r--packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py5
-rw-r--r--packages/Python/lldbsuite/test/python_api/event/TestEvents.py19
-rw-r--r--packages/Python/lldbsuite/test/python_api/exprpath_synthetic/TestExprPathSynthetic.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/TestFrames.py15
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/get-variables/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py190
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/get-variables/main.c29
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py8
-rw-r--r--packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py23
-rw-r--r--packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py4
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py20
-rw-r--r--packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py8
-rw-r--r--packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py19
-rw-r--r--packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py5
-rw-r--r--packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py5
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py9
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py36
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/decls.h11
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/file1.cpp13
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/file2.cpp6
-rw-r--r--packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py5
-rw-r--r--packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py8
-rw-r--r--packages/Python/lldbsuite/test/python_api/type/TestTypeList.py7
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py20
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py5
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/main.c4
-rw-r--r--packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py11
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py4
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py9
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py6
-rw-r--r--packages/Python/lldbsuite/test/settings/TestSettings.py12
-rw-r--r--packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py19
-rw-r--r--packages/Python/lldbsuite/test/source-manager/TestSourceManager.py38
-rw-r--r--packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py4
-rw-r--r--packages/Python/lldbsuite/test/test_categories.py22
-rw-r--r--packages/Python/lldbsuite/test/test_result.py45
-rw-r--r--packages/Python/lldbsuite/test/test_runner/__init__.py0
-rw-r--r--packages/Python/lldbsuite/test/test_runner/process_control.py (renamed from packages/Python/lldbsuite/test/test_runner/lib/process_control.py)0
-rw-r--r--packages/Python/lldbsuite/test/test_runner/test/__init__.py0
-rwxr-xr-xpackages/Python/lldbsuite/test/test_runner/test/test_process_control.py (renamed from packages/Python/lldbsuite/test/test_runner/test/process_control_tests.py)13
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py10
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py20
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiPrompt.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py49
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py14
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py6
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py15
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp15
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/TestMiThreadInfo.py39
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/test_threadinfo.cpp21
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py6
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py6
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py12
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAttach.py3
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteKill.py3
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py7
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteRegisterState.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py5
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py10
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py25
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py4
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py155
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py14
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py28
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py60
-rw-r--r--packages/Python/lldbsuite/test/types/TestFloatTypes.py5
-rw-r--r--packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py6
-rw-r--r--packages/Python/lldbsuite/test/types/TestIntegerTypes.py7
-rw-r--r--packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py6
-rw-r--r--packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py2
-rw-r--r--packages/Python/lldbsuite/test_event/__init__.py0
-rw-r--r--packages/Python/lldbsuite/test_event/build_exception.py14
-rw-r--r--packages/Python/lldbsuite/test_event/dotest_channels.py (renamed from packages/Python/lldbsuite/test/dotest_channels.py)7
-rw-r--r--packages/Python/lldbsuite/test_event/event_builder.py475
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/__init__.py162
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/curses.py (renamed from packages/Python/lldbsuite/test/curses_results.py)35
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/dump_formatter.py23
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/pickled.py72
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/results_formatter.py (renamed from packages/Python/lldbsuite/test/result_formatter.py)619
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/xunit.py (renamed from packages/Python/lldbsuite/test/xunit_formatter.py)67
-rw-r--r--packages/Python/lldbsuite/test_event/test/resources/invalid_decorator/TestInvalidDecorator.py13
-rw-r--r--packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py70
-rw-r--r--packages/Python/lldbsuite/test_event/test/src/event_collector.py85
642 files changed, 10880 insertions, 3676 deletions
diff --git a/packages/Python/lldbsuite/support/encoded_file.py b/packages/Python/lldbsuite/support/encoded_file.py
new file mode 100644
index 000000000000..7581564f7e3a
--- /dev/null
+++ b/packages/Python/lldbsuite/support/encoded_file.py
@@ -0,0 +1,48 @@
+"""
+ The LLVM Compiler Infrastructure
+
+This file is distributed under the University of Illinois Open Source
+License. See LICENSE.TXT for details.
+
+Prepares language bindings for LLDB build process. Run with --help
+to see a description of the supported command line arguments.
+"""
+
+# Python modules:
+import io
+
+# Third party modules
+import six
+
+def _encoded_read(old_read, encoding):
+ def impl(size):
+ result = old_read(size)
+ # If this is Python 2 then we need to convert the resulting `unicode` back
+ # into a `str` before returning
+ if six.PY2:
+ result = result.encode(encoding)
+ return result
+ return impl
+
+def _encoded_write(old_write, encoding):
+ def impl(s):
+ # If we were asked to write a `str` (in Py2) or a `bytes` (in Py3) decode it
+ # as unicode before attempting to write.
+ if isinstance(s, six.binary_type):
+ s = s.decode(encoding)
+ return old_write(s)
+ return impl
+
+'''
+Create a Text I/O file object that can be written to with either unicode strings or byte strings
+under Python 2 and Python 3, and automatically encodes and decodes as necessary to return the
+native string type for the current Python version
+'''
+def open(file, encoding, mode='r', buffering=-1, errors=None, newline=None, closefd=True):
+ wrapped_file = io.open(file, mode=mode, buffering=buffering, encoding=encoding,
+ errors=errors, newline=newline, closefd=closefd)
+ new_read = _encoded_read(getattr(wrapped_file, 'read'), encoding)
+ new_write = _encoded_write(getattr(wrapped_file, 'write'), encoding)
+ setattr(wrapped_file, 'read', new_read)
+ setattr(wrapped_file, 'write', new_write)
+ return wrapped_file
diff --git a/packages/Python/lldbsuite/support/funcutils.py b/packages/Python/lldbsuite/support/funcutils.py
new file mode 100644
index 000000000000..53dd1fb370ba
--- /dev/null
+++ b/packages/Python/lldbsuite/support/funcutils.py
@@ -0,0 +1,16 @@
+from __future__ import print_function
+from __future__ import absolute_import
+
+# System modules
+import inspect
+
+# Third-party modules
+
+# LLDB modules
+
+def requires_self(func):
+ func_argc = len(inspect.getargspec(func).args)
+ if func_argc == 0 or (getattr(func,'im_self', None) is not None) or (hasattr(func, '__self__')):
+ return False
+ else:
+ return True
diff --git a/packages/Python/lldbsuite/support/gmodules.py b/packages/Python/lldbsuite/support/gmodules.py
new file mode 100644
index 000000000000..4f2fd9643b14
--- /dev/null
+++ b/packages/Python/lldbsuite/support/gmodules.py
@@ -0,0 +1,30 @@
+from __future__ import absolute_import
+from __future__ import print_function
+
+# System modules
+import os
+import re
+
+
+GMODULES_SUPPORT_MAP = {}
+GMODULES_HELP_REGEX = re.compile(r"\s-gmodules\s")
+
+
+def is_compiler_clang_with_gmodules(compiler_path):
+ # Before computing the result, check if we already have it cached.
+ if compiler_path in GMODULES_SUPPORT_MAP:
+ return GMODULES_SUPPORT_MAP[compiler_path]
+
+ def _gmodules_supported_internal():
+ compiler = os.path.basename(compiler_path)
+ if "clang" not in compiler:
+ return False
+ else:
+ # Check the compiler help for the -gmodules option.
+ clang_help = os.popen("%s --help" % compiler_path).read()
+ return GMODULES_HELP_REGEX.search(clang_help, re.DOTALL) is not None
+
+ GMODULES_SUPPORT_MAP[compiler_path] = _gmodules_supported_internal()
+ return GMODULES_SUPPORT_MAP[compiler_path]
+
+
diff --git a/packages/Python/lldbsuite/test/test_runner/lib/lldb_utils.py b/packages/Python/lldbsuite/support/optional_with.py
index e469bbf12207..41342288bc6a 100644
--- a/packages/Python/lldbsuite/test/test_runner/lib/lldb_utils.py
+++ b/packages/Python/lldbsuite/support/optional_with.py
@@ -1,18 +1,8 @@
-"""
-The LLVM Compiler Infrastructure
+# ====================================================================
+# Provides a with-style resource handler for optionally-None resources
+# ====================================================================
-This file is distributed under the University of Illinois Open Source
-License. See LICENSE.TXT for details.
-
-Provides classes used by the test results reporting infrastructure
-within the LLDB test suite.
-
-
-This module contains utilities used by the lldb test framwork.
-"""
-
-
-class OptionalWith(object):
+class optional_with(object):
# pylint: disable=too-few-public-methods
# This is a wrapper - it is not meant to provide any extra methods.
"""Provides a wrapper for objects supporting "with", allowing None.
@@ -22,13 +12,13 @@ class OptionalWith(object):
e.g.
- wrapped_lock = OptionalWith(thread.Lock())
+ wrapped_lock = optional_with(thread.Lock())
with wrapped_lock:
# Do something while the lock is obtained.
pass
might_be_none = None
- wrapped_none = OptionalWith(might_be_none)
+ wrapped_none = optional_with(might_be_none)
with wrapped_none:
# This code here still works.
pass
@@ -40,13 +30,13 @@ class OptionalWith(object):
lock.acquire()
try:
- code_fragament_always_run()
+ code_fragment_always_run()
finally:
if lock:
lock.release()
And I'd posit it is safer, as it becomes impossible to
- forget the try/finally using OptionalWith(), since
+ forget the try/finally using optional_with(), since
the with syntax can be used.
"""
def __init__(self, wrapped_object):
diff --git a/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py b/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
index b925afe1b70c..2b6ac1818de7 100644
--- a/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ b/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DefaultCacheLineSizeTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py b/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
index 0d0507f1d70c..0ed2df3ceab1 100644
--- a/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
+++ b/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, re
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class SBDirCheckerCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/api/listeners/Makefile b/packages/Python/lldbsuite/test/api/listeners/Makefile
new file mode 100644
index 000000000000..fbedeab4cb9b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/api/listeners/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
+
diff --git a/packages/Python/lldbsuite/test/api/listeners/TestListener.py b/packages/Python/lldbsuite/test/api/listeners/TestListener.py
new file mode 100644
index 000000000000..bd8c204e78cb
--- /dev/null
+++ b/packages/Python/lldbsuite/test/api/listeners/TestListener.py
@@ -0,0 +1,55 @@
+"""
+Test that we can listen to modules loaded events.
+"""
+
+from __future__ import print_function
+
+import copy
+import os
+import time
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+import six
+
+class ListenToModuleLoadedEvents (TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ self.build()
+
+ def test_receiving_breakpoint_added (self):
+ """Test that we get breakpoint added events, waiting on event classes on the debugger"""
+
+ my_listener = lldb.SBListener("test_listener")
+
+ my_listener.StartListeningForEventClass(self.dbg, lldb.SBTarget.GetBroadcasterClassName(), lldb.SBTarget.eBroadcastBitBreakpointChanged)
+
+ exe = os.path.join (os.getcwd(), "a.out")
+
+ target = self.dbg.CreateTarget(exe)
+
+ bkpt = target.BreakpointCreateByName("main")
+
+ event = lldb.SBEvent()
+ my_listener.WaitForEvent(1, event)
+
+ self.assertTrue(event.IsValid(), "Got a valid event.")
+ self.assertTrue(lldb.SBBreakpoint.EventIsBreakpointEvent(event), "It is a breakpoint event.")
+ self.assertTrue(lldb.SBBreakpoint.GetBreakpointEventTypeFromEvent(event) == lldb.eBreakpointEventTypeAdded, "It is a breakpoint added event.")
+ self.assertTrue(bkpt == lldb.SBBreakpoint.GetBreakpointFromEvent(event), "It is our breakpoint.")
+
+ # Now make sure if we stop listening for events we don't get them:
+
+ my_listener.StopListeningForEventClass(self.dbg, lldb.SBTarget.GetBroadcasterClassName(), lldb.SBTarget.eBroadcastBitBreakpointChanged)
+ my_listener.StopListeningForEvents(target.GetBroadcaster(), lldb.SBTarget.eBroadcastBitBreakpointChanged)
+
+ bkpt2 = target.BreakpointCreateByName("main")
+ my_listener.WaitForEvent(1, event)
+ self.assertTrue(not event.IsValid(), "We don't get events we aren't listening to.")
diff --git a/packages/Python/lldbsuite/test/api/listeners/main.c b/packages/Python/lldbsuite/test/api/listeners/main.c
new file mode 100644
index 000000000000..f930e5119158
--- /dev/null
+++ b/packages/Python/lldbsuite/test/api/listeners/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int
+main()
+{
+ printf ("Hello there.\n");
+}
diff --git a/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py b/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
index 67dca2273d8a..ca2b986ce740 100644
--- a/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
+++ b/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
@@ -5,21 +5,21 @@ from __future__ import print_function
import os, re
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import lldb
import subprocess
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
class TestMultipleSimultaneousDebuggers(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfi386
@skipIfNoSBHeaders
- @expectedFailureFreeBSD("llvm.org/pr20282")
- @expectedFailureLinux("llvm.org/pr20282")
- @expectedFailureWindows # Test crashes
@expectedFlakeyDarwin()
+ @expectedFailureAll(archs="i[3-6]86", bugnumber="multi-process-driver.cpp creates an x64 target")
+ @expectedFailureAll(oslist=["windows", "linux", "freebsd"], bugnumber="llvm.org/pr20282")
def test_multiple_debuggers(self):
env = {self.dylibPath : self.getLLDBLibraryEnvVal()}
diff --git a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
index 9963cf23a8c6..7959bb73de02 100644
--- a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
+++ b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
@@ -6,8 +6,9 @@ from __future__ import print_function
import os, re
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
import subprocess
class SBBreakpointCallbackCase(TestBase):
@@ -36,7 +37,6 @@ class SBBreakpointCallbackCase(TestBase):
@skipIfNoSBHeaders
@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538)
@expectedFlakeyFreeBSD
- @expectedFlakeyLinux # Driver occasionally returns '1' as exit status
@expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
def test_sb_api_listener_event_process_state(self):
""" Test that a registered SBListener receives events when a process
@@ -51,7 +51,7 @@ class SBBreakpointCallbackCase(TestBase):
@skipIfNoSBHeaders
@skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538)
@expectedFlakeyFreeBSD
- @expectedFailureLinux
+ @expectedFailureAll(oslist=["linux"])
def test_sb_api_listener_resume(self):
""" Test that a process can be resumed from a non-main thread. """
self.build_and_test('driver.cpp listener_test.cpp test_listener_resume.cpp',
diff --git a/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp b/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
index 0a698d1081d4..a79c5cb2a08b 100644
--- a/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
+++ b/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
@@ -18,7 +18,6 @@ using namespace std;
// listener thread control
extern atomic<bool> g_done;
-multithreaded_queue<string> g_thread_descriptions;
multithreaded_queue<string> g_frame_functions;
extern SBListener g_listener;
@@ -30,26 +29,21 @@ void listener_func() {
if (got_event) {
if (!event.IsValid())
throw Exception("event is not valid in listener thread");
-
- // send process description
- SBProcess process = SBProcess::GetProcessFromEvent(event);
- SBStream description;
-
- for (int i = 0; i < process.GetNumThreads(); ++i) {
- // send each thread description
- description.Clear();
- SBThread thread = process.GetThreadAtIndex(i);
- thread.GetDescription(description);
- g_thread_descriptions.push(description.GetData());
-
- // send each frame function name
- uint32_t num_frames = thread.GetNumFrames();
- for(int j = 0; j < num_frames; ++j) {
- const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
- if (function_name)
- g_frame_functions.push(function_name);
+ // send process description
+ SBProcess process = SBProcess::GetProcessFromEvent(event);
+ SBStream description;
+
+ for (int i = 0; i < process.GetNumThreads(); ++i) {
+ // send each thread description
+ SBThread thread = process.GetThreadAtIndex(i);
+ // send each frame function name
+ uint32_t num_frames = thread.GetNumFrames();
+ for(int j = 0; j < num_frames; ++j) {
+ const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
+ if (function_name)
+ g_frame_functions.push(string(function_name));
+ }
}
- }
}
}
}
@@ -57,12 +51,8 @@ void listener_func() {
void check_listener(SBDebugger &dbg) {
// check thread description
bool got_description = false;
- string desc = g_thread_descriptions.pop(5, got_description);
- if (!got_description)
- throw Exception("Expected at least one thread description string");
-
- // check at least one frame has a function name
- desc = g_frame_functions.pop(5, got_description);
- if (!got_description)
- throw Exception("Expected at least one frame function name string");
+ string func_name = g_frame_functions.pop(5, got_description);
+
+ if(got_description == false)
+ throw Exception("Expected at least one frame function");
}
diff --git a/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py b/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py
index 8a78d21e7978..d502b6dfca8a 100644
--- a/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py
+++ b/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py
@@ -8,7 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ARMEmulationTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py b/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
index 25ca13a3bfd9..f7c274522f9b 100644
--- a/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
+++ b/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
@@ -8,8 +8,10 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestBenchmarkContinue(BenchBase):
diff --git a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
index a18cb2a64c76..8a0c044147a0 100644
--- a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
+++ b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
@@ -6,8 +6,10 @@ from __future__ import print_function
import os, sys
import lldb
-from lldbsuite.test import configuration
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
def is_exe(fpath):
"""Returns true if fpath is an executable."""
@@ -40,7 +42,7 @@ class DisassembleDriverMainLoop(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_then_gdb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
@@ -56,7 +58,7 @@ class DisassembleDriverMainLoop(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_gdb_then_lldb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
diff --git a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
index b7b07090959e..f8e3d94b6577 100644
--- a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
+++ b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, sys
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
-from lldbsuite.test import configuration
+from lldbsuite.test.lldbtest import *
class AttachThenDisassemblyBench(BenchBase):
diff --git a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
index 745e7b6a8c3b..618aac7eafcd 100644
--- a/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
+++ b/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
@@ -6,8 +6,11 @@ from __future__ import print_function
import os, sys
import lldb
-from lldbsuite.test import configuration
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import configuration
+from lldbsuite.test import lldbutil
class XCode41Vs42GDBDisassembly(BenchBase):
@@ -25,7 +28,7 @@ class XCode41Vs42GDBDisassembly(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_41_then_42(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print()
@@ -39,7 +42,7 @@ class XCode41Vs42GDBDisassembly(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_42_then_41(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print()
diff --git a/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py b/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
index abf45147d636..68d2bd9793e1 100644
--- a/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
+++ b/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
@@ -6,8 +6,11 @@ from __future__ import print_function
import os, sys
import lldb
-from lldbsuite.test import configuration
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import configuration
+from lldbsuite.test import lldbutil
class ExpressionEvaluationCase(BenchBase):
@@ -20,7 +23,7 @@ class ExpressionEvaluationCase(BenchBase):
self.count = 25
@benchmarks_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_expr_cmd(self):
"""Test lldb's expression commands and collect statistics."""
self.build()
diff --git a/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py b/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
index e5cada3563fa..2ad409e53b07 100644
--- a/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
+++ b/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
@@ -6,8 +6,11 @@ from __future__ import print_function
import os, sys
import lldb
+from lldbsuite.test.lldbbench import BenchBase
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
from lldbsuite.test import configuration
-from lldbsuite.test.lldbbench import *
+from lldbsuite.test import lldbutil
class RepeatedExprsCase(BenchBase):
@@ -22,7 +25,7 @@ class RepeatedExprsCase(BenchBase):
self.count = 100
@benchmarks_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_compare_lldb_to_gdb(self):
"""Test repeated expressions with lldb vs. gdb."""
self.build()
diff --git a/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py b/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
index 5fdf05763fd1..9f5835297379 100644
--- a/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
+++ b/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
@@ -8,6 +8,7 @@ import os, sys
import lldb
from lldbsuite.test import configuration
from lldbsuite.test import lldbtest_config
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
class FrameVariableResponseBench(BenchBase):
@@ -22,7 +23,7 @@ class FrameVariableResponseBench(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_startup_delay(self):
"""Test response time for the 'frame variable' command."""
print()
diff --git a/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py b/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
index 7606bd1d3e8b..12e23e956943 100644
--- a/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
+++ b/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
@@ -8,8 +8,10 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestBenchmarkLibcxxList(BenchBase):
diff --git a/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py b/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
index 806bc0ee29e2..4466cd083ca3 100644
--- a/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
+++ b/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
@@ -9,7 +9,9 @@ from __future__ import print_function
import os, time
import lldb
from lldbsuite.test.lldbbench import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestBenchmarkLibcxxMap(BenchBase):
diff --git a/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py b/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
index a215721ed52f..9d2356ab54f9 100644
--- a/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
+++ b/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
@@ -8,6 +8,7 @@ import os, sys
import lldb
from lldbsuite.test import configuration
from lldbsuite.test import lldbtest_config
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
class StartupDelaysBench(BenchBase):
@@ -27,7 +28,7 @@ class StartupDelaysBench(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_startup_delay(self):
"""Test start up delays creating a target, setting a breakpoint, and run to breakpoint stop."""
print()
diff --git a/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py b/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
index 14738a978e86..3ab760d4abe8 100644
--- a/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
+++ b/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
@@ -7,6 +7,9 @@ import lldb
from lldbsuite.test import configuration
from lldbsuite.test import lldbtest_config
from lldbsuite.test.lldbbench import *
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class SteppingSpeedBench(BenchBase):
@@ -23,7 +26,7 @@ class SteppingSpeedBench(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_steppings(self):
"""Test lldb steppings on a large executable."""
print()
diff --git a/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py b/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
index 731eb13bbcfb..3106c4511f58 100644
--- a/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
+++ b/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
@@ -6,8 +6,11 @@ from __future__ import print_function
import os, sys
import lldb
-from lldbsuite.test import configuration
from lldbsuite.test.lldbbench import *
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import configuration
+from lldbsuite.test import lldbutil
class CompileRunToBreakpointBench(BenchBase):
@@ -24,7 +27,7 @@ class CompileRunToBreakpointBench(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_then_gdb(self):
"""Benchmark turnaround time with lldb vs. gdb."""
print()
diff --git a/packages/Python/lldbsuite/test/configuration.py b/packages/Python/lldbsuite/test/configuration.py
index 69ed9fc32e2b..d797b17c164e 100644
--- a/packages/Python/lldbsuite/test/configuration.py
+++ b/packages/Python/lldbsuite/test/configuration.py
@@ -100,6 +100,15 @@ regexp = None
# run. Use '-s session-dir-name' to specify a specific dir name.
sdir_name = None
+# Valid options:
+# f - test file name (without extension)
+# n - test class name
+# m - test method name
+# a - architecture
+# c - compiler path
+# The default is to write all fields.
+session_file_format = 'fnmac'
+
# Set this flag if there is any session info dumped during the test run.
sdir_has_content = False
diff --git a/packages/Python/lldbsuite/test/decorators.py b/packages/Python/lldbsuite/test/decorators.py
new file mode 100644
index 000000000000..93e48272c5d3
--- /dev/null
+++ b/packages/Python/lldbsuite/test/decorators.py
@@ -0,0 +1,524 @@
+from __future__ import absolute_import
+from __future__ import print_function
+
+# System modules
+from distutils.version import LooseVersion, StrictVersion
+from functools import wraps
+import os
+import re
+import sys
+import tempfile
+
+# Third-party modules
+import six
+import unittest2
+
+# LLDB modules
+import use_lldb_suite
+
+import lldb
+from . import configuration
+from . import test_categories
+from lldbsuite.test_event.event_builder import EventBuilder
+from lldbsuite.support import funcutils
+from lldbsuite.test import lldbplatform
+from lldbsuite.test import lldbplatformutil
+
+class DecorateMode:
+ Skip, Xfail = range(2)
+
+
+# You can use no_match to reverse the test of the conditional that is used to match keyword
+# arguments in the skip / xfail decorators. If oslist=["windows", "linux"] skips windows
+# and linux, oslist=no_match(["windows", "linux"]) skips *unless* windows or linux.
+class no_match:
+ def __init__(self, item):
+ self.item = item
+
+def _check_expected_version(comparison, expected, actual):
+ def fn_leq(x,y): return x <= y
+ def fn_less(x,y): return x < y
+ def fn_geq(x,y): return x >= y
+ def fn_greater(x,y): return x > y
+ def fn_eq(x,y): return x == y
+ def fn_neq(x,y): return x != y
+
+ op_lookup = {
+ "==": fn_eq,
+ "=": fn_eq,
+ "!=": fn_neq,
+ "<>": fn_neq,
+ ">": fn_greater,
+ "<": fn_less,
+ ">=": fn_geq,
+ "<=": fn_leq
+ }
+ expected_str = '.'.join([str(x) for x in expected])
+ actual_str = '.'.join([str(x) for x in actual])
+
+ return op_lookup[comparison](LooseVersion(actual_str), LooseVersion(expected_str))
+
+def _match_decorator_property(expected, actual):
+ if actual is None or expected is None:
+ return True
+
+ if isinstance(expected, no_match):
+ return not _match_decorator_property(expected.item, actual)
+ elif isinstance(expected, (re._pattern_type,)+six.string_types):
+ return re.search(expected, actual) is not None
+ elif hasattr(expected, "__iter__"):
+ return any([x is not None and _match_decorator_property(x, actual) for x in expected])
+ else:
+ return expected == actual
+
+def expectedFailure(expected_fn, bugnumber=None):
+ def expectedFailure_impl(func):
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("Decorator can only be used to decorate a test method")
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ self = args[0]
+ if funcutils.requires_self(expected_fn):
+ xfail_reason = expected_fn(self)
+ else:
+ xfail_reason = expected_fn()
+ if xfail_reason is not None:
+ if configuration.results_formatter_object is not None:
+ # Mark this test as expected to fail.
+ configuration.results_formatter_object.handle_event(
+ EventBuilder.event_for_mark_test_expected_failure(self))
+ xfail_func = unittest2.expectedFailure(func)
+ xfail_func(*args, **kwargs)
+ else:
+ func(*args, **kwargs)
+ return wrapper
+ # Some decorators can be called both with no arguments (e.g. @expectedFailureWindows)
+ # or with arguments (e.g. @expectedFailureWindows(compilers=['gcc'])). When called
+ # the first way, the first argument will be the actual function because decorators are
+ # weird like that. So this is basically a check that says "which syntax was the original
+ # function decorated with?"
+ if six.callable(bugnumber):
+ return expectedFailure_impl(bugnumber)
+ else:
+ return expectedFailure_impl
+
+def skipTestIfFn(expected_fn, bugnumber=None):
+ def skipTestIfFn_impl(func):
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@skipTestIfFn can only be used to decorate a test method")
+
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ self = args[0]
+ if funcutils.requires_self(expected_fn):
+ reason = expected_fn(self)
+ else:
+ reason = expected_fn()
+
+ if reason is not None:
+ self.skipTest(reason)
+ else:
+ func(*args, **kwargs)
+ return wrapper
+
+ # Some decorators can be called both with no arguments (e.g. @expectedFailureWindows)
+ # or with arguments (e.g. @expectedFailureWindows(compilers=['gcc'])). When called
+ # the first way, the first argument will be the actual function because decorators are
+ # weird like that. So this is basically a check that says "how was the decorator used"
+ if six.callable(bugnumber):
+ return skipTestIfFn_impl(bugnumber)
+ else:
+ return skipTestIfFn_impl
+
+def _decorateTest(mode,
+ bugnumber=None, oslist=None, hostoslist=None,
+ compiler=None, compiler_version=None,
+ archs=None, triple=None,
+ debug_info=None,
+ swig_version=None, py_version=None,
+ remote=None):
+ def fn(self):
+ skip_for_os = _match_decorator_property(lldbplatform.translate(oslist), self.getPlatform())
+ skip_for_hostos = _match_decorator_property(lldbplatform.translate(hostoslist), lldbplatformutil.getHostPlatform())
+ skip_for_compiler = _match_decorator_property(compiler, self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
+ skip_for_arch = _match_decorator_property(archs, self.getArchitecture())
+ skip_for_debug_info = _match_decorator_property(debug_info, self.debug_info)
+ skip_for_triple = _match_decorator_property(triple, lldb.DBG.GetSelectedPlatform().GetTriple())
+ skip_for_remote = _match_decorator_property(remote, lldb.remote_platform is not None)
+
+ skip_for_swig_version = (swig_version is None) or (not hasattr(lldb, 'swig_version')) or (_check_expected_version(swig_version[0], swig_version[1], lldb.swig_version))
+ skip_for_py_version = (py_version is None) or _check_expected_version(py_version[0], py_version[1], sys.version_info)
+
+ # For the test to be skipped, all specified (e.g. not None) parameters must be True.
+ # An unspecified parameter means "any", so those are marked skip by default. And we skip
+ # the final test if all conditions are True.
+ conditions = [(oslist, skip_for_os, "target o/s"),
+ (hostoslist, skip_for_hostos, "host o/s"),
+ (compiler, skip_for_compiler, "compiler or version"),
+ (archs, skip_for_arch, "architecture"),
+ (debug_info, skip_for_debug_info, "debug info format"),
+ (triple, skip_for_triple, "target triple"),
+ (swig_version, skip_for_swig_version, "swig version"),
+ (py_version, skip_for_py_version, "python version"),
+ (remote, skip_for_remote, "platform locality (remote/local)")]
+ reasons = []
+ final_skip_result = True
+ for this_condition in conditions:
+ final_skip_result = final_skip_result and this_condition[1]
+ if this_condition[0] is not None and this_condition[1]:
+ reasons.append(this_condition[2])
+ reason_str = None
+ if final_skip_result:
+ mode_str = {DecorateMode.Skip : "skipping", DecorateMode.Xfail : "xfailing"}[mode]
+ if len(reasons) > 0:
+ reason_str = ",".join(reasons)
+ reason_str = "{} due to the following parameter(s): {}".format(mode_str, reason_str)
+ else:
+ reason_str = "{} unconditionally"
+ if bugnumber is not None and not six.callable(bugnumber):
+ reason_str = reason_str + " [" + str(bugnumber) + "]"
+ return reason_str
+
+ if mode == DecorateMode.Skip:
+ return skipTestIfFn(fn, bugnumber)
+ elif mode == DecorateMode.Xfail:
+ return expectedFailure(fn, bugnumber)
+ else:
+ return None
+
+# provide a function to xfail on defined oslist, compiler version, and archs
+# if none is specified for any argument, that argument won't be checked and thus means for all
+# for example,
+# @expectedFailureAll, xfail for all platform/compiler/arch,
+# @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture
+# @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386
+def expectedFailureAll(bugnumber=None,
+ oslist=None, hostoslist=None,
+ compiler=None, compiler_version=None,
+ archs=None, triple=None,
+ debug_info=None,
+ swig_version=None, py_version=None,
+ remote=None):
+ return _decorateTest(DecorateMode.Xfail,
+ bugnumber=bugnumber,
+ oslist=oslist, hostoslist=hostoslist,
+ compiler=compiler, compiler_version=compiler_version,
+ archs=archs, triple=triple,
+ debug_info=debug_info,
+ swig_version=swig_version, py_version=py_version,
+ remote=remote)
+
+
+# provide a function to skip on defined oslist, compiler version, and archs
+# if none is specified for any argument, that argument won't be checked and thus means for all
+# for example,
+# @skipIf, skip for all platform/compiler/arch,
+# @skipIf(compiler='gcc'), skip for gcc on all platform/architecture
+# @skipIf(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), skip for gcc>=4.9 on linux with i386
+def skipIf(bugnumber=None,
+ oslist=None, hostoslist=None,
+ compiler=None, compiler_version=None,
+ archs=None, triple=None,
+ debug_info=None,
+ swig_version=None, py_version=None,
+ remote=None):
+ return _decorateTest(DecorateMode.Skip,
+ bugnumber=bugnumber,
+ oslist=oslist, hostoslist=hostoslist,
+ compiler=compiler, compiler_version=compiler_version,
+ archs=archs, triple=triple,
+ debug_info=debug_info,
+ swig_version=swig_version, py_version=py_version,
+ remote=remote)
+
+def _skip_for_android(reason, api_levels, archs):
+ def impl(obj):
+ result = lldbplatformutil.match_android_device(obj.getArchitecture(), valid_archs=archs, valid_api_levels=api_levels)
+ return reason if result else None
+ return impl
+
+def add_test_categories(cat):
+ """Add test categories to a TestCase method"""
+ cat = test_categories.validate(cat, True)
+ def impl(func):
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@add_test_categories can only be used to decorate a test method")
+ if hasattr(func, "categories"):
+ cat.extend(func.categories)
+ func.categories = cat
+ return func
+
+ return impl
+
+def benchmarks_test(func):
+ """Decorate the item as a benchmarks test."""
+ def should_skip_benchmarks_test():
+ return "benchmarks test"
+
+ # Mark this function as such to separate them from the regular tests.
+ result = skipTestIfFn(should_skip_benchmarks_test)(func)
+ result.__benchmarks_test__ = True
+ return result
+
+def no_debug_info_test(func):
+ """Decorate the item as a test what don't use any debug info. If this annotation is specified
+ then the test runner won't generate a separate test for each debug info format. """
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@no_debug_info_test can only be used to decorate a test method")
+ @wraps(func)
+ def wrapper(self, *args, **kwargs):
+ return func(self, *args, **kwargs)
+
+ # Mark this function as such to separate them from the regular tests.
+ wrapper.__no_debug_info_test__ = True
+ return wrapper
+
+def debugserver_test(func):
+ """Decorate the item as a debugserver test."""
+ def should_skip_debugserver_test():
+ return "debugserver tests" if configuration.dont_do_debugserver_test else None
+ return skipTestIfFn(should_skip_debugserver_test)(func)
+
+def llgs_test(func):
+ """Decorate the item as a lldb-server test."""
+ def should_skip_llgs_tests():
+ return "llgs tests" if configuration.dont_do_llgs_test else None
+ return skipTestIfFn(should_skip_llgs_tests)(func)
+
+def not_remote_testsuite_ready(func):
+ """Decorate the item as a test which is not ready yet for remote testsuite."""
+ def is_remote():
+ return "Not ready for remote testsuite" if lldb.remote_platform else None
+ return skipTestIfFn(is_remote)(func)
+
+def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None, archs=None):
+ return expectedFailureAll(oslist=oslist, bugnumber=bugnumber, compiler=compilers, archs=archs, debug_info=debug_info)
+
+def expectedFailureDarwin(bugnumber=None, compilers=None, debug_info=None):
+ # For legacy reasons, we support both "darwin" and "macosx" as OS X triples.
+ return expectedFailureOS(lldbplatform.darwin_all, bugnumber, compilers, debug_info=debug_info)
+
+def expectedFailureAndroid(bugnumber=None, api_levels=None, archs=None):
+ """ Mark a test as xfail for Android.
+
+ Arguments:
+ bugnumber - The LLVM pr associated with the problem.
+ api_levels - A sequence of numbers specifying the Android API levels
+ for which a test is expected to fail. None means all API level.
+ arch - A sequence of architecture names specifying the architectures
+ for which a test is expected to fail. None means all architectures.
+ """
+ return expectedFailure(_skip_for_android("xfailing on android", api_levels, archs), bugnumber)
+
+# Flakey tests get two chances to run. If they fail the first time round, the result formatter
+# makes sure it is run one more time.
+def expectedFlakey(expected_fn, bugnumber=None):
+ def expectedFailure_impl(func):
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ self = args[0]
+ if expected_fn(self):
+ # Send event marking test as explicitly eligible for rerunning.
+ if configuration.results_formatter_object is not None:
+ # Mark this test as rerunnable.
+ configuration.results_formatter_object.handle_event(
+ EventBuilder.event_for_mark_test_rerun_eligible(self))
+ func(*args, **kwargs)
+ return wrapper
+ # Some decorators can be called both with no arguments (e.g. @expectedFailureWindows)
+ # or with arguments (e.g. @expectedFailureWindows(compilers=['gcc'])). When called
+ # the first way, the first argument will be the actual function because decorators are
+ # weird like that. So this is basically a check that says "which syntax was the original
+ # function decorated with?"
+ if six.callable(bugnumber):
+ return expectedFailure_impl(bugnumber)
+ else:
+ return expectedFailure_impl
+
+def expectedFlakeyDwarf(bugnumber=None):
+ def fn(self):
+ return self.debug_info == "dwarf"
+ return expectedFlakey(fn, bugnumber)
+
+def expectedFlakeyDsym(bugnumber=None):
+ def fn(self):
+ return self.debug_info == "dwarf"
+ return expectedFlakey(fn, bugnumber)
+
+def expectedFlakeyOS(oslist, bugnumber=None, compilers=None):
+ def fn(self):
+ return (self.getPlatform() in oslist and
+ self.expectedCompiler(compilers))
+ return expectedFlakey(fn, bugnumber)
+
+def expectedFlakeyDarwin(bugnumber=None, compilers=None):
+ # For legacy reasons, we support both "darwin" and "macosx" as OS X triples.
+ return expectedFlakeyOS(lldbplatformutil.getDarwinOSTriples(), bugnumber, compilers)
+
+def expectedFlakeyFreeBSD(bugnumber=None, compilers=None):
+ return expectedFlakeyOS(['freebsd'], bugnumber, compilers)
+
+def expectedFlakeyLinux(bugnumber=None, compilers=None):
+ return expectedFlakeyOS(['linux'], bugnumber, compilers)
+
+def expectedFlakeyNetBSD(bugnumber=None, compilers=None):
+ return expectedFlakeyOS(['netbsd'], bugnumber, compilers)
+
+def expectedFlakeyCompiler(compiler, compiler_version=None, bugnumber=None):
+ if compiler_version is None:
+ compiler_version=['=', None]
+ def fn(self):
+ return compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version)
+ return expectedFlakey(fn, bugnumber)
+
+# @expectedFlakeyClang('bugnumber', ['<=', '3.4'])
+def expectedFlakeyClang(bugnumber=None, compiler_version=None):
+ return expectedFlakeyCompiler('clang', compiler_version, bugnumber)
+
+# @expectedFlakeyGcc('bugnumber', ['<=', '3.4'])
+def expectedFlakeyGcc(bugnumber=None, compiler_version=None):
+ return expectedFlakeyCompiler('gcc', compiler_version, bugnumber)
+
+def expectedFlakeyAndroid(bugnumber=None, api_levels=None, archs=None):
+ return expectedFlakey(_skip_for_android("flakey on android", api_levels, archs), bugnumber)
+
+def skipIfRemote(func):
+ """Decorate the item to skip tests if testing remotely."""
+ def is_remote():
+ return "skip on remote platform" if lldb.remote_platform else None
+ return skipTestIfFn(is_remote)(func)
+
+def skipIfRemoteDueToDeadlock(func):
+ """Decorate the item to skip tests if testing remotely due to the test deadlocking."""
+ def is_remote():
+ return "skip on remote platform (deadlocks)" if lldb.remote_platform else None
+ return skipTestIfFn(is_remote)(func)
+
+def skipIfNoSBHeaders(func):
+ """Decorate the item to mark tests that should be skipped when LLDB is built with no SB API headers."""
+ def are_sb_headers_missing():
+ if lldbplatformutil.getHostPlatform() == 'darwin':
+ header = os.path.join(os.environ["LLDB_LIB_DIR"], 'LLDB.framework', 'Versions','Current','Headers','LLDB.h')
+ else:
+ header = os.path.join(os.environ["LLDB_SRC"], "include", "lldb", "API", "LLDB.h")
+ if not os.path.exists(header):
+ return "skip because LLDB.h header not found"
+ return None
+
+ return skipTestIfFn(are_sb_headers_missing)(func)
+
+def skipIfiOSSimulator(func):
+ """Decorate the item to skip tests that should be skipped on the iOS Simulator."""
+ def is_ios_simulator():
+ return "skip on the iOS Simulator" if configuration.lldb_platform_name == 'ios-simulator' else None
+ return skipTestIfFn(is_ios_simulator)(func)
+
+def skipIfFreeBSD(func):
+ """Decorate the item to skip tests that should be skipped on FreeBSD."""
+ return skipIfPlatform(["freebsd"])(func)
+
+def skipIfNetBSD(func):
+ """Decorate the item to skip tests that should be skipped on NetBSD."""
+ return skipIfPlatform(["netbsd"])(func)
+
+def skipIfDarwin(func):
+ """Decorate the item to skip tests that should be skipped on Darwin."""
+ return skipIfPlatform(lldbplatform.translate(lldbplatform.darwin_all))(func)
+
+def skipIfLinux(func):
+ """Decorate the item to skip tests that should be skipped on Linux."""
+ return skipIfPlatform(["linux"])(func)
+
+def skipIfWindows(func):
+ """Decorate the item to skip tests that should be skipped on Windows."""
+ return skipIfPlatform(["windows"])(func)
+
+def skipUnlessWindows(func):
+ """Decorate the item to skip tests that should be skipped on any non-Windows platform."""
+ return skipUnlessPlatform(["windows"])(func)
+
+def skipUnlessDarwin(func):
+ """Decorate the item to skip tests that should be skipped on any non Darwin platform."""
+ return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
+
+def skipUnlessGoInstalled(func):
+ """Decorate the item to skip tests when no Go compiler is available."""
+ def is_go_missing(self):
+ compiler = self.getGoCompilerVersion()
+ if not compiler:
+ return "skipping because go compiler not found"
+ match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler)
+ if not match_version:
+ # Couldn't determine version.
+ return "skipping because go version could not be parsed out of {}".format(compiler)
+ else:
+ min_strict_version = StrictVersion("1.4.0")
+ compiler_strict_version = StrictVersion(match_version.group(1))
+ if compiler_strict_version < min_strict_version:
+ return "skipping because available version ({}) does not meet minimum required version ({})".format(
+ compiler_strict_version, min_strict_version)
+ return None
+ return skipTestIfFn(is_go_missing)(func)
+
+def skipIfHostIncompatibleWithRemote(func):
+ """Decorate the item to skip tests if binaries built on this host are incompatible."""
+ def is_host_incompatible_with_remote(self):
+ host_arch = self.getLldbArchitecture()
+ host_platform = lldbplatformutil.getHostPlatform()
+ target_arch = self.getArchitecture()
+ target_platform = 'darwin' if self.platformIsDarwin() else self.getPlatform()
+ if not (target_arch == 'x86_64' and host_arch == 'i386') and host_arch != target_arch:
+ return "skipping because target %s is not compatible with host architecture %s" % (target_arch, host_arch)
+ elif target_platform != host_platform:
+ return "skipping because target is %s but host is %s" % (target_platform, host_platform)
+ return None
+ return skipTestIfFn(is_host_incompatible_with_remote)(func)
+
+def skipIfPlatform(oslist):
+ """Decorate the item to skip tests if running on one of the listed platforms."""
+ # This decorator cannot be ported to `skipIf` yet because it is used on entire
+ # classes, which `skipIf` explicitly forbids.
+ return unittest2.skipIf(lldbplatformutil.getPlatform() in oslist,
+ "skip on %s" % (", ".join(oslist)))
+
+def skipUnlessPlatform(oslist):
+ """Decorate the item to skip tests unless running on one of the listed platforms."""
+ # This decorator cannot be ported to `skipIf` yet because it is used on entire
+ # classes, which `skipIf` explicitly forbids.
+ return unittest2.skipUnless(lldbplatformutil.getPlatform() in oslist,
+ "requires on of %s" % (", ".join(oslist)))
+
+def skipIfTargetAndroid(api_levels=None, archs=None):
+ """Decorator to skip tests when the target is Android.
+
+ Arguments:
+ api_levels - The API levels for which the test should be skipped. If
+ it is None, then the test will be skipped for all API levels.
+ arch - A sequence of architecture names specifying the architectures
+ for which a test is skipped. None means all architectures.
+ """
+ return skipTestIfFn(_skip_for_android("skipping for android", api_levels, archs))
+
+def skipUnlessCompilerRt(func):
+ """Decorate the item to skip tests if testing remotely."""
+ def is_compiler_rt_missing():
+ compilerRtPath = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "llvm","projects","compiler-rt")
+ return "compiler-rt not found" if not os.path.exists(compilerRtPath) else None
+ return skipTestIfFn(is_compiler_rt_missing)(func)
+
+def skipUnlessThreadSanitizer(func):
+ """Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
+ def is_compiler_clang_with_thread_sanitizer(self):
+ compiler_path = self.getCompiler()
+ compiler = os.path.basename(compiler_path)
+ if not compiler.startswith("clang"):
+ return "Test requires clang as compiler"
+ f = tempfile.NamedTemporaryFile()
+ cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, f.name)
+ if os.popen(cmd).close() != None:
+ return None # The compiler cannot compile at all, let's *not* skip the test
+ cmd = "echo 'int main() {}' | %s -fsanitize=thread -x c -o %s -" % (compiler_path, f.name)
+ if os.popen(cmd).close() != None:
+ return "Compiler cannot compile with -fsanitize=thread"
+ return None
+ return skipTestIfFn(is_compiler_clang_with_thread_sanitizer)(func)
diff --git a/packages/Python/lldbsuite/test/dosep.py b/packages/Python/lldbsuite/test/dosep.py
index 87a410fa090f..37ca91adb140 100644
--- a/packages/Python/lldbsuite/test/dosep.py
+++ b/packages/Python/lldbsuite/test/dosep.py
@@ -30,8 +30,8 @@ ulimit -c unlimited
echo core.%p | sudo tee /proc/sys/kernel/core_pattern
"""
-from __future__ import print_function
from __future__ import absolute_import
+from __future__ import print_function
# system packages and modules
import asyncore
@@ -53,18 +53,13 @@ import lldbsuite
import lldbsuite.support.seven as seven
from . import configuration
-from . import dotest_channels
from . import dotest_args
-from . import result_formatter
-
-from .result_formatter import EventBuilder
+from lldbsuite.support import optional_with
+from lldbsuite.test_event import dotest_channels
+from lldbsuite.test_event.event_builder import EventBuilder
+from lldbsuite.test_event import formatter
-
-# Todo: Convert this folder layout to be relative-import friendly and
-# don't hack up sys.path like this
-sys.path.append(os.path.join(os.path.dirname(__file__), "test_runner", "lib"))
-import lldb_utils
-import process_control
+from .test_runner import process_control
# Status codes for running command with timeout.
eTimedOut, ePassed, eFailed = 124, 0, 1
@@ -109,13 +104,17 @@ def setup_global_variables(
global GET_WORKER_INDEX
GET_WORKER_INDEX = get_worker_index_use_pid
-def report_test_failure(name, command, output):
+def report_test_failure(name, command, output, timeout):
global output_lock
with output_lock:
if not (RESULTS_FORMATTER and RESULTS_FORMATTER.is_using_terminal()):
print(file=sys.stderr)
print(output, file=sys.stderr)
- print("[%s FAILED]" % name, file=sys.stderr)
+ if timeout:
+ timeout_str = " (TIMEOUT)"
+ else:
+ timeout_str = ""
+ print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
update_progress(name)
@@ -173,7 +172,7 @@ class DoTestProcessDriver(process_control.ProcessDriver):
super(DoTestProcessDriver, self).__init__(
soft_terminate_timeout=soft_terminate_timeout)
self.output_file = output_file
- self.output_lock = lldb_utils.OptionalWith(output_file_lock)
+ self.output_lock = optional_with.optional_with(output_file_lock)
self.pid_events = pid_events
self.results = None
self.file_name = file_name
@@ -211,7 +210,7 @@ class DoTestProcessDriver(process_control.ProcessDriver):
# only stderr does.
report_test_pass(self.file_name, output[1])
else:
- report_test_failure(self.file_name, command, output[1])
+ report_test_failure(self.file_name, command, output[1], was_timeout)
# Save off the results for the caller.
self.results = (
@@ -299,9 +298,9 @@ def send_events_to_collector(events, command):
event_port = int(command[arg_index])
# Create results formatter connected back to collector via socket.
- config = result_formatter.FormatterConfig()
+ config = formatter.FormatterConfig()
config.port = event_port
- formatter_spec = result_formatter.create_results_formatter(config)
+ formatter_spec = formatter.create_results_formatter(config)
if formatter_spec is None or formatter_spec.formatter is None:
raise Exception(
"Failed to create socket-based ResultsFormatter "
@@ -420,9 +419,14 @@ def process_dir(root, files, dotest_argv, inferior_pid_events):
results = []
for (base_name, full_test_path) in files:
import __main__ as main
+ global dotest_options
+ if dotest_options.p and not re.search(dotest_options.p, base_name):
+ continue
+
script_file = main.__file__
command = ([sys.executable, script_file] +
dotest_argv +
+ ["-S", dotest_options.session_file_format] +
["--inferior", "-p", base_name, root])
timeout_name = os.path.basename(os.path.splitext(base_name)[0]).upper()
@@ -1135,34 +1139,27 @@ def walk_and_invoke(test_files, dotest_argv, num_workers, test_runner_func):
def getExpectedTimeouts(platform_name):
# returns a set of test filenames that might timeout
# are we running against a remote target?
- host = sys.platform
+
+ # Figure out the target system for which we're collecting
+ # the set of expected timeout test filenames.
if platform_name is None:
target = sys.platform
else:
m = re.search(r'remote-(\w+)', platform_name)
- target = m.group(1)
+ if m is not None:
+ target = m.group(1)
+ else:
+ target = platform_name
expected_timeout = set()
- if target.startswith("android"):
- expected_timeout |= {
- "TestExitDuringStep.py",
- "TestHelloWorld.py",
- }
- elif target.startswith("freebsd"):
+ if target.startswith("freebsd"):
expected_timeout |= {
"TestBreakpointConditions.py",
"TestChangeProcessGroup.py",
"TestValueObjectRecursion.py",
"TestWatchpointConditionAPI.py",
}
- elif target.startswith("darwin"):
- expected_timeout |= {
- # times out on MBP Retina, Mid 2012
- "TestThreadSpecificBreakpoint.py",
- "TestExitDuringStep.py",
- "TestIntegerTypesExpr.py",
- }
return expected_timeout
diff --git a/packages/Python/lldbsuite/test/dotest.py b/packages/Python/lldbsuite/test/dotest.py
index 723f26a417e4..702e57e99871 100644
--- a/packages/Python/lldbsuite/test/dotest.py
+++ b/packages/Python/lldbsuite/test/dotest.py
@@ -23,7 +23,6 @@ from __future__ import print_function
# System modules
import atexit
-import importlib
import os
import errno
import platform
@@ -31,7 +30,6 @@ import signal
import socket
import subprocess
import sys
-import inspect
# Third-party modules
import six
@@ -43,9 +41,9 @@ from . import configuration
from . import dotest_args
from . import lldbtest_config
from . import test_categories
-from . import result_formatter
+from lldbsuite.test_event import formatter
from . import test_result
-from .result_formatter import EventBuilder
+from lldbsuite.test_event.event_builder import EventBuilder
from ..support import seven
def is_exe(fpath):
@@ -309,7 +307,7 @@ def parseOptionsAndInitTestdirs():
configuration.lldbFrameworkPath = args.framework
if args.executable:
- lldbtest_config.lldbExec = args.executable
+ lldbtest_config.lldbExec = os.path.realpath(args.executable)
if args.p:
if args.p.startswith('-'):
@@ -323,6 +321,7 @@ def parseOptionsAndInitTestdirs():
if args.s.startswith('-'):
usage(parser)
configuration.sdir_name = args.s
+ configuration.session_file_format = args.session_file_format
if args.t:
os.environ['LLDB_COMMAND_TRACE'] = 'YES'
@@ -359,7 +358,7 @@ def parseOptionsAndInitTestdirs():
# Capture test results-related args.
if args.curses and not args.inferior:
# Act as if the following args were set.
- args.results_formatter = "lldbsuite.test.curses_results.Curses"
+ args.results_formatter = "lldbsuite.test_event.formatter.curses.Curses"
args.results_file = "stdout"
if args.results_file:
@@ -383,7 +382,7 @@ def parseOptionsAndInitTestdirs():
# and we're not a test inferior.
if not args.inferior and configuration.results_formatter_name is None:
configuration.results_formatter_name = (
- "lldbsuite.test.result_formatter.ResultsFormatter")
+ "lldbsuite.test_event.formatter.results_formatter.ResultsFormatter")
# rerun-related arguments
configuration.rerun_all_issues = args.rerun_all_issues
@@ -412,7 +411,7 @@ def parseOptionsAndInitTestdirs():
# Tell the event builder to create all events with these
# key/val pairs in them.
if len(entries) > 0:
- result_formatter.EventBuilder.add_entries_to_all_events(entries)
+ EventBuilder.add_entries_to_all_events(entries)
# Gather all the dirs passed on the command line.
if len(args.args) > 0:
@@ -453,7 +452,7 @@ def createSocketToLocalPort(port):
def setupTestResults():
"""Sets up test results-related objects based on arg settings."""
# Setup the results formatter configuration.
- formatter_config = result_formatter.FormatterConfig()
+ formatter_config = formatter.FormatterConfig()
formatter_config.filename = configuration.results_filename
formatter_config.formatter_name = configuration.results_formatter_name
formatter_config.formatter_options = (
@@ -461,12 +460,12 @@ def setupTestResults():
formatter_config.port = configuration.results_port
# Create the results formatter.
- formatter_spec = result_formatter.create_results_formatter(
+ formatter_spec = formatter.create_results_formatter(
formatter_config)
if formatter_spec is not None and formatter_spec.formatter is not None:
configuration.results_formatter_object = formatter_spec.formatter
- # Send an intialize message to the formatter.
+ # Send an initialize message to the formatter.
initialize_event = EventBuilder.bare_event("initialize")
if isMultiprocessTestRunner():
if (configuration.test_runner_name is not None and
@@ -640,16 +639,15 @@ def setupSysPath():
if not lldbPythonDir:
if platform.system() == "Darwin":
python_resource_dir = ['LLDB.framework', 'Resources', 'Python']
- outputPaths = getXcodeOutputPaths()
+ outputPaths = getXcodeOutputPaths(lldbRootDirectory)
for outputPath in outputPaths:
- candidatePath = os.path.join(outputPath, python_resource_dir)
+ candidatePath = os.path.join(outputPath, *python_resource_dir)
if os.path.isfile(os.path.join(candidatePath, init_in_python_dir)):
lldbPythonDir = candidatePath
break
if not lldbPythonDir:
- print('This script requires lldb.py to be in either ' + dbgPath + ',', end=' ')
- print(relPath + ', or ' + baiPath + '. Some tests might fail.')
+ print("lldb.py is not found, some tests may fail.")
else:
print("Unable to load lldb extension module. Possible reasons for this include:")
print(" 1) LLDB was built with LLDB_DISABLE_PYTHON=1")
@@ -659,7 +657,7 @@ def setupSysPath():
print(" location of LLDB\'s site-packages folder.")
print(" 3) A different version of Python than that which was built against is exported in")
print(" the system\'s PATH environment variable, causing conflicts.")
- print(" 4) The executable '%s' could not be found. Please check " % lldbExecutable)
+ print(" 4) The executable '%s' could not be found. Please check " % lldbtest_config.lldbExec)
print(" that it exists and is executable.")
if lldbPythonDir:
@@ -678,73 +676,98 @@ def setupSysPath():
# This is to locate the lldb.py module. Insert it right after sys.path[0].
sys.path[1:1] = [lldbPythonDir]
+
+def visit_file(dir, name):
+ # Try to match the regexp pattern, if specified.
+ if configuration.regexp:
+ import re
+ if not re.search(configuration.regexp, name):
+ # We didn't match the regex, we're done.
+ return
+
+ # We found a match for our test. Add it to the suite.
+
+ # Update the sys.path first.
+ if not sys.path.count(dir):
+ sys.path.insert(0, dir)
+ base = os.path.splitext(name)[0]
+
+ # Thoroughly check the filterspec against the base module and admit
+ # the (base, filterspec) combination only when it makes sense.
+ filterspec = None
+ for filterspec in configuration.filters:
+ # Optimistically set the flag to True.
+ filtered = True
+ module = __import__(base)
+ parts = filterspec.split('.')
+ obj = module
+ for part in parts:
+ try:
+ parent, obj = obj, getattr(obj, part)
+ except AttributeError:
+ # The filterspec has failed.
+ filtered = False
+ break
+
+ # If filtered, we have a good filterspec. Add it.
+ if filtered:
+ # print("adding filter spec %s to module %s" % (filterspec, module))
+ configuration.suite.addTests(
+ unittest2.defaultTestLoader.loadTestsFromName(filterspec, module))
+ continue
+
+ # Forgo this module if the (base, filterspec) combo is invalid
+ if configuration.filters and not filtered:
+ return
+
+ if not filterspec or not filtered:
+ # Add the entire file's worth of tests since we're not filtered.
+ # Also the fail-over case when the filterspec branch
+ # (base, filterspec) combo doesn't make sense.
+ configuration.suite.addTests(unittest2.defaultTestLoader.loadTestsFromName(base))
+
+
def visit(prefix, dir, names):
"""Visitor function for os.path.walk(path, visit, arg)."""
dir_components = set(dir.split(os.sep))
excluded_components = set(['.svn', '.git'])
if dir_components.intersection(excluded_components):
- #print("Detected an excluded dir component: %s" % dir)
return
- for name in names:
- if '.py' == os.path.splitext(name)[1] and name.startswith(prefix):
+ # Gather all the Python test file names that follow the Test*.py pattern.
+ python_test_files = [
+ name
+ for name in names
+ if name.endswith('.py') and name.startswith(prefix)]
+ # Visit all the python test files.
+ for name in python_test_files:
+ try:
+ # Ensure we error out if we have multiple tests with the same
+ # base name.
+ # Future improvement: find all the places where we work with base
+ # names and convert to full paths. We have directory structure
+ # to disambiguate these, so we shouldn't need this constraint.
if name in configuration.all_tests:
raise Exception("Found multiple tests with the name %s" % name)
configuration.all_tests.add(name)
- # Try to match the regexp pattern, if specified.
- if configuration.regexp:
- import re
- if re.search(configuration.regexp, name):
- #print("Filename: '%s' matches pattern: '%s'" % (name, regexp))
- pass
- else:
- #print("Filename: '%s' does not match pattern: '%s'" % (name, regexp))
- continue
-
- # We found a match for our test. Add it to the suite.
-
- # Update the sys.path first.
- if not sys.path.count(dir):
- sys.path.insert(0, dir)
- base = os.path.splitext(name)[0]
-
- # Thoroughly check the filterspec against the base module and admit
- # the (base, filterspec) combination only when it makes sense.
- filterspec = None
- for filterspec in configuration.filters:
- # Optimistically set the flag to True.
- filtered = True
- module = __import__(base)
- parts = filterspec.split('.')
- obj = module
- for part in parts:
- try:
- parent, obj = obj, getattr(obj, part)
- except AttributeError:
- # The filterspec has failed.
- filtered = False
- break
+ # Run the relevant tests in the python file.
+ visit_file(dir, name)
+ except Exception as ex:
+ # Convert this exception to a test event error for the file.
+ test_filename = os.path.abspath(os.path.join(dir, name))
+ if configuration.results_formatter_object is not None:
+ # Grab the backtrace for the exception.
+ import traceback
+ backtrace = traceback.format_exc()
- # If filtered, we have a good filterspec. Add it.
- if filtered:
- #print("adding filter spec %s to module %s" % (filterspec, module))
- configuration.suite.addTests(
- unittest2.defaultTestLoader.loadTestsFromName(filterspec, module))
- continue
-
- # Forgo this module if the (base, filterspec) combo is invalid
- if configuration.filters and not filtered:
- continue
-
- # Add either the filtered test case(s) (which is done before) or the entire test class.
- if not filterspec or not filtered:
- # A simple case of just the module name. Also the failover case
- # from the filterspec branch when the (base, filterspec) combo
- # doesn't make sense.
- configuration.suite.addTests(unittest2.defaultTestLoader.loadTestsFromName(base))
+ # Generate the test event.
+ configuration.results_formatter_object.handle_event(
+ EventBuilder.event_for_job_test_add_error(
+ test_filename, ex, backtrace))
+ raise
def disabledynamics():
@@ -987,12 +1010,6 @@ def run_suite():
except OSError as exception:
if exception.errno != errno.EEXIST:
raise
- where_to_save_session = os.getcwd()
- fname = os.path.join(configuration.sdir_name, "TestStarted-%d" % os.getpid())
- with open(fname, "w") as f:
- print("Test started at: %s\n" % timestamp_started, file=f)
- print(configuration.svn_info, file=f)
- print("Command invoked: %s\n" % getMyCommandLine(), file=f)
#
# Invoke the default TextTestRunner to run the test suite, possibly iterating
@@ -1092,7 +1109,7 @@ def run_suite():
# mark __ignore_singleton__ flag as True so the signleton pattern is
# not enforced.
test_result.LLDBTestResult.__ignore_singleton__ = True
- for i in range(count):
+ for i in range(configuration.count):
result = unittest2.TextTestRunner(stream=sys.stderr,
verbosity=v,
@@ -1109,11 +1126,6 @@ def run_suite():
for category in configuration.failuresPerCategory:
sys.stderr.write("%s - %d\n" % (category, configuration.failuresPerCategory[category]))
- os.chdir(where_to_save_session)
- fname = os.path.join(configuration.sdir_name, "TestFinished-%d" % os.getpid())
- with open(fname, "w") as f:
- print("Test finished at: %s\n" % datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S"), file=f)
-
# Terminate the test suite if ${LLDB_TESTSUITE_FORCE_FINISH} is defined.
# This should not be necessary now.
if ("LLDB_TESTSUITE_FORCE_FINISH" in os.environ):
diff --git a/packages/Python/lldbsuite/test/dotest_args.py b/packages/Python/lldbsuite/test/dotest_args.py
index 105156df7e84..8bbc29c98f00 100644
--- a/packages/Python/lldbsuite/test/dotest_args.py
+++ b/packages/Python/lldbsuite/test/dotest_args.py
@@ -11,6 +11,7 @@ import textwrap
# Third-party modules
# LLDB modules
+from . import configuration
class ArgParseNamespace(object):
pass
@@ -70,6 +71,7 @@ def create_parser():
group.add_argument('--framework', metavar='framework-path', help='The path to LLDB.framework')
group.add_argument('--executable', metavar='executable-path', help='The path to the lldb executable')
group.add_argument('-s', metavar='name', help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name')
+ group.add_argument('-S', '--session-file-format', default=configuration.session_file_format, metavar='format', help='Specify session file name format. See configuration.py for a description.')
group.add_argument('-y', type=int, metavar='count', help="Specify the iteration count used to collect our benchmarks. An example is the number of times to do 'thread step-over' to measure stepping speed.")
group.add_argument('-#', type=int, metavar='sharp', dest='sharp', help='Repeat the test suite for a specified number of times')
group.add_argument('--channel', metavar='channel', dest='channels', action='append', help=textwrap.dedent("Specify the log channels (and optional categories) e.g. 'lldb all' or 'gdb-remote packets' if no categories are specified, 'default' is used"))
diff --git a/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py b/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
index 0a9edd2755c9..6713a5a764e4 100644
--- a/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
+++ b/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
@@ -8,7 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class DriverBatchModeTest (TestBase):
@@ -34,7 +36,7 @@ class DriverBatchModeTest (TestBase):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_run_crash (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
@@ -71,7 +73,7 @@ class DriverBatchModeTest (TestBase):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_run_exit (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
@@ -108,7 +110,7 @@ class DriverBatchModeTest (TestBase):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_attach_exit (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile
new file mode 100644
index 000000000000..7df664ac43e3
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile
@@ -0,0 +1,12 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+# targets. Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+ CFLAGS_EXTRAS += -fno-limit-debug-info
+endif
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
new file mode 100644
index 000000000000..e1a53305a0d0
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
@@ -0,0 +1,42 @@
+"""
+Test calling user defined functions using expression evaluation.
+This test checks that typesystem lookup works correctly for typedefs of
+untagged structures.
+
+Ticket: https://llvm.org/bugs/show_bug.cgi?id=26790
+"""
+
+from __future__ import print_function
+
+import lldb
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestExprLookupAnonStructTypedef(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ TestBase.setUp(self)
+ # Find the breakpoint
+ self.line = line_number('main.cpp', '// lldb testsuite break')
+
+ @expectedFailureAll(oslist=["windows"])
+ @expectedFailureAll(oslist=['linux'], archs=['arm'], bugnumber="llvm.org/pr27868")
+ def test(self):
+ """Test typedeffed untagged struct arguments for function call expressions"""
+ self.build()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ lldbutil.run_break_set_by_file_and_line(
+ self,
+ "main.cpp",
+ self.line,
+ num_expected_locations=-1,
+ loc_exact=True
+ )
+
+ self.runCmd("run", RUN_SUCCEEDED)
+ self.expect("expr multiply(&s)", substrs=['$0 = 1'])
diff --git a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/main.cpp b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/main.cpp
new file mode 100644
index 000000000000..5b170c5f943a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/main.cpp
@@ -0,0 +1,26 @@
+#include <tgmath.h>
+
+typedef struct {
+ float f;
+ int i;
+} my_untagged_struct;
+
+double multiply(my_untagged_struct *s)
+{
+ return s->f * s->i;
+}
+
+double multiply(my_untagged_struct *s, int x)
+{
+ return multiply(s) * x;
+}
+
+int main(int argc, char **argv)
+{
+ my_untagged_struct s = {
+ .f = (float)argc,
+ .i = argc,
+ };
+ // lldb testsuite break
+ return !(multiply(&s, argc) == pow(argc, 3));
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
index 3756b4a8cea4..61702ee88033 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandCallFunctionTestCase(TestBase):
@@ -21,9 +22,9 @@ class ExprCommandCallFunctionTestCase(TestBase):
self.line = line_number('main.cpp',
'// Please test these expressions while stopped at this line:')
- @expectedFailureIcc # llvm.org/pr14437, fails with ICC 13.1
- @expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr14437, fails with ICC 13.1")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr17807 Fails on FreeBSD buildbot')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_with(self):
"""Test calling std::String member function."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index f6d63885248a..4d18cfc980f2 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandCallStopContinueTestCase(TestBase):
@@ -24,7 +25,7 @@ class ExprCommandCallStopContinueTestCase(TestBase):
'{ 5, "five" }')
@expectedFlakeyDarwin("llvm.org/pr20274")
- @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test gathering result from interrupted function call."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index 9138af0b0b47..c0727a84fc02 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -12,8 +12,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandCallUserDefinedFunction(TestBase):
@@ -26,7 +27,7 @@ class ExprCommandCallUserDefinedFunction(TestBase):
self.line = line_number('main.cpp',
'// Please test these expressions while stopped at this line:')
@expectedFlakeyDsym("llvm.org/pr20274")
- @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test return values of user defined function calls."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py b/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
index abf48742567d..6b754a76878b 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandThatRestartsTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py b/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
index 0e766ac2953a..a6eb1bddc005 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandWithThrowTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
index 5e1f307f622d..66fa69cdfff2 100644
--- a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -3,8 +3,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCharTestCase(TestBase):
@@ -52,19 +53,17 @@ class ExprCharTestCase(TestBase):
self.assertTrue(value.GetError().Success())
self.assertEqual(value.GetValueAsSigned(0), 3)
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_default_char(self):
self.do_test()
- @expectedFailureArch("arm", "llvm.org/pr23069")
- @expectedFailureArch("aarch64", "llvm.org/pr23069")
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(archs=["arm", "aarch64", "s390x"], bugnumber="llvm.org/pr23069")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_signed_char(self):
self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
- @expectedFailurei386("llvm.org/pr23069")
- @expectedFailurex86_64("llvm.org/pr23069")
- @expectedFailureWindows("llvm.org/pr21765")
- @expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*')
+ @expectedFailureAll(archs=["i[3-6]86", "x86_64"], bugnumber="llvm.org/pr23069")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
+ @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
def test_unsigned_char(self):
self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})
diff --git a/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
index 0430fa55f995..a715ee31e5fa 100644
--- a/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
+++ b/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
@@ -6,15 +6,16 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class ExprSyscallTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr21765") # Also getpid() is not a function on Windows anyway
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765, getpid() does not exist on Windows")
def test_setpgid(self):
self.build()
self.expr_syscall()
diff --git a/packages/Python/lldbsuite/test/expression_command/fixits/Makefile b/packages/Python/lldbsuite/test/expression_command/fixits/Makefile
new file mode 100644
index 000000000000..7df664ac43e3
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/fixits/Makefile
@@ -0,0 +1,12 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+# targets. Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+ CFLAGS_EXTRAS += -fno-limit-debug-info
+endif
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py b/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py
new file mode 100644
index 000000000000..7e11f2b201f2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py
@@ -0,0 +1,81 @@
+"""
+Test calling an expression with errors that a FixIt can fix.
+"""
+
+from __future__ import print_function
+
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class ExprCommandWithFixits(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ self.main_source = "main.cpp"
+ self.main_source_spec = lldb.SBFileSpec (self.main_source)
+
+ @skipUnlessDarwin
+ def test(self):
+ """Test calling a function that throws and ObjC exception."""
+ self.build()
+ self.try_expressions()
+
+ def try_expressions(self):
+ """Test calling expressions with errors that can be fixed by the FixIts."""
+ exe_name = "a.out"
+ exe = os.path.join(os.getcwd(), exe_name)
+
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ breakpoint = target.BreakpointCreateBySourceRegex('Stop here to evaluate expressions',self.main_source_spec)
+ self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT)
+
+ # Launch the process, and do not stop at the entry point.
+ process = target.LaunchSimple (None, None, self.get_process_working_directory())
+
+ self.assertTrue(process, PROCESS_IS_VALID)
+
+ # Frame #0 should be at our breakpoint.
+ threads = lldbutil.get_threads_stopped_at_breakpoint (process, breakpoint)
+
+ self.assertTrue(len(threads) == 1)
+ self.thread = threads[0]
+
+ options = lldb.SBExpressionOptions()
+ options.SetAutoApplyFixIts(True)
+
+ frame = self.thread.GetFrameAtIndex(0)
+
+ # Try with one error:
+ value = frame.EvaluateExpression("my_pointer.first", options)
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Success())
+ self.assertTrue(value.GetValueAsUnsigned() == 10)
+
+ # Try with two errors:
+ two_error_expression = "my_pointer.second->a"
+ value = frame.EvaluateExpression(two_error_expression, options)
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Success())
+ self.assertTrue(value.GetValueAsUnsigned() == 20)
+
+ # Now turn off the fixits, and the expression should fail:
+ options.SetAutoApplyFixIts(False)
+ value = frame.EvaluateExpression(two_error_expression, options)
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Fail())
+ error_string = value.GetError().GetCString()
+ self.assertTrue(error_string.find("fixed expression suggested:") != -1, "Fix was suggested")
+ self.assertTrue(error_string.find("my_pointer->second.a") != -1, "Fix was right")
+
+
+
diff --git a/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp b/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp
new file mode 100644
index 000000000000..371d8333763b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+struct SubStruct
+{
+ int a;
+ int b;
+};
+
+struct MyStruct
+{
+ int first;
+ struct SubStruct second;
+};
+
+int
+main()
+{
+ struct MyStruct my_struct = {10, {20, 30}};
+ struct MyStruct *my_pointer = &my_struct;
+ printf ("Stop here to evaluate expressions: %d %d %p\n", my_pointer->first, my_pointer->second.a, my_pointer);
+ return 0;
+}
+
+
+
diff --git a/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py b/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
index 3f47206480c3..4a99dc479019 100644
--- a/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
+++ b/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprFormattersTestCase(TestBase):
@@ -22,9 +23,8 @@ class ExprFormattersTestCase(TestBase):
'// Stop here')
@skipIfFreeBSD # llvm.org/pr24691 skipping to avoid crashing the test runner
- @expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 complete object constructor
- @expectedFailureFreeBSD('llvm.org/pr24691') # we hit an assertion in clang
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19011 Newer Clang omits C1 complete object constructor')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
@skipIfTargetAndroid() # skipping to avoid crashing the test runner
@expectedFailureAndroid('llvm.org/pr24691') # we hit an assertion in clang
def test(self):
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/Makefile b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
new file mode 100644
index 000000000000..c4f176703225
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
@@ -0,0 +1,40 @@
+"""
+Test PHI nodes work in the IR interpreter.
+"""
+
+import os, os.path
+
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class IRInterpreterPHINodesTestCase(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_phi_node_support(self):
+ """Test support for PHI nodes in the IR interpreter."""
+
+ self.build()
+ exe = os.path.join(os.getcwd(), 'a.out')
+ self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break on the first assignment to i
+ line = line_number('main.cpp', 'i = 5')
+ lldbutil.run_break_set_by_file_and_line(self, 'main.cpp', line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd('run', RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint
+ self.expect('thread list', STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped', 'stop reason = breakpoint'])
+
+ self.runCmd('s')
+
+ # The logical 'or' causes a PHI node to be generated. Execute without JIT
+ # to test that the interpreter can handle this
+ self.expect('expr -j 0 -- i == 3 || i == 5', substrs=['true'])
+
+ self.runCmd('s')
+ self.expect('expr -j 0 -- i == 3 || i == 5', substrs=['false'])
+ self.runCmd('s')
+ self.expect('expr -j 0 -- i == 3 || i == 5', substrs=['true'])
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/main.cpp b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/main.cpp
new file mode 100644
index 000000000000..b144f9cc1b47
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/main.cpp
@@ -0,0 +1,17 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+ int i;
+ i = 5;
+ i = 2;
+ i = 3;
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile
new file mode 100644
index 000000000000..c4169a9b1012
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile
@@ -0,0 +1,7 @@
+LEVEL = ../../make
+
+default: a.out
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
new file mode 100644
index 000000000000..2a21d0473715
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
@@ -0,0 +1,72 @@
+"""
+Test the IR interpreter
+"""
+
+from __future__ import print_function
+
+import unittest2
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class IRInterpreterTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break for main.c.
+ self.line = line_number('main.c',
+ '// Set breakpoint here')
+
+ # Disable confirmation prompt to avoid infinite wait
+ self.runCmd("settings set auto-confirm true")
+ self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+
+ def build_and_run(self):
+ """Test the IR interpreter"""
+ self.build()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ @add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=['windows'], bugnumber="http://llvm.org/pr21765") # getpid() is POSIX, among other problems, see bug
+ @expectedFailureAll(oslist=['linux'], archs=['arm'], bugnumber="llvm.org/pr27868")
+ def test_ir_interpreter(self):
+ self.build_and_run()
+
+ options = lldb.SBExpressionOptions()
+ options.SetLanguage(lldb.eLanguageTypeC_plus_plus)
+
+ set_up_expressions = ["int $i = 9", "int $j = 3", "int $k = 5"]
+
+ expressions = ["$i + $j",
+ "$i - $j",
+ "$i * $j",
+ "$i / $j",
+ "$i % $k",
+ "$i << $j",
+ "$i & $j",
+ "$i | $j",
+ "$i ^ $j"]
+
+ for expression in set_up_expressions:
+ self.frame().EvaluateExpression(expression, options)
+
+ for expression in expressions:
+ interp_expression = expression
+ jit_expression = "(int)getpid(); " + expression
+
+ interp_result = self.frame().EvaluateExpression(interp_expression, options).GetValueAsSigned()
+ jit_result = self.frame().EvaluateExpression(jit_expression, options).GetValueAsSigned()
+
+ self.assertEqual(interp_result, jit_result, "While evaluating " + expression)
+
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c
new file mode 100644
index 000000000000..31204b21d972
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+ printf("This is a dummy\n"); // Set breakpoint here
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py b/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
index fdc981ea178d..2d0b23b4e5ba 100644
--- a/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
+++ b/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
@@ -10,14 +10,15 @@ from __future__ import print_function
import os, time
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class Issue11581TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_11581_commands(self):
# This is the function to remove the custom commands in order to have a
# clean slate for the next test case.
diff --git a/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py b/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
index c3d6306c5a63..939d2e45d7d5 100644
--- a/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
+++ b/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
@@ -1,13 +1,17 @@
+from __future__ import print_function
+
+
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class TestMacros(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureClang("clang does not emit .debug_macro[.dwo] sections.")
- @expectedFailureDwo("GCC produces multiple .debug_macro.dwo sections and the spec is unclear as to what it means")
+ @expectedFailureAll(compiler="clang", bugnumber="clang does not emit .debug_macro[.dwo] sections.")
+ @expectedFailureAll(debug_info="dwo", bugnumber="GCC produces multiple .debug_macro.dwo sections and the spec is unclear as to what it means")
@expectedFailureAll(hostoslist=["windows"], compiler="gcc", triple='.*-android')
def test_expr_with_macros(self):
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/multiline/Makefile b/packages/Python/lldbsuite/test/expression_command/multiline/Makefile
new file mode 100644
index 000000000000..0d70f2595019
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/multiline/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py b/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
new file mode 100644
index 000000000000..0691a866743b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
@@ -0,0 +1,57 @@
+"""Test multiline expressions."""
+
+from __future__ import print_function
+
+import os
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class MultilineExpressionsTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break on inside main.cpp.
+ self.line = line_number('main.c', 'break')
+
+ @skipIfRemote
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ def test_with_run_commands(self):
+ """Test that multiline expressions work correctly"""
+ self.build()
+ import pexpect
+ exe = os.path.join(os.getcwd(), "a.out")
+ prompt = "(lldb) "
+
+ # So that the child gets torn down after the test.
+ self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec, self.lldbOption, exe))
+ child = self.child
+ # Turn on logging for what the child sends back.
+ if self.TraceOn():
+ child.logfile_read = sys.stdout
+
+ # Set the breakpoint, run the inferior, when it breaks, issue print on
+ # the various convenience variables.
+ child.expect_exact(prompt)
+ child.sendline('breakpoint set -f main.c -l %d' % self.line)
+ child.expect_exact(prompt)
+ child.sendline('run')
+ child.expect_exact("stop reason = breakpoint 1.1")
+ child.expect_exact(prompt)
+ child.sendline('expr')
+ child.expect_exact('1:')
+
+ child.sendline('2+')
+ child.expect_exact('2:')
+
+ child.sendline('3')
+ child.expect_exact('3:')
+
+ child.sendline('')
+ child.expect_exact(prompt)
+ self.expect(child.before, exe=False,
+ patterns = ['= 5'])
diff --git a/packages/Python/lldbsuite/test/expression_command/multiline/main.c b/packages/Python/lldbsuite/test/expression_command/multiline/main.c
new file mode 100644
index 000000000000..da16b1e7846f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/multiline/main.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(int argc, char const *argv[]) {
+ printf("Hello world.\n"); // break here
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
index 7b0707cdf22c..d3ce10d8f2ab 100644
--- a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
+++ b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class PersistObjCPointeeType(TestBase):
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
index 3ea5b7040655..9099ae1806e3 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
@@ -8,13 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class NestedPersistentTypesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_persistent_types(self):
"""Test that nested persistent types work."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
index 47c6675511fd..59e0f0b84f69 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
@@ -8,13 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class PersistenttypesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_persistent_types(self):
"""Test that lldb persistent types works correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py b/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
index e415b92a43a6..da87bcee9cfc 100644
--- a/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
+++ b/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class PoVerbosityTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
index fb16d2a93326..e0b219dbe2b9 100644
--- a/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
+++ b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
@@ -8,15 +8,16 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class Radar9531204TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
# rdar://problem/9531204
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands(self):
"""The evaluating printf(...) after break stop and then up a stack frame."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py b/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
index ce3e51d05149..a1505b08c508 100644
--- a/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
+++ b/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class Radar9673644TestCase(TestBase):
@@ -22,7 +23,7 @@ class Radar9673644TestCase(TestBase):
self.main_source = "main.c"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands(self):
"""The following expression commands should just work."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py b/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
index ec3e7f93af26..8c9a9a5a27e7 100644
--- a/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
+++ b/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
@@ -19,8 +19,9 @@ import unittest2
import os, time
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class BasicExprCommandsTestCase(TestBase):
@@ -56,7 +57,6 @@ class BasicExprCommandsTestCase(TestBase):
patterns = ["\(float\) \$.* = 2\.234"])
# (float) $2 = 2.234
- @expectedFailureWindows("llvm.org/pr21765")
def test_many_expr_commands(self):
self.build_and_run()
@@ -98,7 +98,7 @@ class BasicExprCommandsTestCase(TestBase):
# (const char *) $8 = 0x... "/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out"
@add_test_categories(['pyapi'])
- @expectedFailureWindows # Test crashes
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_evaluate_expression_python(self):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
self.build()
@@ -130,12 +130,8 @@ class BasicExprCommandsTestCase(TestBase):
"instead the actual state is: '%s'" %
lldbutil.state_type_to_str(process.GetState()))
- # The stop reason of the thread should be breakpoint.
- thread = process.GetThreadAtIndex(0)
- if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
- from lldbsuite.test.lldbutil import stop_reason_to_str
- self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
- stop_reason_to_str(thread.GetStopReason()))
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
+ self.assertIsNotNone(thread, "Expected one thread to be stopped at the breakpoint")
# The filename of frame #0 should be 'main.cpp' and function is main.
self.expect(lldbutil.get_filenames(thread)[0],
@@ -198,7 +194,7 @@ class BasicExprCommandsTestCase(TestBase):
# rdar://problem/8686536
# CommandInterpreter::HandleCommand is stripping \'s from input for WantsRawCommand commands
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands_can_handle_quotes(self):
"""Throw some expression commands with quotes at lldb."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py b/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
index 578a037e9f0f..523ee51a9f18 100644
--- a/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
+++ b/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommands2TestCase(TestBase):
@@ -22,7 +23,7 @@ class ExprCommands2TestCase(TestBase):
self.line = line_number('main.cpp',
'// Please test many expressions while stopped at this line:')
- @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test_more_expr_commands(self):
"""Test some more expression commands."""
self.build()
diff --git a/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py b/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
index a602afc47edb..7cb4a647efb4 100644
--- a/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
+++ b/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
@@ -7,8 +7,9 @@ from __future__ import print_function
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprCommandWithTimeoutsTestCase(TestBase):
@@ -23,8 +24,7 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
@expectedFlakeyFreeBSD("llvm.org/pr19605")
- @expectedFlakeyLinux("llvm.org/pr20275")
- @expectedFailureWindows("llvm.org/pr21765")
+ @expectedFailureAll(oslist=["windows", "macosx"], bugnumber="llvm.org/pr21765")
def test(self):
"""Test calling std::String member function."""
self.build()
@@ -57,7 +57,7 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
frame = thread.GetFrameAtIndex(0)
- value = frame.EvaluateExpression ("wait_a_while (200000)", options)
+ value = frame.EvaluateExpression("wait_a_while(300000)", options)
self.assertTrue (value.IsValid())
self.assertFalse (value.GetError().Success())
@@ -65,7 +65,7 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
interp = self.dbg.GetCommandInterpreter()
result = lldb.SBCommandReturnObject()
- return_value = interp.HandleCommand ("expr -t 100 -u true -- wait_a_while(200000)", result)
+ return_value = interp.HandleCommand("expr -t 100 -u true -- wait_a_while(300000)", result)
self.assertTrue (return_value == lldb.eReturnStatusFailed)
# Okay, now do it again with long enough time outs:
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/Makefile b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile
new file mode 100644
index 000000000000..7146f227b98a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile
@@ -0,0 +1,12 @@
+LEVEL = ../../make
+
+default: a.out dummy
+
+CXX_SOURCES := main.cpp test.cpp
+
+dummy: dummy.cpp
+
+clean::
+ rm -rf dummy dummy.dSYM
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
new file mode 100644
index 000000000000..9a17624cb8e6
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
@@ -0,0 +1,89 @@
+"""
+Test top-level expressions.
+"""
+
+from __future__ import print_function
+
+
+
+import unittest2
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TopLevelExpressionsTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break for main.c.
+ self.line = line_number('main.cpp',
+ '// Set breakpoint here')
+ self.dummy_line = line_number('dummy.cpp',
+ '// Set breakpoint here')
+
+ # Disable confirmation prompt to avoid infinite wait
+ self.runCmd("settings set auto-confirm true")
+ self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+
+
+ def build_and_run(self):
+ """Test top-level expressions."""
+ self.build()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ def run_dummy(self):
+ self.runCmd("file dummy", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "dummy.cpp", self.dummy_line, num_expected_locations=1, loc_exact=False)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ @add_test_categories(['pyapi'])
+ @expectedFailureAndroid(api_levels=[21, 22], bugnumber="llvm.org/pr27787")
+ @expectedFailureAll(oslist=["linux"], archs=["arm", "aarch64"], bugnumber="llvm.org/pr27787")
+ @expectedFailureAll(bugnumber="llvm.org/pr28353", oslist=["linux"], archs=["i386", "x86_64"], compiler="gcc", compiler_version=["<", "4.9"])
+ @skipIf(debug_info="gmodules") # not relevant
+ @skipIf(oslist=["windows"]) # Error in record layout on Windows
+ def test_top_level_expressions(self):
+ self.build_and_run()
+
+ resultFromCode = self.frame().EvaluateExpression("doTest()").GetValueAsUnsigned()
+
+ self.runCmd("kill")
+
+ self.run_dummy()
+
+ codeFile = open('test.cpp', 'r')
+
+ expressions = []
+ current_expression = ""
+
+ for line in codeFile:
+ if line.startswith("// --"):
+ expressions.append(current_expression)
+ current_expression = ""
+ else:
+ current_expression += line
+
+ options = lldb.SBExpressionOptions()
+ options.SetLanguage(lldb.eLanguageTypeC_plus_plus)
+ options.SetTopLevel(True)
+
+ for expression in expressions:
+ self.frame().EvaluateExpression(expression, options)
+
+ resultFromTopLevel = self.frame().EvaluateExpression("doTest()")
+
+ self.assertTrue(resultFromTopLevel.IsValid())
+ self.assertEqual(resultFromCode, resultFromTopLevel.GetValueAsUnsigned())
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
new file mode 100644
index 000000000000..31204b21d972
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+ printf("This is a dummy\n"); // Set breakpoint here
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/main.cpp b/packages/Python/lldbsuite/test/expression_command/top-level/main.cpp
new file mode 100644
index 000000000000..f9b2dd4c6d9d
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/main.cpp
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+extern int doTest();
+
+int main()
+{
+ printf("%d\n", doTest()); // Set breakpoint here
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp b/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp
new file mode 100644
index 000000000000..ce2ea3bbb131
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp
@@ -0,0 +1,107 @@
+class MyClass
+{
+public:
+ int memberResult()
+ {
+ return 1;
+ }
+ static int staticResult()
+ {
+ return 1;
+ }
+ int externResult();
+};
+
+// --
+
+int MyClass::externResult()
+{
+ return 1;
+}
+
+// --
+
+MyClass m;
+
+// --
+
+enum MyEnum {
+ myEnumOne = 1,
+ myEnumTwo,
+ myEnumThree
+};
+
+// --
+
+class AnotherClass
+{
+public:
+ __attribute__ ((always_inline)) int complicatedFunction()
+ {
+ struct {
+ int i;
+ } s = { 15 };
+
+ int as[4] = { 2, 3, 4, 5 };
+
+ for (signed char a : as)
+ {
+ s.i -= a;
+ }
+
+ return s.i;
+ }
+};
+
+// --
+
+class DiamondA
+{
+private:
+ struct {
+ int m_i;
+ };
+public:
+ DiamondA(int i) : m_i(i) { }
+ int accessor() { return m_i; }
+};
+
+// --
+
+class DiamondB : public virtual DiamondA
+{
+public:
+ DiamondB(int i) : DiamondA(i) { }
+};
+
+// --
+
+class DiamondC : public virtual DiamondA
+{
+public:
+ DiamondC(int i) : DiamondA(i) { }
+};
+
+// --
+
+class DiamondD : public DiamondB, public DiamondC
+{
+public:
+ DiamondD(int i) : DiamondA(i), DiamondB(i), DiamondC(i) { }
+};
+
+// --
+
+int doTest()
+{
+ int a = m.memberResult();
+ a += MyClass::staticResult();
+ a += m.externResult();
+ a += MyEnum::myEnumThree;
+ a += myEnumOne;
+ a += AnotherClass().complicatedFunction();
+ a += DiamondD(3).accessor();
+ return a;
+}
+
+// --
diff --git a/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
index 5b0233509112..2b37faad807b 100644
--- a/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class ObjCTypeQueryTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/expression_command/unwind_expression/Makefile b/packages/Python/lldbsuite/test/expression_command/unwind_expression/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/unwind_expression/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py b/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
new file mode 100644
index 000000000000..6e9af641d038
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
@@ -0,0 +1,83 @@
+"""
+Test stopping at a breakpoint in an expression, and unwinding from there.
+"""
+
+from __future__ import print_function
+
+
+
+import unittest2
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class UnwindFromExpressionTest(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ @add_test_categories(['pyapi'])
+
+ def test_unwind_expression(self):
+ """Test unwinding from an expression."""
+ self.build()
+
+ exe = os.path.join(os.getcwd(), "a.out")
+
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ # Create the breakpoint.
+ main_spec = lldb.SBFileSpec("main.cpp", False)
+ breakpoint = target.BreakpointCreateBySourceRegex("// Set a breakpoint here to get started", main_spec)
+ self.assertTrue(breakpoint, VALID_BREAKPOINT)
+
+ # Launch the process, and do not stop at the entry point.
+ process = target.LaunchSimple (None, None, self.get_process_working_directory())
+
+ if not process:
+ self.fail("SBTarget.LaunchProcess() failed")
+
+ if process.GetState() != lldb.eStateStopped:
+ self.fail("Process should be in the 'stopped' state, "
+ "instead the actual state is: '%s'" %
+ lldbutil.state_type_to_str(process.GetState()))
+
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
+ self.assertIsNotNone(thread, "Expected one thread to be stopped at the breakpoint")
+
+ #
+ # Use Python API to evaluate expressions while stopped in a stack frame.
+ #
+ main_frame = thread.GetFrameAtIndex(0)
+
+ # Next set a breakpoint in this function, set up Expression options to stop on
+ # breakpoint hits, and call the function.
+ fun_bkpt = target.BreakpointCreateBySourceRegex("// Stop inside the function here.", main_spec)
+ self.assertTrue(fun_bkpt, VALID_BREAKPOINT)
+ options = lldb.SBExpressionOptions()
+ options.SetIgnoreBreakpoints(False)
+ options.SetUnwindOnError(False)
+
+ val = main_frame.EvaluateExpression("a_function_to_call()", options)
+
+ self.assertTrue(val.GetError().Fail(), "We did not complete the execution.")
+ error_str = val.GetError().GetCString()
+ self.assertTrue("Execution was interrupted, reason: breakpoint" in error_str, "And the reason was right.")
+
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, fun_bkpt)
+ self.assertTrue(thread.IsValid(), "We are indeed stopped at our breakpoint")
+
+ # Now unwind the expression, and make sure we got back to where we started.
+ error = thread.UnwindInnermostExpression()
+ self.assertTrue(error.Success(), "We succeeded in unwinding")
+
+ cur_frame = thread.GetFrameAtIndex(0)
+ self.assertTrue(cur_frame.IsEqual(main_frame), "We got back to the main frame.")
+
diff --git a/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp b/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp
new file mode 100644
index 000000000000..e93c34a30b03
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp
@@ -0,0 +1,14 @@
+static int static_value = 0;
+
+int
+a_function_to_call()
+{
+ static_value++; // Stop inside the function here.
+ return static_value;
+}
+
+int main (int argc, char const *argv[])
+{
+ a_function_to_call(); // Set a breakpoint here to get started
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py b/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py
index 1bce5bed491f..6423ecf27aeb 100644
--- a/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py
+++ b/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py
@@ -8,14 +8,14 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class AbbreviationsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFlakeyFreeBSD("llvm.org/pr22611 thread race condition breaks prompt setting")
@no_debug_info_test
def test_command_abbreviations_and_aliases (self):
command_interpreter = self.dbg.GetCommandInterpreter()
diff --git a/packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py b/packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py
index 9edbf212278c..fa6f3f306898 100644
--- a/packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py
+++ b/packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class CommonShortSpellingsTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/apropos_with_process/Makefile b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
new file mode 100644
index 000000000000..66ed3ff73298
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
@@ -0,0 +1,44 @@
+"""
+Test that apropos env doesn't crash trying to touch the process plugin commmand
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import re
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class AproposWithProcessTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break inside main().
+ self.line = line_number('main.cpp', '// break here')
+
+ def test_apropos_with_process(self):
+ """Test that apropos env doesn't crash trying to touch the process plugin commmand."""
+ self.build()
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break in main() aftre the variables are assigned values.
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped', 'stop reason = breakpoint'])
+
+ # The breakpoint should have a hit count of 1.
+ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
+ substrs = [' resolved, hit count = 1'])
+
+ self.runCmd('apropos env')
diff --git a/packages/Python/lldbsuite/test/functionalities/apropos_with_process/main.cpp b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/main.cpp
new file mode 100644
index 000000000000..44c149687f21
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/main.cpp
@@ -0,0 +1,15 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdio.h>
+
+int main (int argc, char const *argv[])
+{
+ return 0; // break here
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py b/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
index 02e1b9551853..b419ad97a694 100644
--- a/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
+++ b/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
@@ -6,8 +6,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class BSDArchivesTestCase(TestBase):
@@ -19,7 +20,8 @@ class BSDArchivesTestCase(TestBase):
# Find the line number in a(int) to break at.
self.line = line_number('a.c', '// Set file and line breakpoint inside a().')
- @expectedFailureWindows("llvm.org/pr24527") # Makefile.rules doesn't know how to build static libs on Windows.
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24527. Makefile.rules doesn't know how to build static libs on Windows")
+ @expectedFailureAll(oslist=["linux"], archs=["arm", "aarch64"], bugnumber="llvm.org/pr27795")
def test(self):
"""Break inside a() and b() defined within libfoo.a."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py b/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
index e92b967d8adf..6416bccc483d 100644
--- a/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
+++ b/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
@@ -8,18 +8,19 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbplatform
+from lldbsuite.test import lldbutil
class AsanTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureLinux # non-core functionality, need to reenable and fix later (DES 2014.11.07)
+ @expectedFailureAll(oslist=["linux"], bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
@skipUnlessCompilerRt
- @expectedFailureDarwin
def test (self):
self.build ()
self.asan_tests ()
@@ -45,11 +46,10 @@ class AsanTestCase(TestBase):
self.runCmd("run")
- # ASan will relaunch the process to insert its library.
- self.expect("thread list", "Process should be stopped due to exec.",
- substrs = ['stopped', 'stop reason = '])
-
- self.runCmd("continue")
+ stop_reason = self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason()
+ if stop_reason == lldb.eStopReasonExec:
+ # On OS X 10.10 and older, we need to re-exec to enable interceptors.
+ self.runCmd("continue")
# the stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
@@ -62,8 +62,8 @@ class AsanTestCase(TestBase):
# test the 'memory history' command
self.expect("memory history 'pointer'",
substrs = [
- 'Memory allocated at', 'a.out`f1', 'main.c:%d' % self.line_malloc,
- 'Memory deallocated at', 'a.out`f2', 'main.c:%d' % self.line_free])
+ 'Memory allocated by Thread', 'a.out`f1', 'main.c:%d' % self.line_malloc,
+ 'Memory deallocated by Thread', 'a.out`f2', 'main.c:%d' % self.line_free])
# do the same using SB API
process = self.dbg.GetSelectedTarget().process
@@ -87,17 +87,14 @@ class AsanTestCase(TestBase):
self.assertTrue(history_thread.num_frames >= 2)
self.assertEqual(history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(), "main.c")
self.assertEqual(history_thread.frames[1].GetLineEntry().GetLine(), self.line_malloc)
-
- # now let's break when an ASan report occurs and try the API then
- self.runCmd("breakpoint set -n __asan_report_error")
-
+
+ # ASan will break when a report occurs and we'll try the API then
self.runCmd("continue")
- # the stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped', 'stop reason = breakpoint'])
+ self.expect("thread list", "Process should be stopped due to ASan report",
+ substrs = ['stopped', 'stop reason = Use of deallocated memory detected'])
# make sure the 'memory history' command still works even when we're generating a report now
self.expect("memory history 'another_pointer'",
substrs = [
- 'Memory allocated at', 'a.out`f1', 'main.c:%d' % self.line_malloc2])
+ 'Memory allocated by Thread', 'a.out`f1', 'main.c:%d' % self.line_malloc2])
diff --git a/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py b/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
index 4ef587895196..b02732ddeddf 100644
--- a/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
+++ b/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
@@ -7,20 +7,20 @@ from __future__ import print_function
import os, time
+import json
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import json
+from lldbsuite.test import lldbutil
class AsanTestReportDataCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureLinux # non-core functionality, need to reenable and fix later (DES 2014.11.07)
+ @expectedFailureAll(oslist=["linux"], bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
@skipUnlessCompilerRt
- @expectedFailureDarwin
def test(self):
self.build ()
self.asan_tests ()
@@ -39,16 +39,10 @@ class AsanTestReportDataCase(TestBase):
self.expect("file " + exe, patterns = [ "Current executable set to .*a.out" ])
self.runCmd("run")
- # ASan will relaunch the process to insert its library.
- self.expect("thread list", "Process should be stopped due to exec.",
- substrs = ['stopped', 'stop reason = '])
-
- # no extended info when we have no ASan report
- thread = self.dbg.GetSelectedTarget().process.GetSelectedThread()
- s = lldb.SBStream()
- self.assertFalse(thread.GetStopReasonExtendedInfoAsJSON(s))
-
- self.runCmd("continue")
+ stop_reason = self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason()
+ if stop_reason == lldb.eStopReasonExec:
+ # On OS X 10.10 and older, we need to re-exec to enable interceptors.
+ self.runCmd("continue")
self.expect("thread list", "Process should be stopped due to ASan report",
substrs = ['stopped', 'stop reason = Use of deallocated memory detected'])
@@ -62,7 +56,7 @@ class AsanTestReportDataCase(TestBase):
substrs = ["access_size", "access_type", "address", "pc", "description", "heap-use-after-free"])
output_lines = self.res.GetOutput().split('\n')
- json_line = output_lines[2]
+ json_line = '\n'.join(output_lines[2:])
data = json.loads(json_line)
self.assertEqual(data["description"], "heap-use-after-free")
self.assertEqual(data["instrumentation_class"], "AddressSanitizer")
diff --git a/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py b/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
index 693c0a70fd62..54463c56827a 100644
--- a/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
+++ b/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
exe_name = "AttachResume" # Must match Makefile
@@ -18,8 +19,8 @@ class AttachResumeTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfRemote
- @expectedFailureFreeBSD('llvm.org/pr19310')
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19310')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_attach_continue_interrupt_detach(self):
"""Test attach/continue/interrupt/detach"""
self.build()
@@ -37,19 +38,20 @@ class AttachResumeTestCase(TestBase):
self.setAsync(True)
listener = self.dbg.GetListener()
+ process = self.dbg.GetSelectedTarget().GetProcess()
self.runCmd("c")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateRunning])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateRunning])
self.runCmd("process interrupt")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateStopped])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateStopped])
# be sure to continue/interrupt/continue (r204504)
self.runCmd("c")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateRunning])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateRunning])
self.runCmd("process interrupt")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateStopped])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateStopped])
# Second interrupt should have no effect.
self.expect("process interrupt", patterns=["Process is not running"], error=True)
@@ -58,7 +60,7 @@ class AttachResumeTestCase(TestBase):
self.runCmd("br set -f main.cpp -l %u" % (line_number('main.cpp', '// Set breakpoint here')))
self.runCmd("c")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateRunning, lldb.eStateStopped])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateRunning, lldb.eStateStopped])
self.expect('br list', 'Breakpoint not hit',
substrs = ['hit count = 1'])
@@ -66,8 +68,8 @@ class AttachResumeTestCase(TestBase):
self.expect("expr debugger_flag = false", substrs=[" = false"]);
self.runCmd("c")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateRunning])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateRunning])
# make sure to detach while in running state (r204759)
self.runCmd("detach")
- lldbutil.expect_state_changes(self, listener, [lldb.eStateDetached])
+ lldbutil.expect_state_changes(self, listener, process, [lldb.eStateDetached])
diff --git a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
index e4bc08711f4c..e31eac48ad7a 100644
--- a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
+++ b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
@@ -8,29 +8,34 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test import lldbutil
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
def python_leaky_fd_version(test):
import sys
# Python random module leaks file descriptors on some versions.
- return sys.version_info >= (2, 7, 8) and sys.version_info < (2, 7, 10)
+ if sys.version_info >= (2, 7, 8) and sys.version_info < (2, 7, 10):
+ return "Python random module leaks file descriptors in this python version"
+ return None
class AvoidsFdLeakTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
mydir = TestBase.compute_mydir(__file__)
@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
- @expectedFailureFreeBSD("llvm.org/pr25624 still failing with Python 2.7.10")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
@skipIfWindows # The check for descriptor leakage needs to be implemented differently here.
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
def test_fd_leak_basic (self):
self.do_test([])
@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
- @expectedFailureFreeBSD("llvm.org/pr25624 still failing with Python 2.7.10")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
@skipIfWindows # The check for descriptor leakage needs to be implemented differently here.
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
def test_fd_leak_log (self):
@@ -53,8 +58,7 @@ class AvoidsFdLeakTestCase(TestBase):
"Process returned non-zero status. Were incorrect file descriptors passed?")
@expectedFailure(python_leaky_fd_version, "bugs.freebsd.org/197376")
- @expectedFailureFreeBSD("llvm.org/pr25624 still failing with Python 2.7.10")
- @expectedFlakeyLinux
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25624 still failing with Python 2.7.10")
@skipIfWindows # The check for descriptor leakage needs to be implemented differently here.
@skipIfTargetAndroid() # Android have some other file descriptors open by the shell
def test_fd_leak_multitarget (self):
diff --git a/packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py b/packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py
index d31412bc783c..851e4d376b38 100644
--- a/packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py
+++ b/packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py
@@ -8,7 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class BackticksWithNoTargetTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
new file mode 100644
index 000000000000..73b3ef5eae28
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
@@ -0,0 +1,77 @@
+"""
+Test that breakpoints set on a bad address say they are bad.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import re
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+class BadAddressBreakpointTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_bad_address_breakpoints (self):
+ """Test that breakpoints set on a bad address say they are bad."""
+ self.build()
+ self.address_breakpoints()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def address_breakpoints(self):
+ """Test that breakpoints set on a bad address say they are bad."""
+ exe = os.path.join(os.getcwd(), "a.out")
+
+ # Create a target by the debugger.
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ # Now create a breakpoint on main.c by name 'c'.
+ breakpoint = target.BreakpointCreateBySourceRegex("Set a breakpoint here", lldb.SBFileSpec("main.c"))
+ self.assertTrue(breakpoint and
+ breakpoint.GetNumLocations() == 1,
+ VALID_BREAKPOINT)
+
+ # Get the breakpoint location from breakpoint after we verified that,
+ # indeed, it has one location.
+ location = breakpoint.GetLocationAtIndex(0)
+ self.assertTrue(location and
+ location.IsEnabled(),
+ VALID_BREAKPOINT_LOCATION)
+
+ launch_info = lldb.SBLaunchInfo(None)
+
+ error = lldb.SBError()
+
+ process = target.Launch (launch_info, error)
+ self.assertTrue(process, PROCESS_IS_VALID)
+
+ # Did we hit our breakpoint?
+ from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint
+ threads = get_threads_stopped_at_breakpoint (process, breakpoint)
+ self.assertTrue(len(threads) == 1, "There should be a thread stopped at our breakpoint")
+
+ # The hit count for the breakpoint should be 1.
+ self.assertTrue(breakpoint.GetHitCount() == 1)
+
+ # Now see if we can read from 0. If I can't do that, I don't have a good way to know
+ # what an illegal address is...
+ error.Clear()
+
+ ptr = process.ReadPointerFromMemory(0x0, error)
+
+ if not error.Success():
+ bkpt = target.BreakpointCreateByAddress(0x0)
+ for bp_loc in bkpt:
+ self.assertTrue(bp_loc.IsResolved() == False)
+ else:
+ self.fail("Could not find an illegal address at which to set a bad breakpoint.")
+
+
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile
new file mode 100644
index 000000000000..6067ee45e984
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c
+CFLAGS_EXTRAS += -std=c99
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
new file mode 100644
index 000000000000..aa4ee14ffc5a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
@@ -0,0 +1,121 @@
+"""
+Test case sensitivity of paths on Windows / POSIX
+llvm.org/pr22667
+"""
+
+import os
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from lldbsuite.test import lldbplatform, lldbplatformutil
+
+class BreakpointCaseSensitivityTestCase(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+ BREAKPOINT_TEXT = 'Set a breakpoint here'
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ self.line = line_number('main.c', self.BREAKPOINT_TEXT)
+
+ @skipIf(oslist=no_match(['windows'])) # Skip for non-windows platforms
+ def test_breakpoint_matches_file_with_different_case(self):
+ """Set breakpoint on file, should match files with different case on Windows"""
+ self.build()
+ self.case_sensitivity_breakpoint(True)
+
+ @skipIf(oslist=['windows']) # Skip for windows platforms
+ @expectedFailureAll() # Failing for unknown reason on non-Windows platforms.
+ def test_breakpoint_doesnt_match_file_with_different_case(self):
+ """Set breakpoint on file, shouldn't match files with different case on POSIX systems"""
+ self.build()
+ self.case_sensitivity_breakpoint(False)
+
+ def case_sensitivity_breakpoint(self, case_insensitive):
+ """Set breakpoint on file, should match files with different case if case_insensitive is True"""
+
+ # use different case to check CreateTarget
+ exe = 'a.out'
+ if case_insensitive:
+ exe = exe.upper()
+
+ exe = os.path.join(os.getcwd(), exe)
+
+ # Create a target by the debugger.
+ self.target = self.dbg.CreateTarget(exe)
+ self.assertTrue(self.target, VALID_TARGET)
+ cwd = self.get_process_working_directory();
+
+ # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
+ for regex in [False, True]:
+ # should always hit
+ self.check_breakpoint('main.c', regex, True)
+ # should always hit
+ self.check_breakpoint(os.path.join(cwd, 'main.c'), regex, True)
+ # different case for directory
+ self.check_breakpoint(os.path.join(cwd.upper(), 'main.c'),
+ regex,
+ case_insensitive)
+ # different case for file
+ self.check_breakpoint('Main.c',
+ regex,
+ case_insensitive)
+ # different case for both
+ self.check_breakpoint(os.path.join(cwd.upper(), 'Main.c'),
+ regex,
+ case_insensitive)
+
+ def check_breakpoint(self, file, source_regex, should_hit):
+ """
+ Check breakpoint hit at given file set by given method
+
+ file:
+ File where insert the breakpoint
+
+ source_regex:
+ True for testing using BreakpointCreateBySourceRegex,
+ False for BreakpointCreateByLocation
+
+ should_hit:
+ True if the breakpoint should hit, False otherwise
+ """
+
+ desc = ' file %s set by %s' % (file, 'regex' if source_regex else 'location')
+ if source_regex:
+ breakpoint = self.target.BreakpointCreateBySourceRegex(self.BREAKPOINT_TEXT,
+ lldb.SBFileSpec(file))
+ else:
+ breakpoint = self.target.BreakpointCreateByLocation(file, self.line)
+
+ self.assertEqual(breakpoint and breakpoint.GetNumLocations() == 1,
+ should_hit,
+ VALID_BREAKPOINT + desc)
+
+ # Get the breakpoint location from breakpoint after we verified that,
+ # indeed, it has one location.
+ location = breakpoint.GetLocationAtIndex(0)
+ self.assertEqual(location and location.IsEnabled(),
+ should_hit,
+ VALID_BREAKPOINT_LOCATION + desc)
+
+ process = self.target.LaunchSimple(None, None, self.get_process_working_directory())
+ self.assertTrue(process, PROCESS_IS_VALID + desc)
+
+ if should_hit:
+ # Did we hit our breakpoint?
+ from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint
+ threads = get_threads_stopped_at_breakpoint (process, breakpoint)
+ self.assertEqual(len(threads), 1, "There should be a thread stopped at breakpoint" + desc)
+ # The hit count for the breakpoint should be 1.
+ self.assertEqual(breakpoint.GetHitCount(), 1)
+
+ else:
+ # check the breakpoint was not hit
+ self.assertEqual(lldb.eStateExited, process.GetState())
+ self.assertEqual(breakpoint.GetHitCount(), 0)
+
+ # let process finish
+ process.Continue()
+
+ # cleanup
+ self.target.BreakpointDelete(breakpoint.GetID())
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c
new file mode 100644
index 000000000000..281ddfe7ef67
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int
+main()
+{
+ printf("Set a breakpoint here.\n");
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index 8cf7539432ba..78d14b7d7705 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class BreakpointCommandTestCase(TestBase):
@@ -21,7 +22,7 @@ class BreakpointCommandTestCase(TestBase):
cls.RemoveTempFile("output.txt")
cls.RemoveTempFile("output2.txt")
- @expectedFailureWindows("llvm.org/pr24528")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
def test(self):
"""Test a sequence of breakpoint command add, list, and delete."""
self.build()
@@ -142,7 +143,7 @@ class BreakpointCommandTestCase(TestBase):
self.expect("breakpoint command list 1",
startstr = "Breakpoint 1 does not have an associated command.")
self.expect("breakpoint command list 2", error=True,
- startstr = "error: '2' is not a currently valid breakpoint id.")
+ startstr = "error: '2' is not a currently valid breakpoint ID.")
# The breakpoint list now only contains breakpoint 1.
self.expect("breakpoint list -f", "Breakpoint 1 exists",
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
index 7a9cc744d528..4f8ab9e115de 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
@@ -8,10 +8,11 @@ from __future__ import print_function
import os
import re
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
import sys
+import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class PythonBreakpointCommandSettingTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index 8c22c8fe869c..0d34dd85dc50 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class BreakpointConditionsTestCase(TestBase):
@@ -107,11 +108,13 @@ class BreakpointConditionsTestCase(TestBase):
if arch in ['x86_64', 'i386']:
self.runCmd("breakpoint modify -c ($eax&&i)")
elif arch in ['aarch64']:
- self.runCmd("breakpoint modify -c ($x1&&i)")
+ self.runCmd("breakpoint modify -c ($x0&&i)")
elif arch in ['arm']:
self.runCmd("breakpoint modify -c ($r0&&i)")
elif re.match("mips",arch):
self.runCmd("breakpoint modify -c ($r2&&i)")
+ elif arch in ['s390x']:
+ self.runCmd("breakpoint modify -c ($r2&&i)")
self.runCmd("run")
self.expect("process status", PROCESS_STOPPED,
@@ -178,4 +181,8 @@ class BreakpointConditionsTestCase(TestBase):
# The hit count for the breakpoint should be 1.
self.assertTrue(breakpoint.GetHitCount() == 1)
+ # Test that the condition expression didn't create a result variable:
+ options = lldb.SBExpressionOptions()
+ value = frame0.EvaluateExpression("$0", options)
+ self.assertTrue(value.GetError().Fail(), "Conditions should not make result variables.")
process.Continue()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
index 8a83cb627f7a..05ef1c6d94c7 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class BreakpointIgnoreCountTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
index 324401ff44e1..b1e0d3deeae7 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
@@ -8,14 +8,15 @@ import os, time
import re
import unittest2
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class AvoidBreakpointInDelaySlotAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessArch(archs=re.compile('mips*'))
+ @skipIf(archs=no_match(re.compile('mips*')))
def test(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index 5c4dc219a106..707b6502e91c 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -8,15 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class BreakpointLocationsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24528")
- @expectedFailureAll(oslist=["linux"], compiler="clang", compiler_version=["=", "3.8"], archs=["i386"], debug_info="dwo")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
def test(self):
"""Test breakpoint enable/disable for a breakpoint ID with multiple locations."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
new file mode 100644
index 000000000000..4ca93765b656
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
@@ -0,0 +1,43 @@
+"""
+Test inferior restart when breakpoint is set on running target.
+"""
+
+import os
+import lldb
+from lldbsuite.test.lldbtest import *
+
+class BreakpointSetRestart(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ BREAKPOINT_TEXT = 'Set a breakpoint here'
+
+ def test_breakpoint_set_restart(self):
+ self.build()
+
+ cwd = os.getcwd()
+ exe = os.path.join(cwd, 'a.out')
+
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ self.dbg.SetAsync(True)
+ process = target.LaunchSimple(None, None, self.get_process_working_directory())
+ self.assertTrue(process, PROCESS_IS_VALID)
+
+ event = lldb.SBEvent()
+ # Wait for inferior to transition to running state
+ while self.dbg.GetListener().WaitForEvent(2, event):
+ if lldb.SBProcess.GetStateFromEvent(event) == lldb.eStateRunning:
+ break
+
+ bp = target.BreakpointCreateBySourceRegex(self.BREAKPOINT_TEXT,
+ lldb.SBFileSpec(os.path.join(cwd, 'main.cpp')))
+ self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1, VALID_BREAKPOINT)
+
+ while self.dbg.GetListener().WaitForEvent(2, event):
+ if lldb.SBProcess.GetStateFromEvent(event) == lldb.eStateStopped and lldb.SBProcess.GetRestartedFromEvent(event):
+ continue
+ if lldb.SBProcess.GetStateFromEvent(event) == lldb.eStateRunning:
+ continue
+ self.fail("Setting a breakpoint generated an unexpected event: %s" % lldb.SBDebugger.StateAsCString(lldb.SBProcess.GetStateFromEvent(event)))
+
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/main.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/main.cpp
new file mode 100644
index 000000000000..e6d3a95d017f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/main.cpp
@@ -0,0 +1,25 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <chrono>
+#include <stdio.h>
+#include <thread>
+
+
+int main(int argc, char const *argv[])
+{
+ static bool done = false;
+ while (!done)
+ {
+ std::this_thread::sleep_for(std::chrono::milliseconds{100});
+ }
+ printf("Set a breakpoint here.\n");
+ return 0;
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
index e1de38bcad8c..4933d6d01d44 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -6,10 +6,11 @@ from __future__ import print_function
import os
+import shutil
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import shutil
+from lldbsuite.test import lldbutil
_EXE_NAME = 'CompDirSymLink' # Must match Makefile
@@ -27,21 +28,21 @@ class CompDirSymLinkTestCase(TestBase):
self.line = line_number(_SRC_FILE, '// Set break point at this line.')
self.src_path = os.path.join(os.getcwd(), _SRC_FILE)
- @skipIfHostWindows
+ @skipIf(hostoslist=["windows"])
def test_symlink_paths_set(self):
pwd_symlink = self.create_src_symlink()
self.doBuild(pwd_symlink)
self.runCmd("settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
- @skipUnlessHostLinux
+ @skipIf(hostoslist=no_match(["linux"]))
def test_symlink_paths_set_procselfcwd(self):
pwd_symlink = '/proc/self/cwd'
self.doBuild(pwd_symlink)
self.runCmd("settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
- @skipIfHostWindows
+ @skipIf(hostoslist=["windows"])
def test_symlink_paths_unset(self):
pwd_symlink = self.create_src_symlink()
self.doBuild(pwd_symlink)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
deleted file mode 100644
index af6df3764829..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
+++ /dev/null
@@ -1,59 +0,0 @@
-"""
-Test continue from a breakpoint when there is a breakpoint on the next instruction also.
-"""
-
-from __future__ import print_function
-
-
-
-import unittest2
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
-from lldbsuite.test.lldbtest import *
-
-class ConsecutiveBreakpoitsTestCase(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- @expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"]))
- def test (self):
- self.build ()
- self.consecutive_breakpoints_tests()
-
- def consecutive_breakpoints_tests(self):
- exe = os.path.join (os.getcwd(), "a.out")
-
- # Create a target by the debugger.
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
-
- breakpoint = target.BreakpointCreateBySourceRegex("Set breakpoint here", lldb.SBFileSpec("main.cpp"))
- self.assertTrue(breakpoint and
- breakpoint.GetNumLocations() == 1,
- VALID_BREAKPOINT)
-
- # Now launch the process, and do not stop at entry point.
- process = target.LaunchSimple (None, None, self.get_process_working_directory())
- self.assertTrue(process, PROCESS_IS_VALID)
-
- # We should be stopped at the first breakpoint
- thread = process.GetThreadAtIndex(0)
- self.assertEqual(thread.GetStopReason(), lldb.eStopReasonBreakpoint)
-
- # Set breakpoint to the next instruction
- frame = thread.GetFrameAtIndex(0)
-
- address = frame.GetPCAddress()
- instructions = target.ReadInstructions(address, 2)
- self.assertTrue(len(instructions) == 2)
- address = instructions[1].GetAddress()
-
- target.BreakpointCreateByAddress(address.GetLoadAddress(target))
- process.Continue()
-
- # We should be stopped at the second breakpoint
- thread = process.GetThreadAtIndex(0)
- self.assertEqual(thread.GetStopReason(), lldb.eStopReasonBreakpoint)
-
- # Run the process until termination
- process.Continue()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile
index f89b52a972e9..f89b52a972e9 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
new file mode 100644
index 000000000000..472479391c02
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
@@ -0,0 +1,101 @@
+"""
+Test that we handle breakpoints on consecutive instructions correctly.
+"""
+
+from __future__ import print_function
+
+
+
+import unittest2
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class ConsecutiveBreakpointsTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def prepare_test(self):
+ self.build()
+ exe = os.path.join (os.getcwd(), "a.out")
+
+ # Create a target by the debugger.
+ self.target = self.dbg.CreateTarget(exe)
+ self.assertTrue(self.target, VALID_TARGET)
+
+ breakpoint1 = self.target.BreakpointCreateBySourceRegex("Set breakpoint here", lldb.SBFileSpec("main.cpp"))
+ self.assertTrue(breakpoint1 and breakpoint1.GetNumLocations() == 1, VALID_BREAKPOINT)
+
+ # Now launch the process, and do not stop at entry point.
+ self.process = self.target.LaunchSimple (None, None, self.get_process_working_directory())
+ self.assertIsNotNone(self.process, PROCESS_IS_VALID)
+
+ # We should be stopped at the first breakpoint
+ self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, breakpoint1)
+ self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 1")
+
+ # Set breakpoint to the next instruction
+ frame = self.thread.GetFrameAtIndex(0)
+
+ address = frame.GetPCAddress()
+ instructions = self.target.ReadInstructions(address, 2)
+ self.assertTrue(len(instructions) == 2)
+ self.bkpt_address = instructions[1].GetAddress()
+ self.breakpoint2 = self.target.BreakpointCreateByAddress(self.bkpt_address.GetLoadAddress(self.target))
+ self.assertTrue(self.breakpoint2 and self.breakpoint2.GetNumLocations() == 1, VALID_BREAKPOINT)
+
+ def finish_test(self):
+ # Run the process until termination
+ self.process.Continue()
+ self.assertEquals(self.process.GetState(), lldb.eStateExited)
+
+ @no_debug_info_test
+ def test_continue(self):
+ """Test that continue stops at the second breakpoint."""
+ self.prepare_test()
+
+ self.process.Continue()
+ self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+ # We should be stopped at the second breakpoint
+ self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint2)
+ self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 2")
+
+ self.finish_test()
+
+ @no_debug_info_test
+ def test_single_step(self):
+ """Test that single step stops at the second breakpoint."""
+ self.prepare_test()
+
+ step_over = False
+ self.thread.StepInstruction(step_over)
+
+ self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+ self.assertEquals(self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target),
+ self.bkpt_address.GetLoadAddress(self.target))
+ self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint2)
+ self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 2")
+
+ self.finish_test()
+
+ @no_debug_info_test
+ def test_single_step_thread_specific(self):
+ """Test that single step stops, even though the second breakpoint is not valid."""
+ self.prepare_test()
+
+ # Choose a thread other than the current one. A non-existing thread is fine.
+ thread_index = self.process.GetNumThreads()+1
+ self.assertFalse(self.process.GetThreadAtIndex(thread_index).IsValid())
+ self.breakpoint2.SetThreadIndex(thread_index)
+
+ step_over = False
+ self.thread.StepInstruction(step_over)
+
+ self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+ self.assertEquals(self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target),
+ self.bkpt_address.GetLoadAddress(self.target))
+ self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete,
+ "Stop reason should be 'plan complete'")
+
+ self.finish_test()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/main.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp
index c1943f03dbf1..c1943f03dbf1 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
index dea206b9e9d2..c2aa597214ed 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class TestCPPBreakpointLocations(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24764")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test (self):
self.build ()
self.breakpoint_id_tests ()
@@ -25,7 +26,7 @@ class TestCPPBreakpointLocations(TestBase):
name = bp_dict['name']
names = bp_dict['loc_names']
bp = target.BreakpointCreateByName (name)
- self.assertTrue (bp.GetNumLocations() == len(names), "Make sure we find the right number of breakpoint locations")
+ self.assertEquals(bp.GetNumLocations(), len(names), "Make sure we find the right number of breakpoint locations")
bp_loc_names = list()
for bp_loc in bp:
@@ -60,3 +61,35 @@ class TestCPPBreakpointLocations(TestBase):
for bp_dict in bp_dicts:
self.verify_breakpoint_locations(target, bp_dict)
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
+ def test_destructors(self):
+ self.build()
+ exe = os.path.join(os.getcwd(), "a.out")
+ target = self.dbg.CreateTarget(exe)
+
+ # Don't skip prologue, so we can check the breakpoint address more easily
+ self.runCmd("settings set target.skip-prologue false")
+ try:
+ names = ['~c', 'c::~c', 'c::~c()']
+ loc_names = {'a::c::~c()', 'b::c::~c()'}
+ # TODO: For windows targets we should put windows mangled names here
+ symbols = ['_ZN1a1cD1Ev', '_ZN1a1cD2Ev', '_ZN1b1cD1Ev', '_ZN1b1cD2Ev']
+
+ for name in names:
+ bp = target.BreakpointCreateByName(name)
+
+ bp_loc_names = { bp_loc.GetAddress().GetFunction().GetName() for bp_loc in bp }
+ self.assertEquals(bp_loc_names, loc_names, "Breakpoint set on the correct symbol")
+
+ bp_addresses = { bp_loc.GetLoadAddress() for bp_loc in bp }
+ symbol_addresses = set()
+ for symbol in symbols:
+ sc_list = target.FindSymbols(symbol, lldb.eSymbolTypeCode)
+ self.assertEquals(sc_list.GetSize(), 1, "Found symbol " + symbol)
+ symbol = sc_list.GetContextAtIndex(0).GetSymbol()
+ symbol_addresses.add(symbol.GetStartAddress().GetLoadAddress(target))
+
+ self.assertEquals(symbol_addresses, bp_addresses, "Breakpoint set on correct address")
+ finally:
+ self.runCmd("settings clear target.skip-prologue")
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp
index ef582aa36ebb..01f679139249 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp
@@ -12,8 +12,8 @@
namespace a {
class c {
public:
- c () {}
- ~c() {}
+ c();
+ ~c();
void func1()
{
puts (__PRETTY_FUNCTION__);
@@ -27,13 +27,16 @@ namespace a {
puts (__PRETTY_FUNCTION__);
}
};
+
+ c::c() {}
+ c::~c() {}
}
namespace b {
class c {
public:
- c () {}
- ~c() {}
+ c();
+ ~c();
void func1()
{
puts (__PRETTY_FUNCTION__);
@@ -43,6 +46,9 @@ namespace b {
puts (__PRETTY_FUNCTION__);
}
};
+
+ c::c() {}
+ c::~c() {}
}
namespace c {
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
index f7a19098b492..2aac3a9600d3 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
@@ -8,10 +8,11 @@ from __future__ import print_function
import os
import re
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
import sys
+import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestCPPExceptionBreakpoint (TestBase):
@@ -19,7 +20,7 @@ class TestCPPExceptionBreakpoint (TestBase):
my_var = 10
@add_test_categories(['pyapi'])
- @expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24538")
def test_cpp_exception_breakpoint(self):
"""Test setting and hitting the C++ exception breakpoint."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
index b32c970301c9..de61f9e88f1b 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -6,14 +6,15 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DebugBreakTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIf(archs=not_in(["i386", "i686"]))
+ @skipIf(archs=no_match(["i386", "i686", "x86_64"]))
@no_debug_info_test
def test_asm_int_3(self):
"""Test that intrinsics like `__debugbreak();` and `asm {"int3"}` are treated like breakpoints."""
@@ -26,13 +27,15 @@ class DebugBreakTestCase(TestBase):
# We've hit the first stop, so grab the frame.
self.assertEqual(process.GetState(), lldb.eStateStopped)
- thread = process.GetThreadAtIndex(0)
+ stop_reason = lldb.eStopReasonException if (lldbplatformutil.getPlatform()=="windows" or lldbplatformutil.getPlatform()=="macosx") else lldb.eStopReasonSignal
+ thread = lldbutil.get_stopped_thread(process, stop_reason)
+ self.assertIsNotNone(thread, "Unable to find thread stopped at the __debugbreak()")
frame = thread.GetFrameAtIndex(0)
# We should be in funciton 'bar'.
self.assertTrue(frame.IsValid())
function_name = frame.GetFunctionName()
- self.assertTrue('bar' in function_name)
+ self.assertTrue('bar' in function_name, "Unexpected function name {}".format(function_name))
# We should be able to evaluate the parameter foo.
value = frame.EvaluateExpression('*foo')
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
index 648a0f5ea07c..c48cee1bd2b2 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -8,11 +8,12 @@ from __future__ import print_function
import os, time
-import lldb
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
import shutil
import subprocess
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
@skipUnlessDarwin
class TestObjCBreakpoints(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/Makefile
new file mode 100644
index 000000000000..ac984f101c18
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c a.c
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
new file mode 100644
index 000000000000..81cab927d214
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
@@ -0,0 +1,100 @@
+"""
+Test lldb breakpoint setting by source regular expression.
+This test just tests the source file & function restrictions.
+"""
+
+from __future__ import print_function
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestSourceRegexBreakpoints(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_location (self):
+ self.build()
+ self.source_regex_locations()
+
+ def test_restrictions (self):
+ self.build ()
+ self.source_regex_restrictions ()
+
+
+ def source_regex_locations (self):
+ """ Test that restricting source expressions to files & to functions. """
+ # Create a target by the debugger.
+ exe = os.path.join(os.getcwd(), "a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ # First look just in main:
+ target_files = lldb.SBFileSpecList()
+ target_files.Append(lldb.SBFileSpec("a.c"))
+
+ func_names = lldb.SBStringList()
+ func_names.AppendString("a_func")
+
+ source_regex = "Set . breakpoint here"
+ main_break = target.BreakpointCreateBySourceRegex (source_regex,
+ lldb.SBFileSpecList(),
+ target_files,
+ func_names)
+ num_locations = main_break.GetNumLocations()
+ self.assertTrue(num_locations == 1, "a.c in a_func should give one breakpoint, got %d."%(num_locations))
+
+ loc = main_break.GetLocationAtIndex(0)
+ self.assertTrue(loc.IsValid(), "Got a valid location.")
+ address = loc.GetAddress()
+ self.assertTrue(address.IsValid(), "Got a valid address from the location.")
+
+ a_func_line = line_number("a.c", "Set A breakpoint here")
+ line_entry = address.GetLineEntry()
+ self.assertTrue(line_entry.IsValid(), "Got a valid line entry.")
+ self.assertTrue(line_entry.line == a_func_line, "Our line number matches the one lldbtest found.")
+
+ def source_regex_restrictions (self):
+ """ Test that restricting source expressions to files & to functions. """
+ # Create a target by the debugger.
+ exe = os.path.join(os.getcwd(), "a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ # First look just in main:
+ target_files = lldb.SBFileSpecList()
+ target_files.Append(lldb.SBFileSpec("main.c"))
+ source_regex = "Set . breakpoint here"
+ main_break = target.BreakpointCreateBySourceRegex (source_regex,
+ lldb.SBFileSpecList(),
+ target_files,
+ lldb.SBStringList())
+
+ num_locations = main_break.GetNumLocations()
+ self.assertTrue(num_locations == 2, "main.c should have 2 matches, got %d."%(num_locations))
+
+ # Now look in both files:
+ target_files.Append(lldb.SBFileSpec("a.c"))
+
+ main_break = target.BreakpointCreateBySourceRegex (source_regex,
+ lldb.SBFileSpecList(),
+ target_files,
+ lldb.SBStringList())
+
+ num_locations =main_break.GetNumLocations()
+ self.assertTrue(num_locations == 4, "main.c and a.c should have 4 matches, got %d."%(num_locations))
+
+ # Now restrict it to functions:
+ func_names = lldb.SBStringList()
+ func_names.AppendString("main_func")
+ main_break = target.BreakpointCreateBySourceRegex (source_regex,
+ lldb.SBFileSpecList(),
+ target_files,
+ func_names)
+
+ num_locations =main_break.GetNumLocations()
+ self.assertTrue(num_locations == 2, "main_func in main.c and a.c should have 2 matches, got %d."%(num_locations))
+
+
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.c
new file mode 100644
index 000000000000..056583f1c42c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+#include "a.h"
+
+static int
+main_func(int input)
+{
+ return printf("Set B breakpoint here: %d", input);
+}
+
+int
+a_func(int input)
+{
+ input += 1; // Set A breakpoint here;
+ return main_func(input);
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.h b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.h
new file mode 100644
index 000000000000..f578ac0304cd
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/a.h
@@ -0,0 +1 @@
+int a_func(int);
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/main.c
new file mode 100644
index 000000000000..9c8625e877f5
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/main.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include "a.h"
+
+int
+main_func(int input)
+{
+ return printf("Set B breakpoint here: %d.\n", input);
+}
+
+int
+main()
+{
+ a_func(10);
+ main_func(10);
+ printf("Set a breakpoint here:\n");
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py b/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py
index 312c91517f98..66ba8d07622d 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py
@@ -8,7 +8,9 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class CommandHistoryTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py b/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
index 2c48efa863b4..5b680ec65de5 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
@@ -8,13 +8,15 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class CommandRegexTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureHostWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
@no_debug_info_test
def test_command_regex(self):
"""Test a simple scenario of 'command regex' invocation and subsequent use."""
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py b/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
index 542ee7a1e5f3..97e52231e818 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
@@ -87,8 +87,8 @@ class CmdPythonTestCase(TestBase):
'For more information run'])
self.expect("help targetname",
- substrs = ['This', 'command', 'takes', '\'raw\'', 'input',
- 'quote', 'stuff'])
+ substrs = ['Expects', '\'raw\'', 'input',
+ 'help', 'raw-input'])
self.expect("longwait",
substrs = ['Done; if you saw the delays I am doing OK'])
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py b/packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py
index 691045ae82ed..01c3f35bf300 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py
@@ -6,7 +6,9 @@ from __future__ import print_function
import os, sys, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ImportTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py b/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
index 9800a08c06de..4f7ebebd4dd2 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
@@ -6,7 +6,9 @@ from __future__ import print_function
import os, sys, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class Rdar12586188TestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py b/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py
index faa4e3b0cbff..1181462af868 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py
@@ -1,5 +1,7 @@
-import TPunitA
-import TPunitB
+from __future__ import absolute_import
+
+from . import TPunitA
+from . import TPunitB
def __lldb_init_module(debugger,*args):
debugger.HandleCommand("command script add -f thepackage.TPunitA.command TPcommandA")
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_alias/.categories b/packages/Python/lldbsuite/test/functionalities/command_script_alias/.categories
new file mode 100644
index 000000000000..3a3f4df6416b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_alias/.categories
@@ -0,0 +1 @@
+cmdline
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_alias/TestCommandScriptAlias.py b/packages/Python/lldbsuite/test/functionalities/command_script_alias/TestCommandScriptAlias.py
new file mode 100644
index 000000000000..694728a9f9c0
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_alias/TestCommandScriptAlias.py
@@ -0,0 +1,37 @@
+"""
+Test lldb Python commands.
+"""
+
+from __future__ import print_function
+
+
+import os, time
+import lldb
+from lldbsuite.test.lldbtest import *
+
+class CommandScriptAliasTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test (self):
+ self.pycmd_tests ()
+
+ def pycmd_tests (self):
+ self.runCmd("command script import tcsacmd.py")
+ self.runCmd("command script add -f tcsacmd.some_command_here attach")
+
+ # This is the function to remove the custom commands in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('command script delete attach', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ # We don't want to display the stdout if not in TraceOn() mode.
+ if not self.TraceOn():
+ self.HideStdout()
+
+ self.expect('attach a', substrs = ['Victory is mine']);
+ self.runCmd("command script delete attach")
+ self.runCmd('attach noprocessexistswiththisname', check=False) # this can't crash but we don't care whether the actual attach works
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_alias/tcsacmd.py b/packages/Python/lldbsuite/test/functionalities/command_script_alias/tcsacmd.py
new file mode 100644
index 000000000000..6c60e3ca1a55
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_alias/tcsacmd.py
@@ -0,0 +1,11 @@
+from __future__ import print_function
+import lldb, sys
+
+def some_command_here(debugger, command, result, d):
+ if command == "a":
+ print("Victory is mine", file=result)
+ return True
+ else:
+ print("Sadness for all", file=result)
+ return False
+
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
new file mode 100644
index 000000000000..a843d08a97d4
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -0,0 +1,86 @@
+"""
+Test that LLDB correctly allows scripted commands to set an immediate output file
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.lldbpexpect import *
+from lldbsuite.test import lldbutil
+
+class CommandScriptImmediateOutputTestCase (PExpectTest):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def setUp(self):
+ # Call super's setUp().
+ PExpectTest.setUp(self)
+
+ @skipIfRemote # test not remote-ready llvm.org/pr24813
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
+ def test_command_script_immediate_output_console (self):
+ """Test that LLDB correctly allows scripted commands to set immediate output to the console."""
+ self.launch(timeout=10)
+
+ script = os.path.join(os.getcwd(), 'custom_command.py')
+ prompt = "\(lldb\) "
+
+ self.sendline('command script import %s' % script, patterns=[prompt])
+ self.sendline('command script add -f custom_command.command_function mycommand', patterns=[prompt])
+ self.sendline('mycommand', patterns='this is a test string, just a test string')
+ self.sendline('command script delete mycommand', patterns=[prompt])
+ self.quit(gracefully=False)
+
+ @skipIfRemote # test not remote-ready llvm.org/pr24813
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
+ def test_command_script_immediate_output_file (self):
+ """Test that LLDB correctly allows scripted commands to set immediate output to a file."""
+ self.launch(timeout=10)
+
+ test_files = {os.path.join(os.getcwd(), 'read.txt') :'r',
+ os.path.join(os.getcwd(), 'write.txt') :'w',
+ os.path.join(os.getcwd(), 'append.txt') :'a',
+ os.path.join(os.getcwd(), 'write_plus.txt') :'w+',
+ os.path.join(os.getcwd(), 'read_plus.txt') :'r+',
+ os.path.join(os.getcwd(), 'append_plus.txt') :'a+'}
+
+ starter_string = 'Starter Garbage\n'
+ write_string = 'writing to file with mode: '
+
+ for path, mode in test_files.iteritems():
+ with open(path, 'w+') as init:
+ init.write(starter_string)
+
+ script = os.path.join(os.getcwd(), 'custom_command.py')
+ prompt = "\(lldb\) "
+
+ self.sendline('command script import %s' % script, patterns=[prompt])
+
+ self.sendline('command script add -f custom_command.write_file mywrite', patterns=[prompt])
+ for path, mode in test_files.iteritems():
+ command = 'mywrite "' + path + '" ' + mode
+
+ self.sendline(command, patterns=[prompt])
+
+ self.sendline('command script delete mywrite', patterns=[prompt])
+
+ self.quit(gracefully=False)
+
+ for path, mode in test_files.iteritems():
+ with open(path, 'r') as result:
+ if mode in ['r', 'a', 'a+']:
+ self.assertEquals(result.readline(), starter_string)
+ if mode in ['w', 'w+', 'r+', 'a', 'a+']:
+ self.assertEquals(result.readline(), write_string + mode + '\n')
+
+ self.assertTrue(os.path.isfile(path))
+ os.remove(path)
+
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
new file mode 100644
index 000000000000..30a3cfb9093c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
@@ -0,0 +1,17 @@
+from __future__ import print_function
+
+import sys
+import shlex
+
+def command_function(debugger, command, exe_ctx, result, internal_dict):
+ result.SetImmediateOutputFile(sys.__stdout__)
+ print('this is a test string, just a test string', file=result)
+
+def write_file(debugger, command, exe_ctx, result, internal_dict):
+ args = shlex.split(command)
+ path = args[0]
+ mode = args[1]
+ with open(path, mode) as f:
+ result.SetImmediateOutputFile(f)
+ if not mode in ['r']:
+ print('writing to file with mode: ' + mode, file=result)
diff --git a/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py b/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
index 013803e698af..0d4eb0776e79 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
@@ -10,7 +10,9 @@ from __future__ import print_function
import os, sys
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class CommandSourceTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index d7aab03c0830..7a9ded03ad20 100644
--- a/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -8,7 +8,10 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbplatform
+from lldbsuite.test import lldbutil
class CommandLineCompletionTestCase(TestBase):
@@ -23,21 +26,21 @@ class CommandLineCompletionTestCase(TestBase):
except:
pass
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_at(self):
"""Test that 'at' completes to 'attach '."""
self.complete_from_to('at', 'attach ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_de(self):
"""Test that 'de' completes to 'detach '."""
self.complete_from_to('de', 'detach ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_process_attach_dash_dash_con(self):
@@ -45,7 +48,7 @@ class CommandLineCompletionTestCase(TestBase):
self.complete_from_to('process attach --con', 'process attach --continue ')
# <rdar://problem/11052829>
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_infinite_loop_while_completing(self):
@@ -53,147 +56,147 @@ class CommandLineCompletionTestCase(TestBase):
self.complete_from_to('process print hello\\', 'process print hello\\',
turn_off_re_match=True)
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_co(self):
"""Test that 'watchpoint co' completes to 'watchpoint command '."""
self.complete_from_to('watchpoint co', 'watchpoint command ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_command_space(self):
"""Test that 'watchpoint command ' completes to ['Available completions:', 'add', 'delete', 'list']."""
self.complete_from_to('watchpoint command ', ['Available completions:', 'add', 'delete', 'list'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_command_a(self):
"""Test that 'watchpoint command a' completes to 'watchpoint command add '."""
self.complete_from_to('watchpoint command a', 'watchpoint command add ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_set_variable_dash_w(self):
"""Test that 'watchpoint set variable -w' completes to 'watchpoint set variable -w '."""
self.complete_from_to('watchpoint set variable -w', 'watchpoint set variable -w ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_set_variable_dash_w_space(self):
"""Test that 'watchpoint set variable -w ' completes to ['Available completions:', 'read', 'write', 'read_write']."""
self.complete_from_to('watchpoint set variable -w ', ['Available completions:', 'read', 'write', 'read_write'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_set_ex(self):
"""Test that 'watchpoint set ex' completes to 'watchpoint set expression '."""
self.complete_from_to('watchpoint set ex', 'watchpoint set expression ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_set_var(self):
"""Test that 'watchpoint set var' completes to 'watchpoint set variable '."""
self.complete_from_to('watchpoint set var', 'watchpoint set variable ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_watchpoint_set_variable_dash_w_read_underbar(self):
"""Test that 'watchpoint set variable -w read_' completes to 'watchpoint set variable -w read_write'."""
self.complete_from_to('watchpoint set variable -w read_', 'watchpoint set variable -w read_write')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_help_fi(self):
"""Test that 'help fi' completes to ['Available completions:', 'file', 'finish']."""
self.complete_from_to('help fi', ['Available completions:', 'file', 'finish'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_help_watchpoint_s(self):
"""Test that 'help watchpoint s' completes to 'help watchpoint set '."""
self.complete_from_to('help watchpoint s', 'help watchpoint set ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_append_target_er(self):
"""Test that 'settings append target.er' completes to 'settings append target.error-path'."""
self.complete_from_to('settings append target.er', 'settings append target.error-path')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_insert_after_target_en(self):
"""Test that 'settings insert-after target.env' completes to 'settings insert-after target.env-vars'."""
self.complete_from_to('settings insert-after target.env', 'settings insert-after target.env-vars')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_insert_before_target_en(self):
"""Test that 'settings insert-before target.env' completes to 'settings insert-before target.env-vars'."""
self.complete_from_to('settings insert-before target.env', 'settings insert-before target.env-vars')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_replace_target_ru(self):
"""Test that 'settings replace target.ru' completes to 'settings replace target.run-args'."""
self.complete_from_to('settings replace target.ru', 'settings replace target.run-args')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_s(self):
"""Test that 'settings s' completes to ['Available completions:', 'set', 'show']."""
self.complete_from_to('settings s', ['Available completions:', 'set', 'show'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_th(self):
"""Test that 'settings set th' completes to 'settings set thread-format'."""
self.complete_from_to('settings set th', 'settings set thread-format')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_s_dash(self):
"""Test that 'settings set -' completes to 'settings set -g'."""
self.complete_from_to('settings set -', 'settings set -g')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_clear_th(self):
"""Test that 'settings clear th' completes to 'settings clear thread-format'."""
self.complete_from_to('settings clear th', 'settings clear thread-format')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_ta(self):
"""Test that 'settings set ta' completes to 'settings set target.'."""
self.complete_from_to('settings set target.ma', 'settings set target.max-')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_target_exec(self):
"""Test that 'settings set target.exec' completes to 'settings set target.exec-search-paths '."""
self.complete_from_to('settings set target.exec', 'settings set target.exec-search-paths')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_target_pr(self):
@@ -204,21 +207,21 @@ class CommandLineCompletionTestCase(TestBase):
'target.prefer-dynamic-value',
'target.process.'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_target_process(self):
"""Test that 'settings set target.process' completes to 'settings set target.process.'."""
self.complete_from_to('settings set target.process', 'settings set target.process.')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_target_process_dot(self):
"""Test that 'settings set target.process.t' completes to 'settings set target.process.thread.'."""
self.complete_from_to('settings set target.process.t', 'settings set target.process.thread.')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_target_process_thread_dot(self):
@@ -229,7 +232,7 @@ class CommandLineCompletionTestCase(TestBase):
'target.process.thread.step-avoid-regexp',
'target.process.thread.trace-thread'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_target_space(self):
@@ -239,22 +242,22 @@ class CommandLineCompletionTestCase(TestBase):
['Available completions:', 'create', 'delete', 'list',
'modules', 'select', 'stop-hook', 'variable'])
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_target_create_dash_co(self):
"""Test that 'target create --co' completes to 'target variable --core '."""
self.complete_from_to('target create --co', 'target create --core ')
- @expectedFailureHostWindows("llvm.org/pr24679")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_target_va(self):
"""Test that 'target va' completes to 'target variable '."""
self.complete_from_to('target va', 'target variable ')
- @expectedFailureHostWindows("llvm.org/pr24679")
- @expectedFailureDarwin("llvm.org/pr25485")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
+ @expectedFailureAll(oslist=lldbplatform.darwin_all, bugnumber="llvm.org/pr25485")
def test_symbol_name(self):
self.build()
self.complete_from_to('''file a.out
diff --git a/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py b/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
index 3ae7a20b4c7d..7fcb44f0b3ec 100644
--- a/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
# rdar://problem/8532131
# lldb not able to digest the clang-generated debug info correctly with respect to function name
@@ -32,6 +33,7 @@ class ConditionalBreakTestCase(TestBase):
self.build()
self.simulate_conditional_break_by_user()
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr26265: args in frames other than #0 are not evaluated correctly")
def do_conditional_break(self):
"""Exercise some thread and frame APIs to break if c() is called by a()."""
exe = os.path.join(os.getcwd(), "a.out")
@@ -64,7 +66,8 @@ class ConditionalBreakTestCase(TestBase):
for j in range(10):
if self.TraceOn():
print("j is: ", j)
- thread = process.GetThreadAtIndex(0)
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
+ self.assertIsNotNone(thread, "Expected one thread to be stopped at the breakpoint")
if thread.GetNumFrames() >= 2:
frame0 = thread.GetFrameAtIndex(0)
@@ -82,8 +85,8 @@ class ConditionalBreakTestCase(TestBase):
# And the local variable 'val' should have a value of (int) 3.
val = frame1.FindVariable("val")
- self.assertTrue(val.GetTypeName() == "int", "'val' has int type")
- self.assertTrue(val.GetValue() == "3", "'val' has a value of 3")
+ self.assertEqual("int", val.GetTypeName())
+ self.assertEqual("3", val.GetValue())
break
process.Continue()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
index 94cdfdfeb343..fb3511ebd91d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DataFormatterBoolRefPtr(TestBase):
@@ -56,6 +57,8 @@ class DataFormatterBoolRefPtr(TestBase):
substrs = ['YES'])
self.expect('frame variable no_ref',
substrs = ['NO'])
+ self.expect('frame variable unset_ref',
+ substrs = ['12'])
# Now check that we use the right summary for BOOL*
@@ -63,6 +66,8 @@ class DataFormatterBoolRefPtr(TestBase):
substrs = ['YES'])
self.expect('frame variable no_ptr',
substrs = ['NO'])
+ self.expect('frame variable unset_ptr',
+ substrs = ['12'])
# Now check that we use the right summary for BOOL
@@ -70,3 +75,5 @@ class DataFormatterBoolRefPtr(TestBase):
substrs = ['YES'])
self.expect('frame variable no',
substrs = ['NO'])
+ self.expect('frame variable unset',
+ substrs = ['12'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm
index a2461fd9da91..22c8790a7541 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/main.mm
@@ -11,17 +11,19 @@
int main (int argc, const char * argv[])
{
-
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
BOOL yes = YES;
BOOL no = NO;
+ BOOL unset = 12;
BOOL &yes_ref = yes;
BOOL &no_ref = no;
+ BOOL &unset_ref = unset;
BOOL* yes_ptr = &yes;
BOOL* no_ptr = &no;
+ BOOL* unset_ptr = &unset;
[pool drain];// Set break point at this line.
return 0;
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
index 7cd2a49b4717..914c5260ac24 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class CompactVectorsFormattingTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
index db426cac6e59..f8209f03d0c2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class CategoriesDataFormatterTestCase(TestBase):
@@ -154,6 +155,7 @@ class CategoriesDataFormatterTestCase(TestBase):
self.runCmd("type category enable Category1")
self.runCmd("type summary list -w Category1")
+ self.expect("type summary list -w NoSuchCategoryHere", substrs=['no matching results found'])
self.expect("frame variable r1 r2 r3",
substrs = ['r1 = Category1',
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index 2ca737156a1a..99443a04f672 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class CppDataFormatterTestCase(TestBase):
@@ -21,7 +22,7 @@ class CppDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
index 0f254a67d5a6..2c2e08431175 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DataFormatterDisablingTestCase(TestBase):
@@ -21,7 +22,7 @@ class DataFormatterDisablingTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Check that we can properly disable all data formatter categories."""
self.build()
@@ -61,6 +62,8 @@ class DataFormatterDisablingTestCase(TestBase):
self.expect('frame variable string1', matching=False, substrs = ['hello world'])
+ self.expect('type summary list', substrs=['Category: system (disabled)'])
+
self.expect('type category list', substrs = ['system','disabled',])
# now enable and check that we are back to normal
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
index 94df520d29b3..e9ac79ad08e2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
@@ -48,7 +48,9 @@ class NamedSummariesDataFormatterTestCase(TestBase):
self.runCmd("type summary add --summary-string \"First: x=${var.x} y=${var.y} dummy=${var.dummy}\" First")
self.runCmd("type summary add --summary-string \"Second: x=${var.x} y=${var.y%hex}\" Second")
self.runCmd("type summary add --summary-string \"Third: x=${var.x} z=${var.z}\" Third")
-
+
+ self.expect('type summary list', substrs=['AllUseIt'])
+
self.expect("frame variable first",
substrs = ['First: x=12'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index e12ddca2eea7..d7d4118d1d6a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -7,11 +7,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class ObjCDataFormatterTestCase(TestBase):
@@ -66,11 +67,6 @@ class ObjCDataFormatterTestCase(TestBase):
"""Test formatters for NSException."""
self.appkit_tester_impl(self.nsexception_data_formatter_commands)
- @skipUnlessDarwin
- def test_nsmisc_with_run_command(self):
- """Test formatters for misc NS classes."""
- self.appkit_tester_impl(self.nsmisc_data_formatter_commands)
-
@skipUnlessDarwin
def test_nsdate_with_run_command(self):
@@ -191,7 +187,7 @@ class ObjCDataFormatterTestCase(TestBase):
def nsnumber_data_formatter_commands(self):
# Now enable AppKit and check we are displaying Cocoa classes correctly
- self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num8_Y num8_N num9',
+ self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num9',
substrs = ['(NSNumber *) num1 = ',' (int)5',
'(NSNumber *) num2 = ',' (float)3.1',
'(NSNumber *) num3 = ',' (double)3.14',
@@ -199,13 +195,8 @@ class ObjCDataFormatterTestCase(TestBase):
'(NSNumber *) num5 = ',' (char)65',
'(NSNumber *) num6 = ',' (long)255',
'(NSNumber *) num7 = ','2000000',
- '(NSNumber *) num8_Y = ',' @"1"',
- '(NSNumber *) num8_N = ',' @"0"',
'(NSNumber *) num9 = ',' (short)-31616'])
- self.expect('frame variable decimal_one',
- substrs = ['(NSDecimalNumber *) decimal_one = 0x','1'])
-
self.expect('frame variable num_at1 num_at2 num_at3 num_at4',
substrs = ['(NSNumber *) num_at1 = ',' (int)12',
'(NSNumber *) num_at2 = ',' (int)-12',
@@ -213,26 +204,19 @@ class ObjCDataFormatterTestCase(TestBase):
'(NSNumber *) num_at4 = ',' (double)-12.5'])
def nscontainers_data_formatter_commands(self):
- self.expect('frame variable newArray newDictionary newMutableDictionary cfdict_ref mutable_dict_ref cfarray_ref mutable_array_ref',
+ self.expect('frame variable newArray newDictionary newMutableDictionary cfarray_ref mutable_array_ref',
substrs = ['(NSArray *) newArray = ','@"50 elements"',
'(NSDictionary *) newDictionary = ',' 12 key/value pairs',
'(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs',
- '(CFDictionaryRef) cfdict_ref = ','3 key/value pairs',
- '(CFMutableDictionaryRef) mutable_dict_ref = ','12 key/value pairs',
'(CFArrayRef) cfarray_ref = ','@"3 elements"',
'(CFMutableArrayRef) mutable_array_ref = ','@"11 elements"'])
- self.expect('frame variable nscounted_set',
- substrs = ['(NSCountedSet *) nscounted_set = ','5 elements'])
-
self.expect('frame variable iset1 iset2 imset',
substrs = ['4 indexes','512 indexes','10 indexes'])
- self.expect('frame variable mutable_bag_ref cfbag_ref binheap_ref',
- substrs = ['(CFMutableBagRef) mutable_bag_ref = ','@"17 values"',
- '(CFBagRef) cfbag_ref = ','@"15 values"',
- '(CFBinaryHeapRef) binheap_ref = ','@"21 items"'])
-
+ self.expect('frame variable binheap_ref',
+ substrs = ['(CFBinaryHeapRef) binheap_ref = ','@"21 items"'])
+
self.expect('expression -d run -- [NSArray new]', substrs=['@"0 elements"'])
def nsdata_data_formatter_commands(self):
@@ -258,6 +242,9 @@ class ObjCDataFormatterTestCase(TestBase):
self.expect('frame variable nserror',
substrs = ['domain: @"Foobar" - code: 12'])
+ self.expect('frame variable nserrorptr',
+ substrs = ['domain: @"Foobar" - code: 12'])
+
self.expect('frame variable nserror->_userInfo',
substrs = ['2 key/value pairs'])
@@ -272,24 +259,10 @@ class ObjCDataFormatterTestCase(TestBase):
def nsexception_data_formatter_commands(self):
self.expect('frame variable except0 except1 except2 except3',
- substrs = ['(NSException *) except0 = ','name:@"TheGuyWhoHasNoName" reason:@"cuz it\'s funny"',
- '(NSException *) except1 = ','name:@"TheGuyWhoHasNoName~1" reason:@"cuz it\'s funny"',
- '(NSException *) except2 = ','name:@"TheGuyWhoHasNoName`2" reason:@"cuz it\'s funny"',
- '(NSException *) except3 = ','name:@"TheGuyWhoHasNoName/3" reason:@"cuz it\'s funny"'])
-
- def nsmisc_data_formatter_commands(self):
- self.expect('frame variable localhost',
- substrs = ['<NSHost ','> localhost ((','"127.0.0.1"'])
-
- if self.getArchitecture() in ['i386', 'x86_64']:
- self.expect('frame variable my_task',
- substrs = ['<NS','Task: 0x'])
-
- self.expect('frame variable range_value',
- substrs = ['NSRange: {4, 4}'])
-
- self.expect('frame variable port',
- substrs = ['(NSMachPort *) port = ',' mach port: '])
+ substrs = ['(NSException *) except0 = ','name: @"TheGuyWhoHasNoName" - reason: @"cuz it\'s funny"',
+ '(NSException *) except1 = ','name: @"TheGuyWhoHasNoName~1" - reason: @"cuz it\'s funny"',
+ '(NSException *) except2 = ','name: @"TheGuyWhoHasNoName`2" - reason: @"cuz it\'s funny"',
+ '(NSException *) except3 = ','name: @"TheGuyWhoHasNoName/3" - reason: @"cuz it\'s funny"'])
def nsdate_data_formatter_commands(self):
self.expect('frame variable date1 date2',
@@ -298,16 +271,18 @@ class ObjCDataFormatterTestCase(TestBase):
# this test might fail if we hit the breakpoint late on December 31st of some given year
# and midnight comes between hitting the breakpoint and running this line of code
# hopefully the output will be revealing enough in that case :-)
- now_year = str(datetime.datetime.now().year)
+ now_year = '%s-' % str(datetime.datetime.now().year)
- self.expect('frame variable date3 date4',
- substrs = [now_year,'1970'])
+ self.expect('frame variable date3', substrs = [now_year])
+ self.expect('frame variable date4', substrs = ['1970'])
+ self.expect('frame variable date5', substrs = [now_year])
self.expect('frame variable date1_abs date2_abs',
substrs = ['1985-04','2011-01'])
- self.expect('frame variable date3_abs date4_abs',
- substrs = [now_year,'1970'])
+ self.expect('frame variable date3_abs', substrs = [now_year])
+ self.expect('frame variable date4_abs', substrs = ['1970'])
+ self.expect('frame variable date5_abs', substrs = [now_year])
self.expect('frame variable cupertino home europe',
substrs = ['@"America/Los_Angeles"',
@@ -385,7 +360,6 @@ class ObjCDataFormatterTestCase(TestBase):
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd('log timers disable', check=False)
# Execute the cleanup function during test case tear down.
@@ -406,7 +380,6 @@ class ObjCDataFormatterTestCase(TestBase):
'(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)',
'(Point) point = (v=7, h=12)',
'(Point *) point_ptr = (v=7, h=12)',
- 'name:@"TheGuyWhoHasNoName" reason:@"cuz it\'s funny"',
'1985',
'foo_selector_impl'];
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
index 6eb7e021f70b..020e2fc6227a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -415,41 +415,6 @@ int main (int argc, const char * argv[])
CFStringRef cfstring_ref = CFSTR("HELLO WORLD");
-
- CFSetRef set_ref = CFSetCreate(NULL, data_set, 3, NULL);
-
- CFMutableSetRef mutable_set_ref = CFSetCreateMutable(NULL, 5, NULL);
-
- CFSetAddValue(mutable_set_ref, str1);
- CFSetAddValue(mutable_set_ref, str2);
- CFSetAddValue(mutable_set_ref, str3);
- CFSetAddValue(mutable_set_ref, str4);
- CFSetAddValue(mutable_set_ref, str5);
- CFSetAddValue(mutable_set_ref, str6);
- CFSetAddValue(mutable_set_ref, str7);
- CFSetAddValue(mutable_set_ref, str8);
- CFSetAddValue(mutable_set_ref, str9);
- CFSetAddValue(mutable_set_ref, str10);
- CFSetAddValue(mutable_set_ref, str11);
- CFSetAddValue(mutable_set_ref, str12);
-
-
- CFDictionaryRef cfdict_ref = CFDictionaryCreate(NULL, data_set, data_set, 3, NULL, NULL);
- CFMutableDictionaryRef mutable_dict_ref = CFDictionaryCreateMutable(NULL, 16, NULL, NULL);
-
- CFDictionarySetValue(mutable_dict_ref, str1, str1);
- CFDictionarySetValue(mutable_dict_ref, str2, str2);
- CFDictionarySetValue(mutable_dict_ref, str3, str3);
- CFDictionarySetValue(mutable_dict_ref, str4, str1);
- CFDictionarySetValue(mutable_dict_ref, str5, str2);
- CFDictionarySetValue(mutable_dict_ref, str6, str3);
- CFDictionarySetValue(mutable_dict_ref, str7, str1);
- CFDictionarySetValue(mutable_dict_ref, str8, str2);
- CFDictionarySetValue(mutable_dict_ref, str9, str3);
- CFDictionarySetValue(mutable_dict_ref, str10, str1);
- CFDictionarySetValue(mutable_dict_ref, str11, str2);
- CFDictionarySetValue(mutable_dict_ref, str12, str3);
-
CFArrayRef cfarray_ref = CFArrayCreate(NULL, data_set, 3, NULL);
CFMutableArrayRef mutable_array_ref = CFArrayCreateMutable(NULL, 16, NULL);
@@ -466,31 +431,6 @@ int main (int argc, const char * argv[])
CFArraySetValueAtIndex(mutable_array_ref, 9, str11);
CFArraySetValueAtIndex(mutable_array_ref, 10, str12);
- CFMutableBagRef mutable_bag_ref = CFBagCreateMutable(NULL, 15, NULL);
-
- CFBagSetValue(mutable_bag_ref, strB10);
- CFBagSetValue(mutable_bag_ref, str1);
- CFBagSetValue(mutable_bag_ref, str2);
- CFBagSetValue(mutable_bag_ref, str3);
- CFBagSetValue(mutable_bag_ref, str4);
- CFBagSetValue(mutable_bag_ref, str5);
- CFBagSetValue(mutable_bag_ref, str6);
- CFBagSetValue(mutable_bag_ref, str7);
- CFBagSetValue(mutable_bag_ref, str8);
- CFBagSetValue(mutable_bag_ref, str9);
- CFBagSetValue(mutable_bag_ref, str10);
- CFBagSetValue(mutable_bag_ref, str11);
- CFBagSetValue(mutable_bag_ref, str12);
- CFBagSetValue(mutable_bag_ref, strA1);
- CFBagSetValue(mutable_bag_ref, strA2);
- CFBagSetValue(mutable_bag_ref, strA3);
-
- CFBagRef cfbag_ref = CFBagCreateCopy(NULL, mutable_bag_ref);
-
- CFBagSetValue(mutable_bag_ref, strB8);
- CFBagSetValue(mutable_bag_ref, strC4);
-
-
CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
CFBinaryHeapAddValue(binheap_ref, str1);
CFBinaryHeapAddValue(binheap_ref, str2);
@@ -520,6 +460,7 @@ int main (int argc, const char * argv[])
NSDictionary *error_userInfo = @{@"a": @1, @"b" : @2};
NSError *nserror = [[NSError alloc] initWithDomain:@"Foobar" code:12 userInfo:error_userInfo];
+ NSError **nserrorptr = &nserror;
NSBundle* bundle_string = [[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/Accelerate.framework"];
NSBundle* bundle_url = [[NSBundle alloc] initWithURL:[[NSURL alloc] initWithString:@"file://localhost/System/Library/Frameworks/Cocoa.framework"]];
@@ -540,8 +481,6 @@ int main (int argc, const char * argv[])
NSException* except2 = [[NSException alloc] initWithName:@"TheGuyWhoHasNoName`2" reason:@"cuz it's funny" userInfo:nil];
NSException* except3 = [[NSException alloc] initWithName:@"TheGuyWhoHasNoName/3" reason:@"cuz it's funny" userInfo:nil];
- NSMachPort *port = [NSMachPort port];
-
NSURL *nsurl = [[NSURL alloc] initWithString:@"http://www.foo.bar"];
NSURL *nsurl2 = [NSURL URLWithString:@"page.html" relativeToURL:nsurl];
NSURL *nsurl3 = [NSURL URLWithString:@"?whatever" relativeToURL:nsurl2];
@@ -550,22 +489,14 @@ int main (int argc, const char * argv[])
NSDate *date2 = [NSDate dateWithNaturalLanguageString:@"12am January 1, 2011"];
NSDate *date3 = [NSDate date];
NSDate *date4 = [NSDate dateWithTimeIntervalSince1970:24*60*60];
+ NSDate *date5 = [NSDate dateWithTimeIntervalSinceReferenceDate: floor([[NSDate date] timeIntervalSinceReferenceDate])];
CFAbsoluteTime date1_abs = CFDateGetAbsoluteTime(date1);
CFAbsoluteTime date2_abs = CFDateGetAbsoluteTime(date2);
CFAbsoluteTime date3_abs = CFDateGetAbsoluteTime(date3);
CFAbsoluteTime date4_abs = CFDateGetAbsoluteTime(date4);
+ CFAbsoluteTime date5_abs = CFDateGetAbsoluteTime(date5);
- NSCountedSet *nscounted_set = [[NSCountedSet alloc] initWithCapacity:5];
-
- [nscounted_set addObject:str0];
- [nscounted_set addObject:str1];
- [nscounted_set addObject:str0];
- [nscounted_set addObject:str0];
- [nscounted_set addObject:@"foo1"];
- [nscounted_set addObject:@"foo2"];
- [nscounted_set addObject:@"foo3"];
-
NSIndexSet *iset1 = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(1, 4)];
NSIndexSet *iset2 = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(1, 512)];
@@ -598,21 +529,12 @@ int main (int argc, const char * argv[])
NSTimeZone *home_ns = [NSTimeZone timeZoneWithName:@"Europe/Rome"];
NSTimeZone *europe_ns = [NSTimeZone timeZoneWithAbbreviation:@"CET"];
- NSHost *localhost = [NSHost hostWithAddress:@"127.0.0.1"];
-
-#ifndef IOS
- NSTask *my_task = [[NSTask alloc] init];
-#endif
-
-
CFGregorianUnits cf_greg_units = {1,3,5,12,5,7};
CFGregorianDate cf_greg_date = CFAbsoluteTimeGetGregorianDate(CFDateGetAbsoluteTime(date1), NULL);
CFRange cf_range = {4,4};
NSPoint ns_point = {4,4};
NSRange ns_range = {4,4};
-
- NSValue *range_value = [NSValue valueWithRange:ns_range];
-
+
NSRect ns_rect = {{1,1},{5,5}};
NSRect* ns_rect_ptr = &ns_rect;
NSRectArray ns_rect_arr = &ns_rect;
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index e11c45e9038e..f5c792593772 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -8,10 +8,11 @@ from __future__ import print_function
import os, time
+import datetime
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class NSStringDataFormatterTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index 1281f17ab58a..3c9be04a2f6c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DataFormatterOneIsSingularTestCase(TestBase):
@@ -64,14 +65,6 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['1 key/value pair'])
self.expect('frame variable dict', matching=False,
substrs = ['1 key/value pairs'])
- self.expect('frame variable mutable_bag_ref',
- substrs = ['@"1 value"'])
- self.expect('frame variable mutable_bag_ref', matching=False,
- substrs = ['1 values'])
- self.expect('frame variable nscounted_set',
- substrs = ['1 element'])
- self.expect('frame variable nscounted_set', matching=False,
- substrs = ['1 elements'])
self.expect('frame variable imset',
substrs = ['1 index'])
self.expect('frame variable imset', matching=False,
@@ -80,10 +73,6 @@ class DataFormatterOneIsSingularTestCase(TestBase):
substrs = ['@"1 item"'])
self.expect('frame variable binheap_ref', matching=False,
substrs = ['1 items'])
- self.expect('frame variable nsset',
- substrs = ['1 element'])
- self.expect('frame variable nsset', matching=False,
- substrs = ['1 elements'])
self.expect('frame variable immutableData',
substrs = ['1 byte'])
self.expect('frame variable immutableData', matching=False,
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
index 7204d3c7b202..71ab8a746bb6 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/main.m
@@ -11,32 +11,21 @@
int main (int argc, const char * argv[])
{
-
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSArray* key = [NSArray arrayWithObjects:@"foo",nil];
NSArray* value = [NSArray arrayWithObjects:@"key",nil];
NSDictionary *dict = [NSDictionary dictionaryWithObjects:value forKeys:key];
- CFMutableBagRef mutable_bag_ref = CFBagCreateMutable(NULL, 15, NULL);
- CFBagSetValue(mutable_bag_ref, CFSTR("Hello world"));
+ NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init];
+ [imset addIndex:4];
- NSCountedSet *nscounted_set = [[NSCountedSet alloc] initWithCapacity:5];
- [nscounted_set addObject:@"foo"];
+ CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
+ CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world"));
- NSMutableIndexSet *imset = [[NSMutableIndexSet alloc] init];
- [imset addIndex:4];
+ NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1];
- CFBinaryHeapRef binheap_ref = CFBinaryHeapCreate(NULL, 15, &kCFStringBinaryHeapCallBacks, NULL);
- CFBinaryHeapAddValue(binheap_ref, CFSTR("Hello world"));
-
- NSSet* nsset = [[NSSet alloc] initWithObjects:@"foo",nil];
-
- NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:1];
-
-
- [pool drain];// Set break point at this line.
- return 0;
+ [pool drain];// Set break point at this line.
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
index d202ff5d64e1..c7ff28874c5a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class PythonSynthDataFormatterTestCase(TestBase):
@@ -43,6 +44,8 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
@@ -61,39 +64,46 @@ class PythonSynthDataFormatterTestCase(TestBase):
# print the f00_1 variable without a synth
self.expect("frame variable f00_1",
- substrs = ['a = 0',
- 'b = 1',
- 'r = 33']);
+ substrs = ['a = 1',
+ 'b = 2',
+ 'r = 34']);
# now set up the synth
self.runCmd("script from fooSynthProvider import *")
self.runCmd("type synth add -l fooSynthProvider foo")
+ self.expect("type synthetic list foo", substrs=['fooSynthProvider'])
+
+ # note that the value of fake_a depends on target byte order
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000100
# check that we get the two real vars and the fake_a variables
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 0']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
# check that we do not get the extra vars
self.expect("frame variable f00_1", matching=False,
- substrs = ['b = 1']);
+ substrs = ['b = 2']);
# check access to members by name
self.expect('frame variable f00_1.fake_a',
- substrs = ['16777216'])
+ substrs = ['%d' % fake_a_val])
# check access to members by index
self.expect('frame variable f00_1[1]',
- substrs = ['16777216'])
+ substrs = ['%d' % fake_a_val])
# put synthetic children in summary in several combinations
self.runCmd("type summary add --summary-string \"fake_a=${svar.fake_a}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=16777216'])
+ substrs = ['fake_a=%d' % fake_a_val])
self.runCmd("type summary add --summary-string \"fake_a=${svar[1]}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=16777216'])
+ substrs = ['fake_a=%d' % fake_a_val])
# clear the summary
self.runCmd("type summary delete foo")
@@ -101,23 +111,39 @@ class PythonSynthDataFormatterTestCase(TestBase):
# check that the caching does not span beyond the stopoint
self.runCmd("n")
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000200
+
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 1']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 2']);
# check that altering the object also alters fake_a
self.runCmd("expr f00_1.a = 280")
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000001
+ else:
+ fake_a_val = 0x00011800
+
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777217',
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
'a = 280']);
# check that expanding a pointer does the right thing
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x0d000000
+ else:
+ fake_a_val = 0x00000c00
+
self.expect("frame variable --ptr-depth 1 f00_ptr",
- substrs = ['r = 45',
- 'fake_a = 218103808',
- 'a = 12'])
+ substrs = ['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
# now add a filter.. it should fail
self.expect("type filter add foo --child b --child j", error=True,
@@ -129,7 +155,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
'j = 17'])
self.expect("frame variable --ptr-depth 1 f00_ptr",
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# now delete the synth and add the filter
@@ -137,11 +163,11 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.runCmd("type filter add foo --child b --child j")
self.expect('frame variable f00_1',
- substrs = ['b = 1',
- 'j = 17'])
+ substrs = ['b = 2',
+ 'j = 18'])
self.expect("frame variable --ptr-depth 1 f00_ptr", matching=False,
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# now add the synth and it should fail
@@ -162,11 +188,11 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.runCmd("type synth add -l fooSynthProvider foo")
self.expect('frame variable f00_1', matching=False,
- substrs = ['b = 1',
- 'j = 17'])
+ substrs = ['b = 2',
+ 'j = 18'])
self.expect("frame variable --ptr-depth 1 f00_ptr",
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# check the listing
@@ -183,8 +209,8 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.expect("frame variable f00_1",
substrs = ['a = 280',
- 'b = 1',
- 'j = 17']);
+ 'b = 2',
+ 'j = 18']);
self.expect("frame variable f00_1", matching=False,
substrs = ['fake_a = '])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp
index 48b29dcfd6e4..f45a2abfb9f1 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp
@@ -48,7 +48,7 @@ struct wrapint
int main()
{
- foo f00_1(0);
+ foo f00_1(1);
foo *f00_ptr = new foo(12);
f00_1.a++; // Set break point at this line.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
index 324b372cb11e..7ebc1c14ce13 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
@@ -52,6 +52,7 @@ class ScriptDataFormatterTestCase(TestBase):
script = 'a = valobj.GetChildMemberWithName(\'integer\'); a_val = a.GetValue(); str = \'Hello from Python, \' + a_val + \' time\'; return str + (\'!\' if a_val == \'1\' else \'s!\');'
self.runCmd("type summary add i_am_cool --python-script \"%s\"" % script)
+ self.expect('type summary list i_am_cool', substrs=[script])
self.expect("frame variable one",
substrs = ['Hello from Python',
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
index b438bbb970f6..a92cffcc319b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
@@ -1,6 +1,7 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
+USE_LIBSTDCPP := 1
# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
# targets. Other targets do not, which causes this test to fail.
@@ -12,8 +13,3 @@ endif
include $(LEVEL)/Makefile.rules
CXXFLAGS += -O0
-
-ifeq (,$(findstring gcc,$(CC)))
-CXXFLAGS += -stdlib=libstdc++
-LDFLAGS += -stdlib=libstdc++
-endif
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
index 38e700812d05..c186f1465cf5 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
@@ -8,15 +8,16 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class SkipSummaryDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureFreeBSD("llvm.org/pr20548") # fails to build on lab.llvm.org buildbot
- @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr20548 fails to build on lab.llvm.org buildbot")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test data formatter commands."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
index ca8858dbad9b..b3f8ba7d048e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class SmartArrayDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test data formatter commands."""
self.build()
@@ -35,6 +36,8 @@ class SmartArrayDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
@@ -310,39 +313,81 @@ class SmartArrayDataFormatterTestCase(TestBase):
self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"float [7]\"")
self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"int [5]\"")
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
-
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
+ else:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '42 9d 00 00,42 9a 80 00,42 9c 00 00,42 98 40 00,42 99 80 00,42 99 c0 00,42 9a 00 00'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
+ else:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '41 cc 00 00,41 ca 00 00,41 c9 00 00,41 d6 00 00,41 db 00 00,41 dc 00 00,41 d1 00 00'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
+ else:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '00 00 00 01,00 00 00 01,00 00 00 02,00 00 00 03,00 00 00 05'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
+ else:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '00 00 00 09,00 00 00 08,00 00 00 07,00 00 00 06,00 00 00 05'])
self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"float [7]\"")
self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"int [5]\"")
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
-
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '....,01 00 00 00',
- '....,05 00 00 00'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00',
- '....,07 00 00 00'])
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
+ else:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '42 9d 00 00 B...,42 9a 80 00 B...,42 9c 00 00 B...,42 98 40 00 B.@.,42 99 80 00 B...,42 99 c0 00 B...,42 9a 00 00 B...'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
+ else:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '41 cc 00 00 A...,41 ca 00 00 A...,41 c9 00 00 A...,41 d6 00 00 A...,41 db 00 00 A...,41 dc 00 00 A...,41 d1 00 00 A...'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '....,01 00 00 00',
+ '....,05 00 00 00'])
+ else:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '....,00 00 00 01',
+ '....,00 00 00 05'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '09 00 00 00',
+ '....,07 00 00 00'])
+ else:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '00 00 00 09',
+ '....,00 00 00 07'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile
new file mode 100644
index 000000000000..fdd717119d95
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../../../make
+CXX_SOURCES := main.cpp
+CXXFLAGS += -std=c++11
+USE_LIBCPP := 1
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
new file mode 100644
index 000000000000..083f713c259d
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
@@ -0,0 +1,52 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class LibCxxAtomicTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def get_variable(self, name):
+ var = self.frame().FindVariable(name)
+ var.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
+ var.SetPreferSyntheticValue(True)
+ return var
+
+ @skipIf(compiler="gcc")
+ @skipIfWindows # libc++ not ported to Windows yet
+ def test(self):
+ """Test that std::atomic as defined by libc++ is correctly printed by LLDB"""
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ s = self.get_variable('s')
+ i = self.get_variable('i')
+
+ if self.TraceOn(): print(s)
+ if self.TraceOn(): print(i)
+
+ self.assertTrue(i.GetValueAsUnsigned(0) == 5, "i == 5")
+ self.assertTrue(s.GetNumChildren() == 2, "s has two children")
+ self.assertTrue(s.GetChildAtIndex(0).GetValueAsUnsigned(0) == 1, "s.x == 1")
+ self.assertTrue(s.GetChildAtIndex(1).GetValueAsUnsigned(0) == 2, "s.y == 2")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
new file mode 100644
index 000000000000..0eb2418c628a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
@@ -0,0 +1,26 @@
+//===-- main.cpp --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <atomic>
+
+struct S {
+ int x = 1;
+ int y = 2;
+};
+
+int main ()
+{
+ std::atomic<S> s;
+ s.store(S());
+ std::atomic<int> i;
+ i.store(5);
+
+ return 0; // Set break point at this line.
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
index e01f1b6679fc..d452c1be69bf 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
@@ -8,16 +8,17 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class InitializerListTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfWindows # libc++ not ported to Windows yet
- @skipIfGcc
- @expectedFailureLinux # fails on clang 3.5 and tot
+ @skipIf(compiler="gcc")
+ @expectedFailureAll(oslist=["linux"], bugnumber="fails on clang 3.5 and tot")
def test(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index a87a2ed2d434..23f6956cf3f0 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxIteratorDataFormatterTestCase(TestBase):
@@ -21,7 +22,7 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that libc++ iterators format properly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
index 18ee31a86106..6fcdc37465db 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time, re
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxListDataFormatterTestCase(TestBase):
@@ -24,8 +25,9 @@ class LibcxxListDataFormatterTestCase(TestBase):
self.line3 = line_number('main.cpp', '// Set third break point at this line.')
self.line4 = line_number('main.cpp', '// Set fourth break point at this line.')
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
+ @expectedFailureAll(oslist=["macosx"], bugnumber="rdar://25499635")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index 167cb2b887af..9e68e1dbc004 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -9,16 +9,18 @@ from __future__ import print_function
import os, time, re
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
@add_test_categories(["pyapi"])
+ @skipIfDarwin # rdar://25499635
def test_with_run_command(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index 70a98f9c2cae..cecc3178b318 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index d0ca73d3251d..eb74818c91f5 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -9,14 +9,16 @@ from __future__ import print_function
import os, time
import lldb
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class LibcxxMultiMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfWindows # libc++ not ported to Windows yet
- @skipIfGcc
+ @skipIf(compiler="gcc")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index 384f6130d0c0..cfdfd07ddec1 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxMultiSetDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index fcbfb0a8f0ed..00c1e548cf6b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -8,62 +8,63 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxSetDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+# bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
-
- # This is the function to remove the custom formats in order to have a
- # clean slate for the next test case.
- def cleanup():
- self.runCmd('type format clear', check=False)
- self.runCmd('type summary clear', check=False)
- self.runCmd('type filter clear', check=False)
- self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
-
- # Execute the cleanup function during test case tear down.
- self.addTearDownHook(cleanup)
-
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
- self.expect("frame variable ii",substrs = ["size=0","{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
- self.expect("frame variable ii[2]",substrs = [" = 2"])
- self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=0","{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=0","{}"])
- self.expect("frame variable ss",substrs = ["size=0","{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
- self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
- self.expect("frame variable ss[2]",substrs = [' = "b"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])
+# lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+#
+# # The stop reason of the thread should be breakpoint.
+# self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+# substrs = ['stopped',
+# 'stop reason = breakpoint'])
+#
+# # This is the function to remove the custom formats in order to have a
+# # clean slate for the next test case.
+# def cleanup():
+# self.runCmd('type format clear', check=False)
+# self.runCmd('type summary clear', check=False)
+# self.runCmd('type filter clear', check=False)
+# self.runCmd('type synth clear', check=False)
+# self.runCmd("settings set target.max-children-count 256", check=False)
+#
+# # Execute the cleanup function during test case tear down.
+# self.addTearDownHook(cleanup)
+#
+# self.expect('image list', substrs = self.getLibcPlusPlusLibs())
+#
+# self.expect("frame variable ii",substrs = ["size=0","{}"])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
+# self.expect("frame variable ii[2]",substrs = [" = 2"])
+# self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ii",substrs = ["size=0","{}"])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ii",substrs = ["size=0","{}"])
+# self.expect("frame variable ss",substrs = ["size=0","{}"])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"'])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
+# self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
+# self.expect("frame variable ss[2]",substrs = [' = "b"'])
+# lldbutil.continue_to_breakpoint(self.process(), bkpt)
+# self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index 942124255f55..76eedb8c8919 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxStringDataFormatterTestCase(TestBase):
@@ -22,7 +23,7 @@ class LibcxxStringDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index 5e6ec2519323..4765cd70f67c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -8,15 +8,16 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxUnorderedDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfWindows # libc++ not ported to Windows yet
- @skipIfGcc
+ @skipIf(compiler="gcc")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
@@ -72,4 +73,5 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
def look_for_content_and_continue(self, var_name, patterns):
self.expect( ("frame variable %s" % var_name), patterns=patterns)
+ self.expect( ("frame variable %s" % var_name), patterns=patterns)
self.runCmd("continue")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
index 9771a819aa6b..fe3b6c115e31 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxVBoolDataFormatterTestCase(TestBase):
@@ -21,7 +22,7 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows.
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
index f8cd65be0931..9a145fba73e8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LibcxxVectorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfGcc
+ @skipIf(compiler="gcc")
@skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index 6742c9e71701..dbaa37daa2d1 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdIteratorDataFormatterTestCase(TestBase):
@@ -22,7 +23,7 @@ class StdIteratorDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIfWindows # libstdcpp not ported to Windows
- @expectedFailureIcc # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers
+ @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
def test_with_run_command(self):
"""Test that libstdcpp iterators format properly."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index 5147d18da0fe..55658af1f2a3 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdListDataFormatterTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index e21c4e94c2c4..ff99255aec0c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdMapDataFormatterTestCase(TestBase):
@@ -21,7 +22,7 @@ class StdMapDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureIcc # llvm.org/pr15301: LLDB prints incorrect size of libstdc++ containers
+ @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
@skipIfWindows # libstdcpp not ported to Windows
@skipIfFreeBSD
def test_with_run_command(self):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
new file mode 100644
index 000000000000..88cb026aba1c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
@@ -0,0 +1,15 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+CXXFLAGS := -O0
+USE_LIBSTDCPP := 1
+
+# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
+# targets. Other targets do not, which causes this test to fail.
+# This flag enables FullDebugInfo for all targets.
+ifneq (,$(findstring clang,$(CC)))
+ CFLAGS_EXTRAS += -fno-limit-debug-info
+endif
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
new file mode 100644
index 000000000000..20b1a3d21156
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
@@ -0,0 +1,46 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class StdSmartPtrDataFormatterTestCase(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipIfFreeBSD
+ @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfDarwin # doesn't compile on Darwin
+ def test_with_run_command(self):
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped', 'stop reason = breakpoint'])
+
+ self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
+ self.expect("frame variable isp", substrs = ['isp = 123'])
+ self.expect("frame variable ssp", substrs = ['ssp = "foobar"'])
+
+ self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
+ self.expect("frame variable iwp", substrs = ['iwp = 123'])
+ self.expect("frame variable swp", substrs = ['swp = "foobar"'])
+
+ self.runCmd("continue")
+
+ self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
+ self.expect("frame variable isp", substrs = ['isp = nullptr'])
+ self.expect("frame variable ssp", substrs = ['ssp = nullptr'])
+
+ self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
+ self.expect("frame variable iwp", substrs = ['iwp = nullptr'])
+ self.expect("frame variable swp", substrs = ['swp = nullptr'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp
new file mode 100644
index 000000000000..7ba50875a6db
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp
@@ -0,0 +1,20 @@
+#include <memory>
+#include <string>
+
+int
+main()
+{
+ std::shared_ptr<char> nsp;
+ std::shared_ptr<int> isp(new int{123});
+ std::shared_ptr<std::string> ssp = std::make_shared<std::string>("foobar");
+
+ std::weak_ptr<char> nwp;
+ std::weak_ptr<int> iwp = isp;
+ std::weak_ptr<std::string> swp = ssp;
+
+ nsp.reset(); // Set break point at this line.
+ isp.reset();
+ ssp.reset();
+
+ return 0; // Set break point at this line.
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index 2d6af24c6afc..fde2f791183a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdStringDataFormatterTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index 9e73009aba83..f5cf7c04c3a7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdVBoolDataFormatterTestCase(TestBase):
@@ -21,8 +22,8 @@ class StdVBoolDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureFreeBSD("llvm.org/pr20548") # fails to build on lab.llvm.org buildbot
- @expectedFailureIcc # llvm.org/pr15301: lldb does not print the correct sizes of STL containers when building with ICC
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot')
+ @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
@skipIfWindows # libstdcpp not ported to Windows.
@skipIfDarwin
def test_with_run_command(self):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index ed4313657e93..4a352ef41c17 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class StdVectorDataFormatterTestCase(TestBase):
@@ -22,7 +23,7 @@ class StdVectorDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIfFreeBSD
- @expectedFailureIcc # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers
+ @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
@skipIfWindows # libstdcpp not ported to Windows
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
new file mode 100644
index 000000000000..6a03456e5c32
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
@@ -0,0 +1,56 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class DataFormatterSynthTypeTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.cpp', 'break here')
+
+ @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
+ def test_with_run_command(self):
+ """Test using Python synthetic children provider to provide a typename."""
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type filter clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.runCmd("script from myIntSynthProvider import *")
+ self.runCmd("type synth add -l myIntSynthProvider myInt")
+
+ self.expect('frame variable x', substrs=['ThisTestPasses'])
+ self.expect('frame variable y', substrs=['ThisTestPasses'])
+ self.expect('frame variable z', substrs=['ThisTestPasses'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp
new file mode 100644
index 000000000000..accbf0a5a578
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp
@@ -0,0 +1,29 @@
+class myInt {
+ private: int theValue;
+ public: myInt() : theValue(0) {}
+ public: myInt(int _x) : theValue(_x) {}
+ int val() { return theValue; }
+};
+
+class myArray {
+public:
+ int array[16];
+};
+
+class hasAnInt {
+ public:
+ myInt theInt;
+ hasAnInt() : theInt(42) {}
+};
+
+myInt operator + (myInt x, myInt y) { return myInt(x.val() + y.val()); }
+
+int main() {
+ myInt x{3};
+ myInt y{4};
+ myInt z {x+y};
+ hasAnInt hi;
+ myArray ma;
+
+ return z.val(); // break here
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
new file mode 100644
index 000000000000..42737140b112
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
@@ -0,0 +1,36 @@
+class myIntSynthProvider(object):
+ def __init__(self, valobj, dict):
+ self.valobj = valobj;
+ self.val = self.valobj.GetChildMemberWithName("theValue")
+ def num_children(self):
+ return 0;
+ def get_child_at_index(self, index):
+ return None
+ def get_child_index(self, name):
+ return None
+ def update(self):
+ return False
+ def has_children(self):
+ return False
+ def get_type_name(self):
+ return "ThisTestPasses"
+
+
+class myArraySynthProvider(object):
+ def __init__(self, valobj, dict):
+ self.valobj = valobj
+ self.array = self.valobj.GetChildMemberWithName("array")
+
+ def num_children(self, max_count):
+ if 16 < max_count:
+ return 16
+ return max_count
+
+ def get_child_at_index(self, index):
+ return None # Keep it simple when this is not tested here.
+
+ def get_child_index(self, name):
+ return None # Keep it simple when this is not tested here.
+
+ def has_children(self):
+ return True
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
index 8d6e5df37a5c..e7a34647a6de 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DataFormatterSynthValueTestCase(TestBase):
@@ -22,7 +23,7 @@ class DataFormatterSynthValueTestCase(TestBase):
self.line = line_number('main.cpp', 'break here')
@skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
- @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test using Python synthetic children provider to provide a value."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
index 8ae09d691940..886d09fda456 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
@@ -2,4 +2,4 @@ from __future__ import absolute_import
from lldbsuite.test import lldbinline
-lldbinline.MakeInlineTest(__file__, globals(), [lldbinline.expectedFailureWindows("llvm.org/pr24663")])
+lldbinline.MakeInlineTest(__file__, globals(), [lldbinline.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index a12f9c841a7f..871cc19373a4 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class NSArraySyntheticTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index 13d493ecbdcc..5ee54c3a2952 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class NSDictionarySyntheticTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index 6c558001bb04..d1680434d3b9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class NSSetSyntheticTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
index 4fb6176e9e4f..4158ec8a661c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DataFormatterOSTypeTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
new file mode 100644
index 000000000000..700b7418118a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
@@ -0,0 +1,70 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import datetime
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class PrintArrayTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_print_array(self):
+ """Test that expr -Z works"""
+ self.build()
+ self.printarray_data_formatter_commands()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.cpp', 'break here')
+
+ def printarray_data_formatter_commands(self):
+ """Test that expr -Z works"""
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.expect('expr --element-count 3 -- data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
+ self.expect('expr data', substrs=['int *', '$', '0x'])
+ self.expect('expr -f binary --element-count 0 -- data', substrs=['int *', '$', '0b'])
+ self.expect('expr -f hex --element-count 3 -- data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
+ self.expect('expr -f binary --element-count 2 -- data', substrs=['int *', '$', '0x', '[0] = 0b', '1', '[1] = 0b', '11'])
+ self.expect('parray 3 data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
+ self.expect('parray `1 + 1 + 1` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
+ self.expect('parray `data[1]` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
+ self.expect('parray/x 3 data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
+ self.expect('parray/x `data[1]` data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
+
+ # check error conditions
+ self.expect('expr --element-count 10 -- 123', error=True, substrs=['expression cannot be used with --element-count as it does not refer to a pointer'])
+ self.expect('expr --element-count 10 -- (void*)123', error=True, substrs=['expression cannot be used with --element-count as it refers to a pointer to void'])
+ self.expect('parray data', error=True, substrs=["invalid element count 'data'"])
+ self.expect('parray data data', error=True, substrs=["invalid element count 'data'"])
+ self.expect('parray', error=True, substrs=['Not enough arguments provided'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp
new file mode 100644
index 000000000000..b2d6309947ad
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/main.cpp
@@ -0,0 +1,29 @@
+//===-- main.cpp -------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <functional>
+#include <stdlib.h>
+
+template<typename ElemType>
+ElemType* alloc(size_t count, std::function<ElemType(size_t)> get)
+{
+ ElemType *elems = new ElemType[count];
+ for(size_t i = 0; i < count; i++)
+ elems[i] = get(i);
+ return elems;
+}
+
+int main (int argc, const char * argv[])
+{
+ int* data = alloc<int>(5, [] (size_t idx) -> int {
+ return 2 * idx + 1;
+ });
+ return 0; // break here
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile
new file mode 100644
index 000000000000..261658b10ae8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/Makefile
@@ -0,0 +1,9 @@
+LEVEL = ../../../make
+
+OBJCXX_SOURCES := main.mm
+
+CFLAGS_EXTRAS += -w
+
+include $(LEVEL)/Makefile.rules
+
+LDFLAGS += -framework Foundation
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
new file mode 100644
index 000000000000..7eb26a569867
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
@@ -0,0 +1,60 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import datetime
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class PrintObjectArrayTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessDarwin
+ def test_print_array(self):
+ """Test that expr -O -Z works"""
+ self.build()
+ self.printarray_data_formatter_commands()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.mm', 'break here')
+
+ def printarray_data_formatter_commands(self):
+ """Test that expr -O -Z works"""
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.expect('expr --element-count 3 --object-description -- objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 ='])
+ self.expect('poarray 3 objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 ='])
+ self.expect('expr --element-count 3 --object-description --description-verbosity=full -- objects', substrs=['[0] =', '3735928559', '4276993775', '3203398366', '[1] =', 'Hello', 'World', '[2] =', 'Two =', '1 ='])
+ self.expect('parray 3 objects', substrs=['[0] = 0x', '[1] = 0x', '[2] = 0x'])
+ self.expect('expr --element-count 3 -d run -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs'])
+ self.expect('expr --element-count 3 -d run --ptr-depth=1 -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs', '3735928559', '4276993775', '3203398366', '"Hello"', '"World"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm
new file mode 100644
index 000000000000..9ef61e6a73f2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/main.mm
@@ -0,0 +1,30 @@
+//===-- main.cpp -------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#import <Foundation/Foundation.h>
+
+struct ThreeObjects
+{
+ id one;
+ id two;
+ id three;
+};
+
+int main()
+{
+ NSArray *array1 = @[@0xDEADBEEF, @0xFEEDBEEF, @0xBEEFFADE];
+ NSArray *array2 = @[@"Hello", @"World"];
+ NSDictionary *dictionary = @{@1: array2, @"Two": array2};
+ ThreeObjects *tobjects = new ThreeObjects();
+ tobjects->one = array1;
+ tobjects->two = array2;
+ tobjects->three = dictionary;
+ id* objects = (id*)tobjects;
+ return 0; // break here
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
index 80305e303d03..791ce27dad00 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
@@ -1,4 +1,4 @@
-import lldbsuite.test.lldbinline as lldbinline
-import lldbsuite.test.lldbtest as lldbtest
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.skipIfFreeBSD,lldbtest.skipIfLinux,lldbtest.skipIfWindows])
+lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipIfFreeBSD,decorators.skipIfLinux,decorators.skipIfWindows])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
index 69f7d48c8b6c..e26344f2711a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
@@ -1,4 +1,4 @@
-import lldbsuite.test.lldbinline as lldbinline
-import lldbsuite.test.lldbtest as lldbtest
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.expectedFailureWindows("llvm.org/pr24772")])
+lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index 0550f57ae62a..e8b6c1ad95f5 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class SyntheticCappingTestCase(TestBase):
@@ -30,6 +31,8 @@ class SyntheticCappingTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
@@ -51,25 +54,31 @@ class SyntheticCappingTestCase(TestBase):
self.runCmd("script from fooSynthProvider import *")
self.runCmd("type synth add -l fooSynthProvider foo")
+ # note that the value of fake_a depends on target byte order
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000100
+
# check that the synthetic children work, so we know we are doing the right thing
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 0']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
# check that capping works
self.runCmd("settings set target.max-children-count 2", check=False)
self.expect("frame variable f00_1",
substrs = ['...',
- 'fake_a = 16777216',
- 'a = 0']);
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
self.expect("frame variable f00_1", matching=False,
- substrs = ['r = 33']);
+ substrs = ['r = 34']);
self.runCmd("settings set target.max-children-count 256", check=False)
self.expect("frame variable f00_1", matching=True,
- substrs = ['r = 33']);
+ substrs = ['r = 34']);
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
index fb95ac2b54d0..1a7e5679c0b8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
@@ -1,21 +1,21 @@
import lldb
class fooSynthProvider:
- def __init__(self, valobj, dict):
- self.valobj = valobj;
- self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)
- def num_children(self):
- return 3;
- def get_child_at_index(self, index):
- if index == 0:
- child = self.valobj.GetChildMemberWithName('a');
- if index == 1:
- child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type);
- if index == 2:
- child = self.valobj.GetChildMemberWithName('r');
- return child;
- def get_child_index(self, name):
- if name == 'a':
- return 0;
- if name == 'fake_a':
- return 1;
- return 2;
+ def __init__(self, valobj, dict):
+ self.valobj = valobj;
+ self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)
+ def num_children(self):
+ return 3;
+ def get_child_at_index(self, index):
+ if index == 0:
+ child = self.valobj.GetChildMemberWithName('a');
+ if index == 1:
+ child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type);
+ if index == 2:
+ child = self.valobj.GetChildMemberWithName('r');
+ return child;
+ def get_child_index(self, name):
+ if name == 'a':
+ return 0;
+ if name == 'fake_a':
+ return 1;
+ return 2;
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
index b921915b91c5..fec7907e0031 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
@@ -48,7 +48,7 @@ struct wrapint
int main()
{
- foo f00_1(0);
+ foo f00_1(1);
foo *f00_ptr = new foo(12);
f00_1.a++; // Set break point at this line.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
index 6b70a88b9f2c..23a31da685de 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
@@ -6,11 +6,12 @@ from __future__ import print_function
+import datetime
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import datetime
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class SyntheticFilterRecomputingTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
new file mode 100644
index 000000000000..6568056f761b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
@@ -0,0 +1,31 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TypeSummaryListArgumentTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ @no_debug_info_test
+ def test_type_summary_list_with_arg(self):
+ """Test that the 'type summary list' command handles command line arguments properly"""
+ self.expect('type summary list Foo', substrs=['Category: default', 'Category: system'])
+ self.expect('type summary list char', substrs=['char *', 'unsigned char'])
+
+ self.expect('type summary list -w default', substrs=['system'], matching=False)
+ self.expect('type summary list -w system unsigned', substrs=['default', '0-9'], matching=False)
+ self.expect('type summary list -w system char', substrs=['unsigned char *'], matching=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
new file mode 100644
index 000000000000..63a4a3a4ba8c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
@@ -0,0 +1,61 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TypeSummaryListScriptTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_typesummarylist_script(self):
+ """Test data formatter commands."""
+ self.build()
+ self.data_formatter_commands()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.cpp', 'Break here')
+
+ def data_formatter_commands(self):
+ """Test printing out Python summary formatters."""
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type category delete TSLSFormatters', check=False)
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type filter clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ self.addTearDownHook(cleanup)
+
+ self.runCmd("command script import tslsformatters.py")
+
+ self.expect("frame variable myStruct", substrs=['A data formatter at work'])
+
+ self.expect('type summary list', substrs=['Struct_SummaryFormatter'])
+ self.expect('type summary list Struct', substrs=['Struct_SummaryFormatter'])
+
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp
new file mode 100644
index 000000000000..2de37041f263
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/main.cpp
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+typedef struct Struct
+{
+ int one;
+ int two;
+} Struct;
+
+int
+main()
+{
+ Struct myStruct = {10, 20};
+ printf ("Break here: %d\n.", myStruct.one);
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
new file mode 100644
index 000000000000..d1ce8b7db17a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
@@ -0,0 +1,10 @@
+import lldb
+
+def Struct_SummaryFormatter(valobj, internal_dict):
+ return 'A data formatter at work'
+
+category = lldb.debugger.CreateCategory("TSLSFormatters")
+category.SetEnabled(True)
+summary = lldb.SBTypeSummary.CreateWithFunctionName("tslsformatters.Struct_SummaryFormatter", lldb.eTypeOptionCascade)
+spec = lldb.SBTypeNameSpecifier("Struct", False)
+category.AddTypeSummary(spec, summary)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
index 30b66e062827..41b8c3499ccd 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
@@ -1,4 +1,4 @@
-import lldbsuite.test.lldbinline as lldbinline
-import lldbsuite.test.lldbtest as lldbtest
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [lldbtest.expectedFailureGcc])
+lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(compiler="gcc")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
index 4d060c332f93..f3eced625898 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
@@ -7,10 +7,11 @@ from __future__ import print_function
import os, time
+import os.path
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import os.path
+from lldbsuite.test import lldbutil
class PythonSynthDataFormatterTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
index 05899a24ad22..365ddff3c7e8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class VectorTypesFormattingTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py b/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
index f10736bd75c0..efbaa69eef57 100644
--- a/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
+++ b/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
@@ -8,15 +8,17 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DeadStripTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24778")
- @expectedFailureDwo("llvm.org/pr25087")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
+ @expectedFailureAll(debug_info="dwo", bugnumber="llvm.org/pr25087")
+ @expectedFailureAll(oslist=["linux"], debug_info="gmodules", bugnumber="llvm.org/pr27865")
@skipIfFreeBSD # The -dead_strip linker option isn't supported on FreeBSD versions of ld.
def test(self):
"""Test breakpoint works correctly with dead-code stripping."""
diff --git a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
index df2308de7605..be0ea1441333 100644
--- a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class DisassemblyTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows # Function name prints fully demangled instead of name-only
+ @expectedFailureAll(oslist=["windows"], bugnumber="function names print fully demangled instead of name-only")
def test(self):
self.build()
exe = os.path.join (os.getcwd(), "a.out")
@@ -41,7 +42,10 @@ class DisassemblyTestCase(TestBase):
instructions = [' add ', ' ldr ', ' str ']
elif re.match("mips" , arch):
breakpoint_opcodes = ["break"]
- instructions = ['lw', 'sw', 'jr']
+ instructions = ['lw', 'sw']
+ elif arch in ["s390x"]:
+ breakpoint_opcodes = [".long"]
+ instructions = [' l ', ' a ', ' st ']
else:
# TODO please add your arch here
self.fail('unimplemented for arch = "{arch}"'.format(arch=self.getArchitecture()))
diff --git a/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
index ac039990b5bf..37593768f4a8 100644
--- a/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class DynamicValueChildCountTestCase(TestBase):
@@ -31,11 +32,8 @@ class DynamicValueChildCountTestCase(TestBase):
self.main_sixth_call_line = line_number('pass-to-base.cpp',
'// Break here and check b has 0 children again')
- @expectedFailureLinux("llvm.org/pr23039")
- @expectedFailureFreeBSD("llvm.org/pr19311") # continue at a breakpoint does not work
- @expectedFailureWindows("llvm.org/pr24663")
- @expectedFailurei386("to be figured out")
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
def test_get_dynamic_vals(self):
"""Test fetching C++ dynamic values from pointers & references."""
"""Get argument vals for the call stack when stopped on a breakpoint."""
diff --git a/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
index eddaa3cc9840..4b1880dee96f 100644
--- a/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
+++ b/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
@@ -6,7 +6,9 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ConvenienceVariablesCase(TestBase):
@@ -20,7 +22,7 @@ class ConvenienceVariablesCase(TestBase):
@skipIfFreeBSD # llvm.org/pr17228
@skipIfRemote
- @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_with_run_commands(self):
"""Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
index 9321a308a83c..912d51fb6b02 100644
--- a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -8,9 +8,10 @@ from __future__ import print_function
import lldb
import os
import time
+from lldbsuite.support import seven
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import lldbsuite.support.seven as seven
+from lldbsuite.test import lldbutil
def execute_command (command):
#print('%% %s' % (command))
@@ -55,15 +56,18 @@ class ExecTestCase(TestBase):
self.assertTrue(process.GetState() == lldb.eStateStopped,
STOPPED_DUE_TO_BREAKPOINT)
- thread = process.GetThreadAtIndex (0)
+ threads = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint)
+ self.assertTrue(len(threads) == 1)
- self.assertTrue (thread.IsValid(),
- "Process stopped at 'main' should have a valid thread");
+ # We had a deadlock tearing down the TypeSystemMap on exec, but only if some
+ # expression had been evaluated. So make sure we do that here so the teardown
+ # is not trivial.
- stop_reason = thread.GetStopReason()
-
- self.assertTrue (stop_reason == lldb.eStopReasonBreakpoint,
- "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint");
+ thread = threads[0]
+ value = thread.frames[0].EvaluateExpression("1 + 2")
+ self.assertTrue(value.IsValid(), "Expression evaluated successfully")
+ int_value = value.GetValueAsSigned()
+ self.assertTrue(int_value == 3, "Expression got the right result.")
# Run and we should stop due to exec
process.Continue()
@@ -71,15 +75,11 @@ class ExecTestCase(TestBase):
self.assertTrue(process.GetState() == lldb.eStateStopped,
"Process should be stopped at __dyld_start")
- thread = process.GetThreadAtIndex (0)
-
- self.assertTrue (thread.IsValid(),
- "Process stopped at exec should have a valid thread");
-
- stop_reason = thread.GetStopReason()
-
- self.assertTrue (stop_reason == lldb.eStopReasonExec,
- "Thread in process stopped on exec should have a stop reason of eStopReasonExec");
-
+ threads = lldbutil.get_stopped_threads(process, lldb.eStopReasonExec)
+ self.assertTrue(len(threads) == 1, "We got a thread stopped for exec.")
+
# Run and we should stop at breakpoint in main after exec
process.Continue()
+
+ threads = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint)
+ self.assertTrue(len(threads) == 1, "Stopped at breakpoint in exec'ed process.")
diff --git a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
index a54b45822a6a..1492fe069220 100644
--- a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
+++ b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class ExprDoesntDeadlockTestCase(TestBase):
@@ -19,9 +20,8 @@ class ExprDoesntDeadlockTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureFreeBSD('llvm.org/pr17946')
- @expectedFlakeyLinux # failed 1/365 test runs, line 61, thread.IsValid()
- @expectedFailureWindows # Windows doesn't have pthreads, need to port this test.
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr17946')
+ @expectedFailureAll(oslist=["windows"], bugnumber="Windows doesn't have pthreads, test needs to be ported")
def test_with_run_command(self):
"""Test that expr will time out and allow other threads to run if it blocks."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py b/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
index 19a2dba2109a..6d2763c1ead1 100644
--- a/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
+++ b/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
@@ -8,9 +8,10 @@ from __future__ import print_function
import lldb
import os
import time
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
import lldbsuite.support.seven as seven
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
def execute_command (command):
# print('%% %s' % (command))
diff --git a/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py b/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
index cc962150bc8c..0ba036124b03 100644
--- a/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
+++ b/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
@@ -8,13 +8,15 @@ from __future__ import print_function
import os
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestFormats(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureHostWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_formats(self):
"""Test format string functionality."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py b/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
index 950b021b69ce..ceeb2eadaf4f 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -6,55 +6,56 @@ from __future__ import print_function
import os, time
import lldb
-import lldbsuite.test.lldbutil as lldbutil
-import lldbsuite.test.lldbplatformutil as lldbplatformutil
+from lldbsuite.test import lldbutil
+from lldbsuite.test import lldbplatformutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class AssertingInferiorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
- @expectedFailurei386("llvm.org/pr25338")
- @expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["linux"], archs=["arm"], bugnumber="llvm.org/pr25338")
+ @expectedFailureAll(bugnumber="llvm.org/pr26592", triple = '^mips')
def test_inferior_asserting(self):
"""Test that lldb reliably catches the inferior asserting (command)."""
self.build()
self.inferior_asserting()
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
@expectedFailureAndroid(api_levels=list(range(16 + 1))) # b.android.com/179836
def test_inferior_asserting_register(self):
"""Test that lldb reliably reads registers from the inferior after asserting (command)."""
self.build()
self.inferior_asserting_registers()
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
- @expectedFailurei386("llvm.org/pr25338")
- @expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["linux"], archs=["aarch64", "arm"], bugnumber="llvm.org/pr25338")
+ @expectedFailureAll(bugnumber="llvm.org/pr26592", triple = '^mips')
def test_inferior_asserting_disassemble(self):
"""Test that lldb reliably disassembles frames after asserting (command)."""
self.build()
self.inferior_asserting_disassemble()
@add_test_categories(['pyapi'])
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
def test_inferior_asserting_python(self):
"""Test that lldb reliably catches the inferior asserting (Python API)."""
self.build()
self.inferior_asserting_python()
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
- @expectedFailurei386("llvm.org/pr25338")
- @expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["linux"], archs=["aarch64", "arm"], bugnumber="llvm.org/pr25338")
+ @expectedFailureAll(bugnumber="llvm.org/pr26592", triple = '^mips')
def test_inferior_asserting_expr(self):
"""Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
self.build()
self.inferior_asserting_expr()
- @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
- @expectedFailurei386("llvm.org/pr25338")
- @expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
+ @expectedFailureAll(oslist=["linux"], archs=["aarch64", "arm"], bugnumber="llvm.org/pr25338")
+ @expectedFailureAll(bugnumber="llvm.org/pr26592", triple = '^mips')
def test_inferior_asserting_step(self):
"""Test that lldb functions correctly after stepping through a call to assert()."""
self.build()
@@ -64,7 +65,8 @@ class AssertingInferiorTestCase(TestBase):
lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True)
def check_stop_reason(self):
- if matchAndroid(api_levels=list(range(1, 16+1)))(self):
+ matched = lldbplatformutil.match_android_device(self.getArchitecture(), valid_api_levels=list(range(1, 16+1)))
+ if matched:
# On android until API-16 the abort() call ended in a sigsegv instead of in a sigabrt
stop_reason = 'stop reason = signal SIGSEGV'
else:
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py b/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
index 830c7f69355f..359846c314f6 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
@@ -6,15 +6,17 @@ from __future__ import print_function
import os, time
import lldb
-from lldbsuite.test import configuration
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import configuration
+from lldbsuite.test import lldbutil
class ChangedInferiorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfHostWindows
+ @skipIf(hostoslist=["windows"])
+ @no_debug_info_test
def test_inferior_crashing(self):
"""Test lldb reloads the inferior after it was changed during the session."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
index c547df116c16..fd6a9abce36e 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
@@ -6,55 +6,56 @@ from __future__ import print_function
import os, time
import lldb
-import lldbsuite.test.lldbutil as lldbutil
-import lldbsuite.test.lldbplatformutil as lldbplatformutil
+from lldbsuite.test import lldbutil
+from lldbsuite.test import lldbplatformutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class CrashingInferiorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureFreeBSD("llvm.org/pr23699 SIGSEGV is reported as exception, not signal")
- @expectedFailureWindows("llvm.org/pr24778") # This actually works, but the test relies on the output format instead of the API
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not signal")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
def test_inferior_crashing(self):
"""Test that lldb reliably catches the inferior crashing (command)."""
self.build()
self.inferior_crashing()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
def test_inferior_crashing_register(self):
"""Test that lldb reliably reads registers from the inferior after crashing (command)."""
self.build()
self.inferior_crashing_registers()
@add_test_categories(['pyapi'])
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
def test_inferior_crashing_python(self):
"""Test that lldb reliably catches the inferior crashing (Python API)."""
self.build()
self.inferior_crashing_python()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
def test_inferior_crashing_expr(self):
"""Test that the lldb expression interpreter can read from the inferior after crashing (command)."""
self.build()
self.inferior_crashing_expr()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
def test_inferior_crashing_step(self):
"""Test that stepping after a crash behaves correctly."""
self.build()
self.inferior_crashing_step()
- @expectedFailureFreeBSD('llvm.org/pr24939')
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
@expectedFailureAndroid(archs=['aarch64'], api_levels=list(range(21 + 1))) # No eh_frame for sa_restorer
def test_inferior_crashing_step_after_break(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.build()
self.inferior_crashing_step_after_break()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API")
@skipIfLinux # Inferior exits after stepping after a segfault. This is working as intended IMHO.
def test_inferior_crashing_expr_step_and_expr(self):
"""Test that lldb expressions work before and after stepping after a crash."""
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
index 8afc81f6892a..0d1992d7b4b1 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
@@ -6,57 +6,57 @@ from __future__ import print_function
import os, time
import lldb
-import lldbsuite.test.lldbutil as lldbutil
-import lldbsuite.test.lldbplatformutil as lldbplatformutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbplatformutil
+from lldbsuite.test import lldbutil
class CrashingRecursiveInferiorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureFreeBSD("llvm.org/pr23699 SIGSEGV is reported as exception, not signal")
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not signal")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing(self):
"""Test that lldb reliably catches the inferior crashing (command)."""
self.build()
self.recursive_inferior_crashing()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing_register(self):
"""Test that lldb reliably reads registers from the inferior after crashing (command)."""
self.build()
self.recursive_inferior_crashing_registers()
@add_test_categories(['pyapi'])
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing_python(self):
"""Test that lldb reliably catches the inferior crashing (Python API)."""
self.build()
self.recursive_inferior_crashing_python()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing_expr(self):
"""Test that the lldb expression interpreter can read from the inferior after crashing (command)."""
self.build()
self.recursive_inferior_crashing_expr()
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing_step(self):
"""Test that stepping after a crash behaves correctly."""
self.build()
self.recursive_inferior_crashing_step()
- @expectedFailureFreeBSD('llvm.org/pr24939')
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
@expectedFailureAndroid(archs=['aarch64'], api_levels=list(range(21 + 1))) # No eh_frame for sa_restorer
def test_recursive_inferior_crashing_step_after_break(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.build()
self.recursive_inferior_crashing_step_after_break()
- @expectedFailureFreeBSD('llvm.org/pr15989') # Couldn't allocate space for the stack frame
@skipIfLinux # Inferior exits after stepping after a segfault. This is working as intended IMHO.
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_recursive_inferior_crashing_expr_step_and_expr(self):
"""Test that lldb expressions work before and after stepping after a crash."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py b/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
index 023f6f31e395..8257106888d6 100644
--- a/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
+++ b/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
@@ -6,18 +6,16 @@ from __future__ import print_function
import os, time, sys
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class TestInlineStepping(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
- @expectedFailureFreeBSD('llvm.org/pr17214')
- @expectedFailureIcc # Not really a bug. ICC combines two inlined functions.
- # failed 1/365 dosep runs, (i386-clang), TestInlineStepping.py:237 failed to stop at first breakpoint in main
- @expectedFailureAll(oslist=["linux"], archs=["i386"])
+ @expectedFailureAll(compiler="icc", bugnumber="# Not really a bug. ICC combines two inlined functions.")
def test_with_python_api(self):
"""Test stepping over and into inlined functions."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
index c7abf3464412..336260a8e4a3 100644
--- a/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ b/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -2,13 +2,12 @@
from __future__ import print_function
-
-
import unittest2
import os
import lldb
+from lldbsuite.test import lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
import re
@@ -16,7 +15,7 @@ class JITLoaderGDBTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipTestIfFn(lambda x: True, "llvm.org/pr24702", "Skipped because the test crashes the test runner")
+ @skipTestIfFn(lambda : "Skipped because the test crashes the test runner", bugnumber="llvm.org/pr24702")
@unittest2.expectedFailure("llvm.org/pr24702")
def test_bogus_values(self):
"""Test that we handle inferior misusing the GDB JIT interface"""
diff --git a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
index 8f712dc21110..28d8cccacfcf 100644
--- a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
+++ b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
@@ -8,16 +8,15 @@ from __future__ import print_function
import lldb
import os
import time
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class LaunchWithShellExpandTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureFreeBSD("llvm.org/pr22627 process launch w/ shell expansion not working")
- @expectedFailureLinux("llvm.org/pr22627 process launch w/ shell expansion not working")
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows", "linux", "freebsd"], bugnumber="llvm.org/pr24778 llvm.org/pr22627")
def test(self):
self.build()
exe = os.path.join (os.getcwd(), "a.out")
@@ -31,7 +30,7 @@ class LaunchWithShellExpandTestCase(TestBase):
breakpoint = target.BreakpointCreateBySourceRegex ('break here', lldb.SBFileSpec ("main.cpp", False))
self.assertTrue(breakpoint, VALID_BREAKPOINT)
- self.runCmd("process launch -X true -w %s -- fi*.tx?" % (os.getcwd()))
+ self.runCmd("process launch -X true -w %s -- fi*.tx? () > <" % (os.getcwd()))
process = self.process()
@@ -52,7 +51,11 @@ class LaunchWithShellExpandTestCase(TestBase):
self.expect("frame variable argv[2]", substrs=['file2.txt'])
self.expect("frame variable argv[3]", substrs=['file3.txt'])
self.expect("frame variable argv[4]", substrs=['file4.txy'])
+ self.expect("frame variable argv[5]", substrs=['()'])
+ self.expect("frame variable argv[6]", substrs=['>'])
+ self.expect("frame variable argv[7]", substrs=['<'])
self.expect("frame variable argv[5]", substrs=['file5.tyx'], matching=False)
+ self.expect("frame variable argv[8]", substrs=['file5.tyx'], matching=False)
self.runCmd("process kill")
diff --git a/packages/Python/lldbsuite/test/functionalities/llvm/TestLLVM.py b/packages/Python/lldbsuite/test/functionalities/llvm/TestLLVM.py
new file mode 100644
index 000000000000..a2a43bf2fabd
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/llvm/TestLLVM.py
@@ -0,0 +1,60 @@
+"""
+Test lldb 'commands regex' command which allows the user to create a regular expression command.
+"""
+
+from __future__ import print_function
+
+
+
+import os
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestHomeDirectory(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @no_debug_info_test
+ def test_tilde_home_directory(self):
+ """Test that we can resolve "~/" in paths correctly.
+ When a path starts with "~/", we use llvm::sys::path::home_directory() to
+ resolve the home directory. This currently relies on "HOME" being set in the
+ environment. While this is usually set, we can't rely upon that. We might
+ eventually get a fix into llvm::sys::path::home_directory() so it doesn't rely
+ on having to have an environment variable set, but until then we have work around
+ code in FileSpec::ResolveUsername (llvm::SmallVectorImpl<char> &path) to ensure
+ this always works. This test tests that we get the correct answer for with and
+ without "HOME" being set in the environment."""
+ import pexpect
+ prompt = "(lldb) "
+
+ child = pexpect.spawn('%s --no-use-colors %s' % (lldbtest_config.lldbExec, self.lldbOption))
+ # Turn on logging for what the child sends back.
+ if self.TraceOn():
+ child.logfile_read = sys.stdout
+ # So that the spawned lldb session gets shutdown durng teardown.
+ self.child = child
+
+ # Resolve "~/." to the full path of our home directory + "/."
+ if 'HOME' in os.environ:
+ home_dir = os.environ['HOME']
+ if self.TraceOn():
+ print("home directory is: '%s'" % (home_dir))
+ if os.path.exists(home_dir):
+ home_dir_slash_dot = home_dir + '/.'
+ child.expect_exact(prompt)
+ child.sendline('''script str(lldb.SBFileSpec("~/.", True))''')
+ child.expect_exact(home_dir)
+ child.expect_exact(prompt)
+ child.sendline('''script import os; os.unsetenv('HOME'); str(lldb.SBFileSpec("~/", True))''');
+ child.expect_exact(home_dir)
+ child.expect_exact(prompt)
+ elif self.TraceOn():
+ print('''home directory "%s" doesn't exist, skipping home directory test''' % (home_dir))
+ elif self.TraceOn():
+ print('"HOME" not in environment, skipping home directory test')
+
+ child.sendline('quit')
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
index 481e7c887bd0..3a703b2ee04e 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
class LoadUnloadTestCase(TestBase):
@@ -125,7 +126,6 @@ class LoadUnloadTestCase(TestBase):
substrs = [new_dylib])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
- @skipUnlessListedRemote(['android'])
@expectedFailureAndroid # wrong source file shows up for hidden library
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_dyld_library_path(self):
@@ -182,7 +182,6 @@ class LoadUnloadTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr25805", hostoslist=["windows"], compiler="gcc", archs=["i386"], triple='.*-android')
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
- @skipUnlessListedRemote(['android'])
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_lldb_process_load_and_unload_commands(self):
"""Test that lldb process load/unload command work correctly."""
@@ -241,7 +240,6 @@ class LoadUnloadTestCase(TestBase):
self.runCmd("process continue")
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
- @skipUnlessListedRemote(['android'])
def test_load_unload(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
@@ -283,7 +281,6 @@ class LoadUnloadTestCase(TestBase):
substrs = [' resolved, hit count = 2'])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
- @skipUnlessListedRemote(['android'])
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_step_over_load (self):
"""Test stepping over code that loads a shared library works correctly."""
@@ -313,7 +310,6 @@ class LoadUnloadTestCase(TestBase):
'stop reason = step over'])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
- @skipUnlessListedRemote(['android'])
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
@unittest2.expectedFailure("llvm.org/pr25806")
def test_static_init_during_load (self):
diff --git a/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py b/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
index 1316a01c924c..d9f2b2231895 100644
--- a/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
+++ b/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import os
import lldb
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class LongjmpTestCase(TestBase):
@@ -20,8 +21,8 @@ class LongjmpTestCase(TestBase):
@skipIfDarwin # llvm.org/pr16769: LLDB on Mac OS X dies in function ReadRegisterBytes in GDBRemoteRegisterContext.cpp
@skipIfFreeBSD # llvm.org/pr17214
- @expectedFailureLinux("llvm.org/pr20231")
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20231")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_step_out(self):
"""Test stepping when the inferior calls setjmp/longjmp, in particular, thread step-out."""
self.build()
@@ -29,8 +30,8 @@ class LongjmpTestCase(TestBase):
@skipIfDarwin # llvm.org/pr16769: LLDB on Mac OS X dies in function ReadRegisterBytes in GDBRemoteRegisterContext.cpp
@skipIfFreeBSD # llvm.org/pr17214
- @expectedFailureLinux("llvm.org/pr20231")
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20231")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_step_over(self):
"""Test stepping when the inferior calls setjmp/longjmp, in particular, thread step-over a longjmp."""
self.build()
@@ -38,8 +39,8 @@ class LongjmpTestCase(TestBase):
@skipIfDarwin # llvm.org/pr16769: LLDB on Mac OS X dies in function ReadRegisterBytes in GDBRemoteRegisterContext.cpp
@skipIfFreeBSD # llvm.org/pr17214
- @expectedFailureLinux("llvm.org/pr20231")
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20231")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_step_back_out(self):
"""Test stepping when the inferior calls setjmp/longjmp, in particular, thread step-out after thread step-in."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/cache/Makefile b/packages/Python/lldbsuite/test/functionalities/memory/cache/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/memory/cache/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py b/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
new file mode 100644
index 000000000000..a65882d3fa43
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
@@ -0,0 +1,64 @@
+"""
+Test the MemoryCache L1 flush.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class MemoryCacheTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break inside main().
+ self.line = line_number('main.cpp', '// Set break point at this line.')
+
+ @expectedFlakeyOS(oslist=["windows"])
+ def test_memory_cache(self):
+ """Test the MemoryCache class with a sequence of 'memory read' and 'memory write' operations."""
+ self.build()
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break in main() after the variables are assigned values.
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped', 'stop reason = breakpoint'])
+
+ # The breakpoint should have a hit count of 1.
+ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
+ substrs = [' resolved, hit count = 1'])
+
+ # Read a chunk of memory containing &my_ints[0]. The number of bytes read
+ # must be greater than m_L2_cache_line_byte_size to make sure the L1
+ # cache is used.
+ self.runCmd('memory read -f d -c 201 `&my_ints - 100`')
+
+ # Check the value of my_ints[0] is the same as set in main.cpp.
+ line = self.res.GetOutput().splitlines()[100]
+ self.assertTrue(0x00000042 == int(line.split(':')[1], 0))
+
+ # Change the value of my_ints[0] in memory.
+ self.runCmd("memory write -s 4 `&my_ints` AA")
+
+ # Re-read the chunk of memory. The cache line should have been
+ # flushed because of the 'memory write'.
+ self.runCmd('memory read -f d -c 201 `&my_ints - 100`')
+
+ # Check the value of my_ints[0] have been updated correctly.
+ line = self.res.GetOutput().splitlines()[100]
+ self.assertTrue(0x000000AA == int(line.split(':')[1], 0))
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/cache/main.cpp b/packages/Python/lldbsuite/test/functionalities/memory/cache/main.cpp
new file mode 100644
index 000000000000..7f25e2f4bf68
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/memory/cache/main.cpp
@@ -0,0 +1,14 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main ()
+{
+ int my_ints[] = {0x42};
+ return 0; // Set break point at this line.
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py b/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py
new file mode 100644
index 000000000000..7d959ec504c8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py
@@ -0,0 +1,48 @@
+"""
+Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class MultipleDebuggersCommandsTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test
+ def test_multipledebuggers_commands(self):
+ """Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario"""
+ source_init_files = False
+ magic_text = "The following commands may relate to 'env'"
+
+ debugger_1 = lldb.SBDebugger.Create(source_init_files)
+ interpreter_1 = debugger_1.GetCommandInterpreter()
+
+ retobj = lldb.SBCommandReturnObject()
+ interpreter_1.HandleCommand("apropos env", retobj)
+ self.assertTrue(magic_text in str(retobj), "[interpreter_1]: the output does not contain the correct words")
+
+ if self.TraceOn(): print(str(retobj))
+
+ lldb.SBDebugger.Destroy(debugger_1)
+
+ # now do this again with a different debugger - we shouldn't crash
+
+ debugger_2 = lldb.SBDebugger.Create(source_init_files)
+ interpreter_2 = debugger_2.GetCommandInterpreter()
+
+ retobj = lldb.SBCommandReturnObject()
+ interpreter_2.HandleCommand("apropos env", retobj)
+ self.assertTrue(magic_text in str(retobj), "[interpreter_2]: the output does not contain the correct words")
+
+ if self.TraceOn(): print(str(retobj))
+
+ lldb.SBDebugger.Destroy(debugger_2)
+
diff --git a/packages/Python/lldbsuite/test/functionalities/nested_alias/Makefile b/packages/Python/lldbsuite/test/functionalities/nested_alias/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/nested_alias/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py b/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
new file mode 100644
index 000000000000..6a74ddb727df
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
@@ -0,0 +1,68 @@
+"""
+Test that an alias can reference other aliases without crashing.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import re
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class NestedAliasTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break inside main().
+ self.line = line_number('main.cpp', '// break here')
+
+ def test_nested_alias(self):
+ """Test that an alias can reference other aliases without crashing."""
+ self.build()
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break in main() aftre the variables are assigned values.
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped', 'stop reason = breakpoint'])
+
+ # The breakpoint should have a hit count of 1.
+ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
+ substrs = [' resolved, hit count = 1'])
+
+ # This is the function to remove the custom aliases in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('command unalias read', check=False)
+ self.runCmd('command unalias rd', check=False)
+ self.runCmd('command unalias fo', check=False)
+ self.runCmd('command unalias foself', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.runCmd('command alias read memory read -f A')
+ self.runCmd('command alias rd read -c 3')
+
+ self.expect('memory read -f A -c 3 `&my_ptr[0]`', substrs=['deadbeef', 'main.cpp:', 'feedbeef'])
+ self.expect('rd `&my_ptr[0]`', substrs=['deadbeef', 'main.cpp:', 'feedbeef'])
+
+ self.expect('memory read -f A -c 3 `&my_ptr[0]`', substrs=['deadfeed'], matching=False)
+ self.expect('rd `&my_ptr[0]`', substrs=['deadfeed'], matching=False)
+
+ self.runCmd('command alias fo frame variable -O --')
+ self.runCmd('command alias foself fo self')
+
+ self.expect('help foself', substrs=['--show-all-children', '--raw-output'], matching=False)
+ self.expect('help foself', substrs=['Show variables for the current', 'stack frame.'], matching=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/nested_alias/main.cpp b/packages/Python/lldbsuite/test/functionalities/nested_alias/main.cpp
new file mode 100644
index 000000000000..4424cf30c3a4
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/nested_alias/main.cpp
@@ -0,0 +1,22 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdio.h>
+
+int main (int argc, char const *argv[])
+{
+ void* my_ptr[] = {
+ reinterpret_cast<void*>(0xDEADBEEF),
+ reinterpret_cast<void*>(main),
+ reinterpret_cast<void*>(0xFEEDBEEF),
+ reinterpret_cast<void*>(0xFEEDDEAD),
+ reinterpret_cast<void*>(0xDEADFEED)
+ };
+ return 0; // break here
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py b/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
index 4f4a22ed6067..0fdc43bb9feb 100644
--- a/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ b/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -9,16 +9,19 @@ from __future__ import print_function
import os.path
+import re
+
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-import re
+from lldbsuite.test import lldbutil
class TestImageListMultiArchitecture(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_debug_info_test
+ @skipIfRemote
def test_image_list_shows_multiple_architectures(self):
"""Test that image list properly shows the correct architecture for a set of different architecture object files."""
images = {
diff --git a/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py b/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
index f718b62f95ea..db577dc5bacd 100644
--- a/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
+++ b/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
@@ -8,8 +8,9 @@ from __future__ import print_function
import lldb
import os
import time
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class TestPaths(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py
index 6b3eedaf603a..9599f83d6a53 100644
--- a/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py
+++ b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py
@@ -8,7 +8,9 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
class PlatformCommandTestCase(TestBase):
diff --git a/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py b/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
index b62c30bcf4e7..619ed7afe328 100644
--- a/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
+++ b/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
@@ -9,8 +9,9 @@ from __future__ import print_function
import os, time
import re
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class PluginCommandTestCase(TestBase):
@@ -18,7 +19,7 @@ class PluginCommandTestCase(TestBase):
@skipIfNoSBHeaders
@skipIfHostIncompatibleWithRemote # Requires a compatible arch and platform to link against the host's built lldb lib.
- @expectedFailureWindows("llvm.org/pr24778")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
@no_debug_info_test
def test_load_plugin(self):
"""Test that plugins that load commands work correctly."""
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py b/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
new file mode 100644
index 000000000000..fd5bb00d0565
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
@@ -0,0 +1,164 @@
+"""
+Test basics of linux core file debugging.
+"""
+
+from __future__ import print_function
+
+import shutil
+import struct
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class LinuxCoreTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ _i386_pid = 32306
+ _x86_64_pid = 32259
+ _s390x_pid = 1045
+
+ _i386_regions = 4
+ _x86_64_regions = 5
+ _s390x_regions = 2
+
+ @skipIf(bugnumber="llvm.org/pr26947")
+ def test_i386(self):
+ """Test that lldb can read the process information from an i386 linux core file."""
+ self.do_test("i386", self._i386_pid, self._i386_regions)
+
+ def test_x86_64(self):
+ """Test that lldb can read the process information from an x86_64 linux core file."""
+ self.do_test("x86_64", self._x86_64_pid, self._x86_64_regions)
+
+ # This seems to hang on non-s390x platforms for some reason. Disabling for now.
+ @skipIf(archs=no_match(['s390x']))
+ def test_s390x(self):
+ """Test that lldb can read the process information from an s390x linux core file."""
+ self.do_test("s390x", self._s390x_pid, self._s390x_regions)
+
+ def test_same_pid_running(self):
+ """Test that we read the information from the core correctly even if we have a running
+ process with the same PID around"""
+ try:
+ shutil.copyfile("x86_64.out", "x86_64-pid.out")
+ shutil.copyfile("x86_64.core", "x86_64-pid.core")
+ with open("x86_64-pid.core", "r+b") as f:
+ # These are offsets into the NT_PRSTATUS and NT_PRPSINFO structures in the note
+ # segment of the core file. If you update the file, these offsets may need updating
+ # as well. (Notes can be viewed with readelf --notes.)
+ for pid_offset in [0x1c4, 0x320]:
+ f.seek(pid_offset)
+ self.assertEqual(struct.unpack("<I", f.read(4))[0], self._x86_64_pid)
+
+ # We insert our own pid, and make sure the test still works.
+ f.seek(pid_offset)
+ f.write(struct.pack("<I", os.getpid()))
+ self.do_test("x86_64-pid", os.getpid(), self._x86_64_regions)
+ finally:
+ self.RemoveTempFile("x86_64-pid.out")
+ self.RemoveTempFile("x86_64-pid.core")
+
+ def test_two_cores_same_pid(self):
+ """Test that we handle the situation if we have two core files with the same PID
+ around"""
+ alttarget = self.dbg.CreateTarget("altmain.out")
+ altprocess = alttarget.LoadCore("altmain.core")
+ self.assertTrue(altprocess, PROCESS_IS_VALID)
+ self.assertEqual(altprocess.GetNumThreads(), 1)
+ self.assertEqual(altprocess.GetProcessID(), self._x86_64_pid)
+
+ altframe = altprocess.GetSelectedThread().GetFrameAtIndex(0)
+ self.assertEqual(altframe.GetFunctionName(), "_start")
+ self.assertEqual(altframe.GetLineEntry().GetLine(), line_number("altmain.c", "Frame _start"))
+
+ error = lldb.SBError()
+ F = altprocess.ReadCStringFromMemory(altframe.FindVariable("F").GetValueAsUnsigned(), 256, error)
+ self.assertTrue(error.Success())
+ self.assertEqual(F, "_start")
+
+ # without destroying this process, run the test which opens another core file with the
+ # same pid
+ self.do_test("x86_64", self._x86_64_pid, self._x86_64_regions)
+
+ def check_memory_regions(self, process, region_count):
+ region_list = process.GetMemoryRegions()
+ self.assertEqual(region_list.GetSize(), region_count)
+
+ region = lldb.SBMemoryRegionInfo()
+
+ # Check we have the right number of regions.
+ self.assertEqual(region_list.GetSize(), region_count);
+
+ # Check that getting a region beyond the last in the list fails.
+ self.assertFalse(region_list.GetMemoryRegionAtIndex(region_count, region));
+
+ # Check each region is valid.
+ for i in range(region_list.GetSize()):
+ # Check we can actually get this region.
+ self.assertTrue(region_list.GetMemoryRegionAtIndex(i, region))
+
+ #Every region in t