Add from __future__ import print_function everywhere.
authorZachary Turner <zturner@google.com>
Fri, 23 Oct 2015 17:04:29 +0000 (17:04 +0000)
committerZachary Turner <zturner@google.com>
Fri, 23 Oct 2015 17:04:29 +0000 (17:04 +0000)
Apparently there were tons of instances I missed last time, I
guess I accidentally ran 2to3 non-recursively.  This should be
every occurrence of a print statement fixed to use a print function
as well as from __future__ import print_function being added to
every file.

After this patch print statements will stop working everywhere in
the test suite, and the print function should be used instead.

llvm-svn: 251121

404 files changed:
lldb/test/android/platform/TestDefaultCacheLineSize.py
lldb/test/api/check_public_api_headers/TestPublicAPIHeaders.py
lldb/test/api/multiple-debuggers/TestMultipleDebuggers.py
lldb/test/api/multithreaded/TestMultithreaded.py
lldb/test/arm_emulation/TestEmulations.py
lldb/test/attic/tester.py
lldb/test/benchmarks/continue/TestBenchmarkContinue.py
lldb/test/benchmarks/disassembly/TestDisassembly.py
lldb/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
lldb/test/benchmarks/expression/TestExpressionCmd.py
lldb/test/benchmarks/expression/TestRepeatedExprs.py
lldb/test/benchmarks/frame_variable/TestFrameVariableResponse.py
lldb/test/benchmarks/startup/TestStartupDelays.py
lldb/test/benchmarks/stepping/TestRunHooksThenSteppings.py
lldb/test/benchmarks/stepping/TestSteppingSpeed.py
lldb/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
lldb/test/curses_results.py
lldb/test/dotest.py
lldb/test/dotest_channels.py
lldb/test/driver/batch_mode/TestBatchMode.py
lldb/test/expression_command/call-function/TestCallStdStringFunction.py
lldb/test/expression_command/call-function/TestCallStopAndContinue.py
lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py
lldb/test/expression_command/call-restarts/TestCallThatRestarts.py
lldb/test/expression_command/call-throws/TestCallThatThrows.py
lldb/test/expression_command/char/TestExprsChar.py
lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
lldb/test/expression_command/formatters/TestFormatters.py
lldb/test/expression_command/issue_11588/Test11588.py
lldb/test/expression_command/options/TestExprOptions.py
lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py
lldb/test/expression_command/persistent_types/TestPersistentTypes.py
lldb/test/expression_command/persistent_variables/TestPersistentVariables.py
lldb/test/expression_command/po_verbosity/TestPoVerbosity.py
lldb/test/expression_command/radar_8638051/Test8638051.py
lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py
lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py
lldb/test/expression_command/test/TestExprs.py
lldb/test/expression_command/test/TestExprs2.py
lldb/test/expression_command/timeout/TestCallWithTimeout.py
lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
lldb/test/functionalities/abbreviation/TestAbbreviations.py
lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
lldb/test/functionalities/archives/TestBSDArchives.py
lldb/test/functionalities/asan/TestMemoryHistory.py
lldb/test/functionalities/asan/TestReportData.py
lldb/test/functionalities/attach_resume/TestAttachResume.py
lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py
lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py
lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
lldb/test/functionalities/command_history/TestCommandHistory.py
lldb/test/functionalities/command_regex/TestCommandRegex.py
lldb/test/functionalities/command_script/TestCommandScript.py
lldb/test/functionalities/command_script/import/TestImport.py
lldb/test/functionalities/command_script/import/bar/bar.py
lldb/test/functionalities/command_script/import/foo/bar/foobar.py
lldb/test/functionalities/command_script/import/foo/foo.py
lldb/test/functionalities/command_script/import/foo/foo2.py
lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
lldb/test/functionalities/command_script/mysto.py
lldb/test/functionalities/command_script/welcome.py
lldb/test/functionalities/command_source/TestCommandSource.py
lldb/test/functionalities/command_source/my.py
lldb/test/functionalities/completion/TestCompletion.py
lldb/test/functionalities/conditional_break/TestConditionalBreak.py
lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
lldb/test/functionalities/dead-strip/TestDeadStrip.py
lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py
lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
lldb/test/functionalities/exec/TestExec.py
lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
lldb/test/functionalities/fat_archives/TestFatArchives.py
lldb/test/functionalities/format/TestFormats.py
lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
lldb/test/functionalities/inferior-changed/TestInferiorChanged.py
lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
lldb/test/functionalities/inline-stepping/TestInlineStepping.py
lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
lldb/test/functionalities/load_unload/TestLoadUnload.py
lldb/test/functionalities/longjmp/TestLongjmp.py
lldb/test/functionalities/memory/read/TestMemoryRead.py
lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
lldb/test/functionalities/nosucharch/TestNoSuchArch.py
lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
lldb/test/functionalities/paths/TestPaths.py
lldb/test/functionalities/platform/TestPlatformCommand.py
lldb/test/functionalities/plugins/commands/TestPluginCommands.py
lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
lldb/test/functionalities/postmortem/minidump/TestMiniDump.py
lldb/test/functionalities/process_attach/TestProcessAttach.py
lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
lldb/test/functionalities/process_group/TestChangeProcessGroup.py
lldb/test/functionalities/process_launch/TestProcessLaunch.py
lldb/test/functionalities/recursion/TestValueObjectRecursion.py
lldb/test/functionalities/register/TestRegisters.py
lldb/test/functionalities/rerun/TestRerun.py
lldb/test/functionalities/return-value/TestReturnValue.py
lldb/test/functionalities/set-data/TestSetData.py
lldb/test/functionalities/signal/TestSendSignal.py
lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py
lldb/test/functionalities/signal/raise/TestRaise.py
lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
lldb/test/functionalities/stop-hook/TestStopHookCmd.py
lldb/test/functionalities/stop-hook/TestStopHookMechanism.py
lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
lldb/test/functionalities/target_command/TestTargetCommand.py
lldb/test/functionalities/thread/TestNumThreads.py
lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
lldb/test/functionalities/thread/jump/TestThreadJump.py
lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
lldb/test/functionalities/thread/state/TestThreadStates.py
lldb/test/functionalities/thread/step_out/TestThreadStepOut.py
lldb/test/functionalities/thread/thread_exit/TestThreadExit.py
lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
lldb/test/functionalities/tty/TestTerminal.py
lldb/test/functionalities/type_completion/TestTypeCompletion.py
lldb/test/functionalities/type_lookup/TestTypeLookup.py
lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py
lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
lldb/test/help/TestHelp.py
lldb/test/lang/c/anonymous/TestAnonymous.py
lldb/test/lang/c/array_types/TestArrayTypes.py
lldb/test/lang/c/bitfields/TestBitfields.py
lldb/test/lang/c/blocks/TestBlocks.py
lldb/test/lang/c/const_variables/TestConstVariables.py
lldb/test/lang/c/enum_types/TestEnumTypes.py
lldb/test/lang/c/forward/TestForwardDeclaration.py
lldb/test/lang/c/function_types/TestFunctionTypes.py
lldb/test/lang/c/global_variables/TestGlobalVariables.py
lldb/test/lang/c/modules/TestCModules.py
lldb/test/lang/c/register_variables/TestRegisterVariables.py
lldb/test/lang/c/set_values/TestSetValues.py
lldb/test/lang/c/shared_lib/TestSharedLib.py
lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
lldb/test/lang/c/stepping/TestStepAndBreakpoints.py
lldb/test/lang/c/stepping/TestThreadStepping.py
lldb/test/lang/c/tls_globals/TestTlsGlobals.py
lldb/test/lang/c/typedef/Testtypedef.py
lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
lldb/test/lang/cpp/char1632_t/TestChar1632T.py
lldb/test/lang/cpp/class_static/TestStaticVariables.py
lldb/test/lang/cpp/class_types/TestClassTypes.py
lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
lldb/test/lang/cpp/namespace/TestNamespace.py
lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
lldb/test/lang/cpp/signed_types/TestSignedTypes.py
lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
lldb/test/lang/cpp/stl/TestSTL.py
lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py
lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
lldb/test/lang/cpp/virtual/TestVirtual.py
lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
lldb/test/lang/go/goroutines/TestGoroutines.py
lldb/test/lang/go/types/TestGoASTContext.py
lldb/test/lang/mixed/TestMixedLanguages.py
lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
lldb/test/lang/objc/forward-decl/TestForwardDecl.py
lldb/test/lang/objc/foundation/TestConstStrings.py
lldb/test/lang/objc/foundation/TestFoundationDisassembly.py
lldb/test/lang/objc/foundation/TestObjCMethods.py
lldb/test/lang/objc/foundation/TestObjCMethods2.py
lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py
lldb/test/lang/objc/foundation/TestRuntimeTypes.py
lldb/test/lang/objc/foundation/TestSymbolTable.py
lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py
lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py
lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
lldb/test/lang/objc/modules/TestObjCModules.py
lldb/test/lang/objc/objc++/TestObjCXX.py
lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
lldb/test/lang/objc/objc-checker/TestObjCCheckers.py
lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py
lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
lldb/test/lang/objc/objc-property/TestObjCProperty.py
lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
lldb/test/lang/objc/objc-stepping/TestObjCStepping.py
lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
lldb/test/lang/objc/objc-super/TestObjCSuper.py
lldb/test/lang/objc/print-obj/TestPrintObj.py
lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py
lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py
lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py
lldb/test/lang/objc/real-definition/TestRealDefinition.py
lldb/test/linux/builtin_trap/TestBuiltinTrap.py
lldb/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
lldb/test/lldbcurses.py
lldb/test/lldbpexpect.py
lldb/test/lldbtest.py
lldb/test/lldbutil.py
lldb/test/logging/TestLogging.py
lldb/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
lldb/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py
lldb/test/macosx/order/TestOrderFile.py
lldb/test/macosx/queues/TestQueues.py
lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
lldb/test/macosx/universal/TestUniversal.py
lldb/test/plugins/builder_darwin.py
lldb/test/python_api/breakpoint/TestBreakpointAPI.py
lldb/test/python_api/class_members/TestSBTypeClassMembers.py
lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
lldb/test/python_api/event/TestEvents.py
lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
lldb/test/python_api/formatters/TestFormattersSBAPI.py
lldb/test/python_api/frame/TestFrames.py
lldb/test/python_api/frame/inlines/TestInlinedFrame.py
lldb/test/python_api/function_symbol/TestDisasmAPI.py
lldb/test/python_api/function_symbol/TestSymbolAPI.py
lldb/test/python_api/hello_world/TestHelloWorld.py
lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
lldb/test/python_api/module_section/TestModuleAndSection.py
lldb/test/python_api/objc_type/TestObjCType.py
lldb/test/python_api/process/TestProcessAPI.py
lldb/test/python_api/process/io/TestProcessIO.py
lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
lldb/test/python_api/sbdata/TestSBData.py
lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py
lldb/test/python_api/section/TestSectionAPI.py
lldb/test/python_api/signals/TestSignalsAPI.py
lldb/test/python_api/symbol-context/TestSymbolContext.py
lldb/test/python_api/target/TestTargetAPI.py
lldb/test/python_api/thread/TestThreadAPI.py
lldb/test/python_api/type/TestTypeList.py
lldb/test/python_api/value/TestValueAPI.py
lldb/test/python_api/value/change_values/TestChangeValueAPI.py
lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
lldb/test/python_api/value_var_update/TestValueVarUpdate.py
lldb/test/python_api/watchpoint/TestSetWatchpoint.py
lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/test/python_api/watchpoint/TestWatchpointIter.py
lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
lldb/test/redo.py
lldb/test/settings/TestSettings.py
lldb/test/settings/quoting/TestQuoting.py
lldb/test/source-manager/TestSourceManager.py
lldb/test/terminal/TestSTTYBeforeAndAfter.py
lldb/test/test_results.py
lldb/test/test_runner/test/inferior.py
lldb/test/tools/lldb-mi/TestMiExit.py
lldb/test/tools/lldb-mi/TestMiFile.py
lldb/test/tools/lldb-mi/TestMiGdbSetShow.py
lldb/test/tools/lldb-mi/TestMiLibraryLoaded.py
lldb/test/tools/lldb-mi/TestMiPrompt.py
lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py
lldb/test/tools/lldb-mi/control/TestMiExec.py
lldb/test/tools/lldb-mi/data/TestMiData.py
lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
lldb/test/tools/lldb-mi/lldbmi_testcase.py
lldb/test/tools/lldb-mi/signal/TestMiSignal.py
lldb/test/tools/lldb-mi/stack/TestMiStack.py
lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py
lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py
lldb/test/tools/lldb-mi/target/TestMiTarget.py
lldb/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
lldb/test/tools/lldb-mi/variable/TestMiVar.py
lldb/test/tools/lldb-server/TestGDBRemoteMemoryRead.py
lldb/test/tools/lldb-server/TestGdbRemoteAttach.py
lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
lldb/test/tools/lldb-server/TestGdbRemoteKill.py
lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py
lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py
lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
lldb/test/tools/lldb-server/TestGdbRemote_vCont.py
lldb/test/tools/lldb-server/TestLldbGdbServer.py
lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py
lldb/test/tools/lldb-server/commandline/TestStubSetSID.py
lldb/test/tools/lldb-server/gdbremote_testcase.py
lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py
lldb/test/tools/lldb-server/lldbgdbserverutils.py
lldb/test/tools/lldb-server/socket_packet_pump.py
lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py
lldb/test/types/AbstractBase.py
lldb/test/types/HideTestFailures.py
lldb/test/types/TestFloatTypes.py
lldb/test/types/TestFloatTypesExpr.py
lldb/test/types/TestIntegerTypes.py
lldb/test/types/TestIntegerTypesExpr.py
lldb/test/types/TestRecursiveTypes.py
lldb/test/warnings/uuid/TestAddDsymCommand.py

index 2cc209b..d559dab 100644 (file)
@@ -2,6 +2,8 @@
 Verify the default cache line size for android targets
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 95f4bc9..3ba97e8 100644 (file)
@@ -3,6 +3,8 @@
 There should be nothing unwanted there and a simpe main.cpp which includes SB*.h
 should compile and link with the LLDB framework."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, re
@@ -72,7 +74,7 @@ class SBDirCheckerCase(TestBase):
 
         env_cmd = "settings set target.env-vars %s=%s" %(self.dylibPath, self.getLLDBLibraryEnvVal())
         if self.TraceOn():
-            print "Set environment to: ", env_cmd
+            print("Set environment to: ", env_cmd)
         self.runCmd(env_cmd)
         self.addTearDownHook(lambda: self.dbg.HandleCommand("settings remove target.env-vars %s" % self.dylibPath))
 
index d25ee10..143ea43 100644 (file)
@@ -1,5 +1,7 @@
 """Test the lldb public C++ api when doing multiple debug sessions simultaneously."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, re
@@ -40,7 +42,7 @@ class TestMultipleSimultaneousDebuggers(TestBase):
 # will recognize it as a test failure.
 
         if self.TraceOn():
-            print "Running test %s" % self.driver_exe
+            print("Running test %s" % self.driver_exe)
             check_call([self.driver_exe, self.inferior_exe], env=env)
         else:
             with open(os.devnull, 'w') as fnull:
index 2731a49..9ac25df 100644 (file)
@@ -1,5 +1,7 @@
 """Test the lldb public C++ api breakpoint callbacks."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, re
@@ -82,7 +84,7 @@ class SBBreakpointCallbackCase(TestBase):
 
         env = {self.dylibPath : self.getLLDBLibraryEnvVal()}
         if self.TraceOn():
-            print "Running test %s" % " ".join(exe)
+            print("Running test %s" % " ".join(exe))
             check_call(exe, env=env)
         else:
             with open(os.devnull, 'w') as fnull:
index ec37760..f4427cf 100644 (file)
@@ -2,6 +2,8 @@
 Test some ARM instruction emulation.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -46,7 +48,7 @@ class ARMEmulationTestCase(TestBase):
         success = insn.TestEmulation (stream, filename);
         output = stream.GetData();
         if self.TraceOn():
-            print '\nRunning test ' + os.path.basename(filename)
-            print output
+            print('\nRunning test ' + os.path.basename(filename))
+            print(output)
 
         self.assertTrue (success, 'Emulation test succeeded.')
index 3f05fbe..34a6ed1 100755 (executable)
@@ -1,13 +1,15 @@
 #!/usr/bin/env python
 # -*- coding: utf8 -*-
 
+from __future__ import print_function
+
 import math, os.path, re, sys, time, unittest
 
 def setupSysPath():
   testPath = sys.path[0]
   rem = re.match("(^.*/)test$", testPath)
   if not rem:
-    print "This script expects to reside in .../test."
+    print("This script expects to reside in .../test.")
     sys.exit(-1)
   lldbBasePath = rem.group(1)
   lldbDebugPythonPath = "build/Debug/LLDB.framework/Resources/Python"
@@ -18,8 +20,8 @@ def setupSysPath():
   if os.path.isfile(lldbReleasePythonPath + "/lldb.py"):
     lldbPythonPath = lldbReleasePythonPath
   if not lldbPythonPath:
-    print "This script requires lldb.py to be in either " + lldbDebugPythonPath,
-    print "or" + lldbReleasePythonPath
+    print("This script requires lldb.py to be in either " + lldbDebugPythonPath, end='')
+    print("or" + lldbReleasePythonPath)
     sys.exit(-1)
   sys.path.append(lldbPythonPath)
 
@@ -72,8 +74,8 @@ class ExecutionTimes:
           sampleVariance += (time - sampleMean) ** 2
         sampleVariance /= sampleCount
         sampleStandardDeviation = math.sqrt(sampleVariance)
-        print key + ": [" + prettyTime(sampleMin) + ", " + prettyTime(sampleMax) + "] ",
-        print "µ " + prettyTime(sampleMean) + ", Ïƒ " + prettyTime(sampleStandardDeviation)
+        print(key + ": [" + prettyTime(sampleMin) + ", " + prettyTime(sampleMax) + "] ", end='')
+        print("µ " + prettyTime(sampleMean) + ", Ïƒ " + prettyTime(sampleStandardDeviation))
   m_executionTimes = None
 
 setupSysPath()
@@ -86,7 +88,7 @@ class LLDBTestCase(unittest.TestCase):
     debugger.SetAsync(True)
     self.m_commandInterpreter = debugger.GetCommandInterpreter()
     if not self.m_commandInterpreter:
-      print "Couldn't get the command interpreter"
+      print("Couldn't get the command interpreter")
       sys.exit(-1)
   def runCommand(self, command, component):
     res = lldb.SBCommandReturnObject()
@@ -104,7 +106,7 @@ class LLDBTestCase(unittest.TestCase):
 class SanityCheckTestCase(LLDBTestCase):
   def runTest(self):
     ret = self.runCommand("show arch", "show-arch")
-    #print ret
+    #print(ret)
   def getCategories(self):
     return []
 
index 83674c6..8599124 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb data formatter subsystem.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -61,4 +63,4 @@ class TestBenchmarkContinue(BenchBase):
             lldbutil.continue_to_breakpoint(self.process(), bkpt)
             lldbutil_sw.stop()
             
-        print "runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw)
+        print("runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw))
index b514819..522be3a 100644 (file)
@@ -1,5 +1,7 @@
 """Disassemble lldb's Driver::MainLoop() functions comparing lldb against gdb."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -42,32 +44,32 @@ class DisassembleDriverMainLoop(BenchBase):
     @expectedFailureWindows("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
-        print "lldb path: %s" % lldbtest_config.lldbExec
-        print "gdb path: %s" % self.gdbExec
+        print()
+        print("lldb path: %s" % lldbtest_config.lldbExec)
+        print("gdb path: %s" % self.gdbExec)
 
-        print
+        print()
         self.run_lldb_disassembly(self.exe, self.function, self.count)
-        print "lldb benchmark:", self.stopwatch
+        print("lldb benchmark:", self.stopwatch)
         self.run_gdb_disassembly(self.exe, self.function, self.count)
-        print "gdb benchmark:", self.stopwatch
-        print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
+        print("gdb benchmark:", self.stopwatch)
+        print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
 
     @benchmarks_test
     @no_debug_info_test
     @expectedFailureWindows("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
-        print "lldb path: %s" % lldbtest_config.lldbExec
-        print "gdb path: %s" % self.gdbExec
+        print()
+        print("lldb path: %s" % lldbtest_config.lldbExec)
+        print("gdb path: %s" % self.gdbExec)
 
-        print
+        print()
         self.run_gdb_disassembly(self.exe, self.function, self.count)
-        print "gdb benchmark:", self.stopwatch
+        print("gdb benchmark:", self.stopwatch)
         self.run_lldb_disassembly(self.exe, self.function, self.count)
-        print "lldb benchmark:", self.stopwatch
-        print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
+        print("lldb benchmark:", self.stopwatch)
+        print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
 
     def run_lldb_disassembly(self, exe, function, count):
         import pexpect
@@ -107,7 +109,7 @@ class DisassembleDriverMainLoop(BenchBase):
 
         self.lldb_avg = self.stopwatch.avg()
         if self.TraceOn():
-            print "lldb disassembly benchmark:", str(self.stopwatch)
+            print("lldb disassembly benchmark:", str(self.stopwatch))
         self.child = None
 
     def run_gdb_disassembly(self, exe, function, count):
@@ -150,5 +152,5 @@ class DisassembleDriverMainLoop(BenchBase):
 
         self.gdb_avg = self.stopwatch.avg()
         if self.TraceOn():
-            print "gdb disassembly benchmark:", str(self.stopwatch)
+            print("gdb disassembly benchmark:", str(self.stopwatch))
         self.child = None
index a93a406..c8a28b8 100644 (file)
@@ -2,6 +2,8 @@
 inferior and traverses the stack for thread0 to arrive at frame with function
 'MainLoop'.  It is important to specify an lldb executable as the inferior."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -26,9 +28,9 @@ class AttachThenDisassemblyBench(BenchBase):
     @no_debug_info_test
     def test_attach_then_disassembly(self):
         """Attach to a spawned lldb process then run disassembly benchmarks."""
-        print
+        print()
         self.run_lldb_attach_then_disassembly(self.exe, self.count)
-        print "lldb disassembly benchmark:", self.stopwatch
+        print("lldb disassembly benchmark:", self.stopwatch)
 
     def run_lldb_attach_then_disassembly(self, exe, count):
         target = self.dbg.CreateTarget(exe)
@@ -38,7 +40,7 @@ class AttachThenDisassemblyBench(BenchBase):
         popen = subprocess.Popen([exe, self.lldbOption],
                                  stdout = open(os.devnull, 'w') if not self.TraceOn() else None)
         if self.TraceOn():
-            print "pid of spawned process: %d" % popen.pid
+            print("pid of spawned process: %d" % popen.pid)
 
         # Attach to the launched lldb process.
         listener = lldb.SBListener("my.attach.listener")
@@ -52,12 +54,12 @@ class AttachThenDisassemblyBench(BenchBase):
         i = 0
         found = False
         for f in thread0:
-            #print "frame#%d %s" % (i, f.GetFunctionName())
+            #print("frame#%d %s" % (i, f.GetFunctionName()))
             if "MainLoop" in f.GetFunctionName():
                 found = True
                 thread0.SetSelectedFrame(i)
                 if self.TraceOn():
-                    print "Found frame#%d for function 'MainLoop'" % i
+                    print("Found frame#%d for function 'MainLoop'" % i)
                 break
             i += 1
             
index 393119e..913f9c0 100644 (file)
@@ -1,5 +1,7 @@
 """Disassemble lldb's Driver::MainLoop() functions comparing Xcode 4.1 vs. 4.2's gdb."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -27,28 +29,28 @@ class XCode41Vs42GDBDisassembly(BenchBase):
     @expectedFailureWindows("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
+        print()
         self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count)
-        print "4.1 gdb benchmark:", self.stopwatch
+        print("4.1 gdb benchmark:", self.stopwatch)
         self.gdb_41_avg = self.stopwatch.avg()
         self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count)
-        print "4.2 gdb benchmark:", self.stopwatch
+        print("4.2 gdb benchmark:", self.stopwatch)
         self.gdb_42_avg = self.stopwatch.avg()
-        print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)
+        print("gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg))
 
     @benchmarks_test
     @no_debug_info_test
     @expectedFailureWindows("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
+        print()
         self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count)
-        print "4.2 gdb benchmark:", self.stopwatch
+        print("4.2 gdb benchmark:", self.stopwatch)
         self.gdb_42_avg = self.stopwatch.avg()
         self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count)
-        print "4.1 gdb benchmark:", self.stopwatch
+        print("4.1 gdb benchmark:", self.stopwatch)
         self.gdb_41_avg = self.stopwatch.avg()
-        print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)
+        print("gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg))
 
     def run_gdb_disassembly(self, gdb_exe_path, exe, function, count):
         import pexpect
@@ -89,5 +91,5 @@ class XCode41Vs42GDBDisassembly(BenchBase):
             pass
 
         if self.TraceOn():
-            print "gdb disassembly benchmark:", str(self.stopwatch)
+            print("gdb disassembly benchmark:", str(self.stopwatch))
         self.child = None
index aa7b03f..b6c9d91 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb's expression evaluations and collect statistics."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -25,9 +27,9 @@ class ExpressionEvaluationCase(BenchBase):
         self.build()
         self.exe_name = 'a.out'
 
-        print
+        print()
         self.run_lldb_repeated_exprs(self.exe_name, self.count)
-        print "lldb expr cmd benchmark:", self.stopwatch
+        print("lldb expr cmd benchmark:", self.stopwatch)
 
     def run_lldb_repeated_exprs(self, exe_name, count):
         import pexpect
index 9efbec6..f2c26b1 100644 (file)
@@ -1,5 +1,7 @@
 """Test evaluating expressions repeatedly comparing lldb against gdb."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -27,12 +29,12 @@ class RepeatedExprsCase(BenchBase):
         self.build()
         self.exe_name = 'a.out'
 
-        print
+        print()
         self.run_lldb_repeated_exprs(self.exe_name, self.count)
-        print "lldb benchmark:", self.stopwatch
+        print("lldb benchmark:", self.stopwatch)
         self.run_gdb_repeated_exprs(self.exe_name, self.count)
-        print "gdb benchmark:", self.stopwatch
-        print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
+        print("gdb benchmark:", self.stopwatch)
+        print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
 
     def run_lldb_repeated_exprs(self, exe_name, count):
         import pexpect
@@ -77,7 +79,7 @@ class RepeatedExprsCase(BenchBase):
 
         self.lldb_avg = self.stopwatch.avg()
         if self.TraceOn():
-            print "lldb expression benchmark:", str(self.stopwatch)
+            print("lldb expression benchmark:", str(self.stopwatch))
         self.child = None
 
     def run_gdb_repeated_exprs(self, exe_name, count):
@@ -125,5 +127,5 @@ class RepeatedExprsCase(BenchBase):
 
         self.gdb_avg = self.stopwatch.avg()
         if self.TraceOn():
-            print "gdb expression benchmark:", str(self.stopwatch)
+            print("gdb expression benchmark:", str(self.stopwatch))
         self.child = None
index ff55ecd..67d48f0 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb's response time for 'frame variable' command."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -30,9 +32,9 @@ class FrameVariableResponseBench(BenchBase):
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
     def test_startup_delay(self):
         """Test response time for the 'frame variable' command."""
-        print
+        print()
         self.run_frame_variable_bench(self.exe, self.break_spec, self.count)
-        print "lldb frame variable benchmark:", self.stopwatch
+        print("lldb frame variable benchmark:", self.stopwatch)
 
     def run_frame_variable_bench(self, exe, break_spec, count):
         import pexpect
index b921906..217e98d 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb's startup delays creating a target, setting a breakpoint, and run to breakpoint stop."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -35,11 +37,11 @@ class StartupDelaysBench(BenchBase):
     @expectedFailureWindows("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
+        print()
         self.run_startup_delays_bench(self.exe, self.break_spec, self.count)
-        print "lldb startup delay (create fresh target) benchmark:", self.stopwatch
-        print "lldb startup delay (set first breakpoint) benchmark:", self.stopwatch2
-        print "lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3
+        print("lldb startup delay (create fresh target) benchmark:", self.stopwatch)
+        print("lldb startup delay (set first breakpoint) benchmark:", self.stopwatch2)
+        print("lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3)
 
     def run_startup_delays_bench(self, exe, break_spec, count):
         import pexpect
index 71017eb..3fbc787 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb's stepping speed."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -21,9 +23,9 @@ class RunHooksThenSteppingsBench(BenchBase):
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
     def test_lldb_runhooks_then_steppings(self):
         """Test lldb steppings on a large executable."""
-        print
+        print()
         self.run_lldb_runhooks_then_steppings(self.count)
-        print "lldb stepping benchmark:", self.stopwatch
+        print("lldb stepping benchmark:", self.stopwatch)
 
     def run_lldb_runhooks_then_steppings(self, count):
         import pexpect
index 553933f..3fa01ae 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb's stepping speed."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -25,17 +27,17 @@ class SteppingSpeedBench(BenchBase):
         if self.count <= 0:
             self.count = 50
 
-        #print "self.exe=%s" % self.exe
-        #print "self.break_spec=%s" % self.break_spec
+        #print("self.exe=%s" % self.exe)
+        #print("self.break_spec=%s" % self.break_spec)
 
     @benchmarks_test
     @no_debug_info_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
     def test_run_lldb_steppings(self):
         """Test lldb steppings on a large executable."""
-        print
+        print()
         self.run_lldb_steppings(self.exe, self.break_spec, self.count)
-        print "lldb stepping benchmark:", self.stopwatch
+        print("lldb stepping benchmark:", self.stopwatch)
 
     def run_lldb_steppings(self, exe, break_spec, count):
         import pexpect
index c359ab2..a1342bd 100644 (file)
@@ -1,5 +1,7 @@
 """Benchmark the turnaround time starting a debugger and run to the breakpont with lldb vs. gdb."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
@@ -27,12 +29,12 @@ class CompileRunToBreakpointBench(BenchBase):
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
     def test_run_lldb_then_gdb(self):
         """Benchmark turnaround time with lldb vs. gdb."""
-        print
+        print()
         self.run_lldb_turnaround(self.exe, self.function, self.count)
-        print "lldb turnaround benchmark:", self.stopwatch
+        print("lldb turnaround benchmark:", self.stopwatch)
         self.run_gdb_turnaround(self.exe, self.function, self.count)
-        print "gdb turnaround benchmark:", self.stopwatch
-        print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
+        print("gdb turnaround benchmark:", self.stopwatch)
+        print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
 
     def run_lldb_turnaround(self, exe, function, count):
         import pexpect
index 89d28dd..f2a60c6 100644 (file)
@@ -130,7 +130,7 @@ class Curses(test_results.ResultsFormatter):
                     worker_index = test_event['worker_index']
                 if 'event' in test_event:
                     check_for_one_key = True
-                    #print >>self.events_file, str(test_event)
+                    #print(str(test_event), file=self.events_file)
                     event = test_event['event']   
                     if self.status_panel:
                         self.status_panel.update_status('time', str(datetime.timedelta(seconds=math.floor(time.time() - self.start_time))))
index d1ce34b..dcd4c79 100755 (executable)
@@ -902,7 +902,7 @@ def parseOptionsAndInitTestdirs():
             copytree(os.path.join(scriptdir, 'make'), os.path.join(rdir, 'make'),
                      ignore=ignore_patterns('.svn'))
 
-    #print "testdirs:", testdirs
+    #print("testdirs:", testdirs)
 
     # Source the configFile if specified.
     # The side effect, if any, will be felt from this point on.  An example
@@ -919,7 +919,7 @@ def parseOptionsAndInitTestdirs():
     if configFile:
         # Pass config (a dictionary) as the locals namespace for side-effect.
         execfile(configFile, globals(), config)
-        #print "config:", config
+        #print("config:", config)
         if "pre_flight" in config:
             pre_flight = config["pre_flight"]
             if not callable(pre_flight):
@@ -934,8 +934,8 @@ def parseOptionsAndInitTestdirs():
             lldbtest_remote_sandbox = config["lldbtest_remote_sandbox"]
         if "lldbtest_remote_shell_template" in config:
             lldbtest_remote_shell_template = config["lldbtest_remote_shell_template"]
-        #print "sys.stderr:", sys.stderr
-        #print "sys.stdout:", sys.stdout
+        #print("sys.stderr:", sys.stderr)
+        #print("sys.stdout:", sys.stdout)
 
 def getXcodeOutputPaths(lldbRootDirectory):
     result = []
@@ -1295,7 +1295,7 @@ def visit(prefix, dir, names):
     global all_tests
 
     if set(dir.split(os.sep)).intersection(excluded):
-        #print "Detected an excluded dir component: %s" % dir
+        #print("Detected an excluded dir component: %s" % dir)
         return
 
     for name in names:
@@ -1312,10 +1312,10 @@ def visit(prefix, dir, names):
             if regexp:
                 import re
                 if re.search(regexp, name):
-                    #print "Filename: '%s' matches pattern: '%s'" % (name, regexp)
+                    #print("Filename: '%s' matches pattern: '%s'" % (name, regexp))
                     pass
                 else:
-                    #print "Filename: '%s' does not match pattern: '%s'" % (name, regexp)
+                    #print("Filename: '%s' does not match pattern: '%s'" % (name, regexp))
                     continue
 
             # We found a match for our test.  Add it to the suite.
@@ -1344,7 +1344,7 @@ def visit(prefix, dir, names):
 
                 # If filtered, we have a good filterspec.  Add it.
                 if filtered:
-                    #print "adding filter spec %s to module %s" % (filterspec, module)
+                    #print("adding filter spec %s to module %s" % (filterspec, module))
                     suite.addTests(
                         unittest2.defaultTestLoader.loadTestsFromName(filterspec, module))
                     continue
@@ -1761,8 +1761,8 @@ if __name__ == "__main__":
                 if not parsable:
                     sys.stderr.write("\nConfiguration: " + configString + "\n")
 
-            #print "sys.stderr name is", sys.stderr.name
-            #print "sys.stdout name is", sys.stdout.name
+            #print("sys.stderr name is", sys.stderr.name)
+            #print("sys.stdout name is", sys.stdout.name)
 
             # First, write out the number of collected test cases.
             if not parsable:
index 6b6f0be..111e628 100644 (file)
@@ -14,6 +14,8 @@ This module provides asyncore channels used within the LLDB test
 framework.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import asyncore
@@ -121,7 +123,7 @@ class UnpicklingForwardingReaderChannel(asyncore.dispatcher):
 
     def handle_read(self):
         data = self.recv(8192)
-        # print 'driver socket READ: %d bytes' % len(data)
+        # print('driver socket READ: %d bytes' % len(data))
 
         while data and (len(data) > 0):
             # If we're reading the header, gather header bytes.
@@ -131,7 +133,7 @@ class UnpicklingForwardingReaderChannel(asyncore.dispatcher):
                 data = self.consume_payload_bytes(data)
 
     def handle_close(self):
-        # print "socket reader: closing port"
+        # print("socket reader: closing port")
         self.close()
 
 
@@ -167,7 +169,7 @@ class UnpicklingForwardingListenerChannel(asyncore.dispatcher):
     def handle_accept(self):
         (sock, addr) = self.socket.accept()
         if sock and addr:
-            # print 'Incoming connection from %s' % repr(addr)
+            # print('Incoming connection from %s' % repr(addr))
             self.handler = UnpicklingForwardingReaderChannel(
                 sock, self.async_map, self.forwarding_func)
 
index bd0f3fa..f88591a 100644 (file)
@@ -2,6 +2,8 @@
 Test that the lldb driver's batch mode works correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 10a4c21..cc66dd0 100644 (file)
@@ -2,6 +2,8 @@
 Test calling a function, stopping in the call, continue and gather the result on stop.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index f5480c2..e3d368c 100644 (file)
@@ -2,6 +2,8 @@
 Test calling a function that hits a signal set to auto-restart, make sure the call completes.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index e5ac994..85774cd 100644 (file)
@@ -2,6 +2,8 @@
 Test calling a function that throws an ObjC exception, make sure that it doesn't propagate the exception.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 4d1ba4b..83c98af 100644 (file)
@@ -1,5 +1,7 @@
 """Test that we are able to evaluate expressions when the inferior is blocked in a syscall"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index a86961a..c8bb284 100644 (file)
@@ -2,6 +2,8 @@
 Test using LLDB data formatters with frozen objects coming from the expression parser.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index d1793c3..53b7fc9 100644 (file)
@@ -4,6 +4,8 @@ valobj.AddressOf() returns None when an address is
 expected in a SyntheticChildrenProvider
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 18394ef..846f676 100644 (file)
@@ -7,6 +7,8 @@ o test_expr_options:
   Test expression command options.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 0ced770..3ed0384 100644 (file)
@@ -2,6 +2,8 @@
 Test that lldb persistent types works correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 829b35d..9603bb5 100644 (file)
@@ -2,6 +2,8 @@
 Test that the po command acts correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 2cff7fe..a8ba021 100644 (file)
@@ -2,6 +2,8 @@
 Test the robustness of lldb expression parser.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 31d120f..41e3cf8 100644 (file)
@@ -2,6 +2,8 @@
 The evaluating printf(...) after break stop and then up a stack frame.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index c412bce..8538bb3 100644 (file)
@@ -2,6 +2,8 @@
 Test example snippets from the lldb 'help expression' output.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 12bdfa2..8851733 100644 (file)
@@ -11,6 +11,8 @@ o test_expr_commands_can_handle_quotes:
   Throw some expression commands with quotes at lldb.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index a2dd98c..b835c08 100644 (file)
@@ -2,6 +2,8 @@
 Test some more expression commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index e63cebe..59a1be6 100644 (file)
@@ -2,6 +2,8 @@
 Test calling a function that waits a while, and make sure the timeout option to expr works.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 93c8218..6edf8be 100644 (file)
@@ -4,6 +4,8 @@ Regression test for <rdar://problem/8981098>:
 The expression parser's type search only looks in the current compilation unit for types.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 86268bb..3a089a2 100644 (file)
@@ -2,6 +2,8 @@
 Test some lldb command abbreviations and aliases for proper resolution.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -79,9 +81,9 @@ class AbbreviationsTestCase(TestBase):
         self.assertFalse(result.Succeeded())
 
         # Check a command that wants the raw input.
-        command_interpreter.ResolveCommand(r'''sc print "\n\n\tHello!\n"''', result)
+        command_interpreter.ResolveCommand(r'''sc print("\n\n\tHello!\n")''', result)
         self.assertTrue(result.Succeeded())
-        self.assertEqual(r'''script print "\n\n\tHello!\n"''', result.GetOutput())
+        self.assertEqual(r'''script print("\n\n\tHello!\n")''', result.GetOutput())
 
         # Prompt changing stuff should be tested, but this doesn't seem like the
         # right test to do it in.  It has nothing to do with aliases or abbreviations.
index d184edc..3772e63 100644 (file)
@@ -3,6 +3,8 @@ Test some lldb command abbreviations to make sure the common short spellings of
 many commands remain available even after we add/delete commands in the future.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 9246c5e..a2071d3 100644 (file)
@@ -1,5 +1,7 @@
 """Test breaking inside functions defined within a BSD archive file libfoo.a."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index d9334d5..a0d8533 100644 (file)
@@ -2,6 +2,8 @@
 Test that ASan memory history provider returns correct stack traces
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 19e0b61..462fc01 100644 (file)
@@ -2,6 +2,8 @@
 Test the AddressSanitizer runtime support for report breakpoint and data extraction.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 0a5e7f2..5565ad6 100644 (file)
@@ -2,6 +2,8 @@
 Test process attach/resume.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index abceb6a..27ec682 100644 (file)
@@ -2,6 +2,8 @@
 Test whether a process started by lldb has no extra file descriptors open.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index d2a6e5c..18c03f9 100644 (file)
@@ -2,6 +2,8 @@
 Test that backticks without a target should work (not infinite looping).
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 660f463..051063b 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb breakpoint command add/list/delete.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -50,7 +52,7 @@ class BreakpointCommandTestCase(TestBase):
 
         # Now add callbacks for the breakpoints just created.
         self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4")
-        self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print >> here, \"lldb\"; here.close()' 2")
+        self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2")
         self.runCmd("breakpoint command add --python-function bktptcmd.function 3")
 
         # Check that the breakpoint commands are correctly set.
@@ -72,7 +74,7 @@ class BreakpointCommandTestCase(TestBase):
         self.expect("breakpoint command list 2", "Breakpoint 2 command ok",
             substrs = ["Breakpoint commands:",
                           "here = open",
-                          "print >> here",
+                          "print(file=here)",
                           "here.close()"])
         self.expect("breakpoint command list 3", "Breakpoint 3 command ok",
             substrs = ["Breakpoint commands:",
@@ -176,7 +178,7 @@ class BreakpointCommandTestCase(TestBase):
         lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         # Now add callbacks for the breakpoints just created.
-        self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print >> here, frame; print >> here, bp_loc; here.close()' 1")
+        self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1")
 
         # Remove 'output-2.txt' if it already exists.
 
index 0058bff..f9eb809 100644 (file)
@@ -2,6 +2,8 @@
 Test that you can set breakpoint commands successfully with the Python API's:
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -49,7 +51,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
         got_one_in_B = False
         for idx in range(0, num_locations):
             comp_unit = no_files_bkpt.GetLocationAtIndex(idx).GetAddress().GetSymbolContext(lldb.eSymbolContextCompUnit).GetCompileUnit().GetFileSpec()
-            print "Got comp unit: ", comp_unit.GetFilename()
+            print("Got comp unit: ", comp_unit.GetFilename())
             if comp_unit.GetFilename() == "a.c":
                 got_one_in_A = True
             elif comp_unit.GetFilename() == "b.c":
@@ -64,7 +66,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
         error = body_bkpt.SetScriptCallbackBody("\
 import TestBreakpointCommandsFromPython\n\
 TestBreakpointCommandsFromPython.PythonBreakpointCommandSettingTestCase.my_var = 20\n\
-print 'Hit breakpoint'")
+print('Hit breakpoint')")
         self.assertTrue (error.Success(), "Failed to set the script callback body: %s."%(error.GetCString()))
 
         self.dbg.HandleCommand("command script import --allow-reload ./bktptcmd.py")
index 2e2eac9..afc9f91 100644 (file)
@@ -2,6 +2,8 @@
 Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3018664..4bbb032 100644 (file)
@@ -1,4 +1,6 @@
+from __future__ import print_function
+
 def function(frame, bp_loc, dict):
        there = open("output2.txt", "w");
-       print >> there, "lldb";
+       print("lldb", file=there)
        there.close()
index 2c30904..d69637e 100644 (file)
@@ -2,6 +2,8 @@
 Test breakpoint conditions with 'breakpoint modify -c <expr> id'.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -126,7 +128,7 @@ class BreakpointConditionsTestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
index 809a794..c290bcb 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test breakpoint command with AT_comp_dir set to symbolic link.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 103b38c..e4ef515 100644 (file)
@@ -2,6 +2,8 @@
 Test continue from a breakpoint when there is a breakpoint on the next instruction also.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index fb27df1..febd619 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb breakpoint ids.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -32,7 +34,7 @@ class TestCPPBreakpointLocations(TestBase):
         for name in names:
             found = name in bp_loc_names
             if not found:
-                print "Didn't find '%s' in: %s" % (name, bp_loc_names)
+                print("Didn't find '%s' in: %s" % (name, bp_loc_names))
             self.assertTrue (found, "Make sure we find all required locations")
         
     def breakpoint_id_tests (self):
index e01bdb4..7db7389 100644 (file)
@@ -2,6 +2,8 @@
 Test that you can set breakpoint and hit the C++ language exception breakpoint
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index d12b39d..73014c0 100644 (file)
@@ -3,6 +3,8 @@ Test that inlined breakpoints (breakpoint set on a file/line included from
 another source file) works correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index b61132d..5cb9123 100644 (file)
@@ -3,6 +3,8 @@ Test that objective-c constant strings are generated correctly by the expression
 parser.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3022433..bb7d78f 100644 (file)
@@ -2,6 +2,8 @@
 Test the command history mechanism
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 5400b54..128473a 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb 'commands regex' command which allows the user to create a regular expression command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index b8a8916..ba47ed8 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb Python commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index f413bdc..9a6937b 100644 (file)
@@ -1,5 +1,7 @@
 """Test custom import command to import files by path."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index 28a4488..bbc41f3 100644 (file)
@@ -1,6 +1,8 @@
+from __future__ import print_function
+
 def bar_function(debugger, args, result, dict):
        global UtilityModule
-       print >>result,  (UtilityModule.barutil_function("bar told me " + args))
+       print(UtilityModule.barutil_function("bar told me " + args), file=result)
        return None
 
 def __lldb_init_module(debugger, session_dict):
index 212fea3..659ded2 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 def foo_function(debugger, args, result, dict):
-       print >>result,  ("foobar says " + args)
+       print("foobar says " + args, file=result)
        return None
index f528e98..51cc0c3 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 def foo_function(debugger, args, result, dict):
-       print >>result,  ("foo says " + args)
+       print("foo says " + args, file=result)
        return None
index 44e39cb..6863454 100644 (file)
@@ -1,5 +1,7 @@
+from __future__ import print_function
+
 def foo2_function(debugger, args, result, dict):
-       print >>result,  ("foo2 says " + args)
+       print("foo2 says " + args, file=result)
        return None
 
 def __lldb_init_module(debugger, session_dict):
index 4b19386..b5209d4 100644 (file)
@@ -1,5 +1,7 @@
 """Check that we handle an ImportError in a special way when command script importing files."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index 7191914..656cd15 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb
 import sys
 import os
@@ -8,11 +10,11 @@ def StepOver(debugger, args, result, dict):
        Step over a given number of times instead of only just once
        """
        arg_split = args.split(" ")
-       print type(arg_split)
+       print(type(arg_split))
        count = int(arg_split[0])
        for i in range(0,count):
                debugger.GetSelectedTarget().GetProcess().GetSelectedThread().StepOver(lldb.eOnlyThisThread)
-               print "step<%d>"%i
+               print("step<%d>"%i)
 
 def __lldb_init_module(debugger, session_dict):
        # by default, --synchronicity is set to synchronous
index c6d4ddc..5dbf09f 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import print_function
 import lldb, sys
 
 class WelcomeCommand(object):
@@ -8,7 +9,7 @@ class WelcomeCommand(object):
         return "Just a docstring for welcome_impl\nA command that says hello to LLDB users"
         
     def __call__(self, debugger, args, exe_ctx, result):
-        print >>result,  ('Hello ' + args + ', welcome to LLDB');
+        print('Hello ' + args + ', welcome to LLDB',  file=result);
         return None;
 
 class TargetnameCommand(object):
@@ -18,7 +19,7 @@ class TargetnameCommand(object):
     def __call__(self, debugger, args, exe_ctx, result):
         target = debugger.GetSelectedTarget()
         file = target.GetExecutable()
-        print >>result,  ('Current target ' + file.GetFilename())
+        print('Current target ' + file.GetFilename(), file=result)
         if args == 'fail':
             result.SetError('a test for error in command')
     
@@ -27,19 +28,19 @@ class TargetnameCommand(object):
 
 def print_wait_impl(debugger, args, result, dict):
     result.SetImmediateOutputFile(sys.stdout)
-    print >>result,  ('Trying to do long task..')
+    print('Trying to do long task..', file=result)
     import time
     time.sleep(1)
-    print >>result,  ('Still doing long task..')
+    print('Still doing long task..', file=result)
     time.sleep(1)
-    print >>result,  ('Done; if you saw the delays I am doing OK')
+    print('Done; if you saw the delays I am doing OK', file=result)
 
 def check_for_synchro(debugger, args, result, dict):
     if debugger.GetAsync() == True:
-        print >>result,  ('I am running async')
+        print('I am running async', file=result)
     if debugger.GetAsync() == False:
-        print >>result,  ('I am running sync')
+        print('I am running sync', file=result)
 
 def takes_exe_ctx(debugger, args, exe_ctx, result, dict):
-    print >>result, str(exe_ctx.GetTarget())
+    print(str(exe_ctx.GetTarget()), file=result)
 
index 22f8ff7..31862ac 100644 (file)
@@ -4,6 +4,8 @@ Test that lldb command "command source" works correctly.
 See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys
index 86ce502..cb2fd01 100644 (file)
@@ -1,4 +1,6 @@
+from __future__ import print_function
+
 def date():
     import datetime
     today = datetime.date.today()
-    print today
+    print(today)
index f2c5302..097c9f5 100644 (file)
@@ -2,6 +2,8 @@
 Test the lldb command line completion mechanism.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -301,13 +303,13 @@ class CommandLineCompletionTestCase(TestBase):
         
         with open('child_send.txt', 'r') as fs:
             if self.TraceOn():
-                print "\n\nContents of child_send.txt:"
-                print fs.read()
+                print("\n\nContents of child_send.txt:")
+                print(fs.read())
         with open('child_read.txt', 'r') as fr:
             from_child = fr.read()
             if self.TraceOn():
-                print "\n\nContents of child_read.txt:"
-                print from_child
+                print("\n\nContents of child_read.txt:")
+                print(from_child)
 
             # The matching could be verbatim or using generic re pattern.
             for p in patterns:
index f077bcd..b51393f 100644 (file)
@@ -2,6 +2,8 @@
 Test conditionally break on a function and inspect its variables.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -61,7 +63,7 @@ class ConditionalBreakTestCase(TestBase):
         # like to try for at most 10 times.
         for j in range(10):
             if self.TraceOn():
-                print "j is: ", j
+                print("j is: ", j)
             thread = process.GetThreadAtIndex(0)
             
             if thread.GetNumFrames() >= 2:
@@ -94,7 +96,7 @@ class ConditionalBreakTestCase(TestBase):
         # breakpoint such that lldb only stops when the caller of c() is a().
         # the "my" package that defines the date() function.
         if self.TraceOn():
-            print "About to source .lldb"
+            print("About to source .lldb")
 
         if not self.TraceOn():
             self.HideStdout()
@@ -107,13 +109,13 @@ class ConditionalBreakTestCase(TestBase):
         self.runCmd ("break list")
 
         if self.TraceOn():
-            print "About to run."
+            print("About to run.")
         self.runCmd("run", RUN_SUCCEEDED)
 
         self.runCmd ("break list")
 
         if self.TraceOn():
-            print "Done running"
+            print("Done running")
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
index 39e363a..771e87c 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb data formatter subsystem.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -225,7 +227,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
         str_cast = str(test_cast)
 
         if self.TraceOn():
-             print str_cast
+             print(str_cast)
 
         self.assertTrue(str_cast.find('A') != -1, 'could not find A in output')
         self.assertTrue(str_cast.find('B') != -1, 'could not find B in output')
@@ -238,7 +240,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
         str_cast = str(test_cast)
 
         if self.TraceOn():
-             print str_cast
+             print(str_cast)
 
         # we detect that all the values of the child objects have changed - but the counter-generated item
         # is still fixed at 0 because it is cached - this would fail if update(self): in ftsp returned False
index 03e713e..327a121 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb data formatter subsystem.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -131,13 +133,13 @@ class SkipSummaryDataFormatterTestCase(TestBase):
         if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'):
            import re
            gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])[1]
-           #print "my output:", gcc_version_output
+           #print("my output:", gcc_version_output)
            for line in gcc_version_output.split(os.linesep):
                m = re.search('\(Apple Inc\. build ([0-9]+)\)', line)
-               #print "line:", line
+               #print("line:", line)
                if m:
                    gcc_build = int(m.group(1))
-                   #print "gcc build:", gcc_build
+                   #print("gcc build:", gcc_build)
                    if gcc_build >= 5666:
                        # rdar://problem/9804600"
                        self.skipTest("rdar://problem/9804600 wrong namespace for std::string in debug info")
index 418083d..71296ec 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb data formatter subsystem.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -58,7 +60,7 @@ class DataFormatterSynthValueTestCase(TestBase):
         z_val = z.GetValueAsUnsigned
         
         if self.TraceOn():
-            print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())
+            print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()))
 
         self.assertFalse(x_val() == 3, "x == 3 before synthetics")
         self.assertFalse(y_val() == 4, "y == 4 before synthetics")
@@ -70,7 +72,7 @@ class DataFormatterSynthValueTestCase(TestBase):
         self.runCmd("type synth add -l myArraySynthProvider myArray")
         
         if self.TraceOn():
-            print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())
+            print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()))
         
         self.assertTrue(x_val() == 3, "x != 3 after synthetics")
         self.assertTrue(y_val() == 4, "y != 4 after synthetics")
index 471086b..063fe38 100644 (file)
@@ -2,6 +2,8 @@
 Check if changing Format on an SBValue correctly propagates that new format to children as it should
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index ad5ee5a..5726b3f 100644 (file)
@@ -2,6 +2,8 @@
 Test that the user can input a format but it will not prevail over summary format's choices.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 0869ea9..ebb3474 100644 (file)
@@ -2,6 +2,8 @@
 Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index a4f50cb..f60fd4b 100644 (file)
@@ -2,6 +2,8 @@
 Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 8842896..c79cec3 100644 (file)
@@ -2,6 +2,8 @@
 Test that the user can input a format but it will not prevail over summary format's choices.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6235e61..b69fe2e 100644 (file)
@@ -2,6 +2,8 @@
 Check that vector types format properly
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -49,7 +51,7 @@ class VectorTypesFormattingTestCase(TestBase):
         v.SetPreferSyntheticValue(True)
         v.SetFormat(lldb.eFormatVectorOfFloat32)
         
-        if self.TraceOn(): print v
+        if self.TraceOn(): print(v)
         
         self.assertTrue(v.GetNumChildren() == 4, "v as float32[] has 4 children")
         self.assertTrue(v.GetChildAtIndex(0).GetData().float[0] == 1.25, "child 0 == 1.25")
index e614761..61e181c 100644 (file)
@@ -2,6 +2,8 @@
 Test that breakpoint works correctly in the presence of dead-code stripping.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index e9ddf12..006832d 100644 (file)
@@ -2,6 +2,8 @@
 Test some lldb command abbreviations.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index c07628b..542748e 100644 (file)
@@ -1,5 +1,7 @@
 """Test convenience variables when you drop in from lldb prompt into an embedded interpreter."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -50,28 +52,28 @@ class ConvenienceVariablesCase(TestBase):
         # Python interpreter, then the lldb interpreter.
         self.child_in_script_interpreter = True
 
-        child.sendline('print lldb.debugger')
+        child.sendline('print(lldb.debugger)')
         child.expect_exact(python_prompt)
         self.expect(child.before, exe=False,
             patterns = ['Debugger \(instance: .*, id: \d\)'])
 
-        child.sendline('print lldb.target')
+        child.sendline('print(lldb.target)')
         child.expect_exact(python_prompt)
         self.expect(child.before, exe=False,
             substrs = ['a.out'])
 
-        child.sendline('print lldb.process')
+        child.sendline('print(lldb.process)')
         child.expect_exact(python_prompt)
         self.expect(child.before, exe=False,
             patterns = ['SBProcess: pid = \d+, state = stopped, threads = \d, executable = a.out'])
 
-        child.sendline('print lldb.thread')
+        child.sendline('print(lldb.thread)')
         child.expect_exact(python_prompt)
         # Linux outputs decimal tid and 'name' instead of 'queue'
         self.expect(child.before, exe=False,
             patterns = ['thread #1: tid = (0x[0-9a-f]+|[0-9]+), 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d, (name|queue) = \'.+\', stop reason = breakpoint 1\.1' % self.line])
 
-        child.sendline('print lldb.frame')
+        child.sendline('print(lldb.frame)')
         child.expect_exact(python_prompt)
         self.expect(child.before, exe=False,
             patterns = ['frame #0: 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d' % self.line])
index 7b6ce97..f7a5191 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test some lldb command abbreviations.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import commands
@@ -11,11 +13,11 @@ from lldbtest import *
 import lldbutil
 
 def execute_command (command):
-    #print '%% %s' % (command)
+    #print('%% %s' % (command))
     (exit_status, output) = commands.getstatusoutput (command)
     #if output:
-    #    print output
-    #print 'status = %u' % (exit_status)
+    #    print(output)
+    #print('status = %u' % (exit_status))
     return exit_status
 
 class ExecTestCase(TestBase):
index 89d7f72..377c7e7 100644 (file)
@@ -2,6 +2,8 @@
 Test that expr will time out and allow other threads to run if it blocks.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -33,7 +35,7 @@ class ExprDoesntDeadlockTestCase(TestBase):
         main_file_spec = lldb.SBFileSpec ("locking.c")
         breakpoint = target.BreakpointCreateBySourceRegex('Break here', main_file_spec)
         if self.TraceOn():
-            print "breakpoint:", breakpoint
+            print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
index f6d0694..40b8f25 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test some lldb command abbreviations.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import commands
@@ -11,11 +13,11 @@ from lldbtest import *
 import lldbutil
 
 def execute_command (command):
-    # print '%% %s' % (command)
+    # print('%% %s' % (command))
     (exit_status, output) = commands.getstatusoutput (command)
     # if output:
-    #     print output
-    # print 'status = %u' % (exit_status)
+    #     print(output)
+    # print('status = %u' % (exit_status))
     return exit_status
 
 class FatArchiveTestCase(TestBase):
index 84566ea..d4123ef 100644 (file)
@@ -2,6 +2,8 @@
 Test the command history mechanism
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 37e88c7..b307aba 100644 (file)
@@ -1,5 +1,7 @@
 """Test that lldb functions correctly after the inferior has asserted."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -167,7 +169,7 @@ class AssertingInferiorTestCase(TestBase):
             frame = thread.GetFrameAtIndex(i)
             self.assertTrue(frame.IsValid(), "current frame is valid")
             if self.TraceOn():
-                print "Checking if function %s is main" % frame.GetFunctionName()
+                print("Checking if function %s is main" % frame.GetFunctionName())
 
             if 'main' == frame.GetFunctionName():
                 frame_id = frame.GetFrameID()
index 9fce54c..7caa6cc 100644 (file)
@@ -1,5 +1,7 @@
 """Test lldb reloads the inferior after it was changed during the session."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index cd4ba30..ee41cd5 100644 (file)
@@ -1,5 +1,7 @@
 """Test that lldb functions correctly after the inferior has crashed."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 61eea6e..53ca4ff 100644 (file)
@@ -1,5 +1,7 @@
 """Test that lldb functions correctly after the inferior has crashed while in a recursive routine."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index b0d620e..aa9fcae 100644 (file)
@@ -1,5 +1,7 @@
 """Test stepping over and into inlined functions."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, sys
index 5b8b11d..8ed08fc 100644 (file)
@@ -1,5 +1,7 @@
 """Test for the JITLoaderGDB interface"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 7122cdc..7f67fb5 100644 (file)
@@ -2,6 +2,8 @@
 Test that breakpoint by symbol name works correctly with dynamic libs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -110,7 +112,7 @@ class LoadUnloadTestCase(TestBase):
         # Inform (DY)LD_LIBRARY_PATH of the new path, too.
         env_cmd_string = "settings set target.env-vars " + self.dylibPath + "=" + new_dir
         if self.TraceOn():
-            print "Set environment to: ", env_cmd_string
+            print("Set environment to: ", env_cmd_string)
         self.runCmd(env_cmd_string)
         self.runCmd("settings show target.env-vars")
 
@@ -224,7 +226,7 @@ class LoadUnloadTestCase(TestBase):
         output = self.res.GetOutput()
         pattern = re.compile("Image ([0-9]+) loaded")
         for l in output.split(os.linesep):
-            #print "l:", l
+            #print("l:", l)
             match = pattern.search(l)
             if match:
                 break
index 8cb51e6..b7294ed 100644 (file)
@@ -2,6 +2,8 @@
 Test the use of setjmp/longjmp for non-local goto operations in a single-threaded inferior.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index c6430aa..9fbb56f 100644 (file)
@@ -2,6 +2,8 @@
 Test the 'memory read' command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 7835a37..3e1f21c 100644 (file)
@@ -1,6 +1,8 @@
 """Test evaluating expressions which ref. index variable 'i' which just goes
 from out of scope to in scope when stopped at the breakpoint."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index bf29645..9e5bd71 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test that using a non-existent architecture name does not crash LLDB.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 54c1d21..ea851c7 100644 (file)
@@ -4,6 +4,8 @@ This exercises classes like ObjectFileELF and their support for opening
 foreign-architecture object files.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os.path
index 3576920..3376fab 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test some lldb command abbreviations.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 9790826..c049356 100644 (file)
@@ -2,6 +2,8 @@
 Test some lldb platform commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 4053fe3..50146c9 100644 (file)
@@ -2,6 +2,8 @@
 Test that plugins that load commands work correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -47,7 +49,7 @@ class PluginCommandTestCase(TestBase):
         retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_command child abc def ghi",retobj)
 
         if self.TraceOn():
-            print retobj.GetOutput()
+            print(retobj.GetOutput())
 
         self.expect(retobj,substrs = ['abc def ghi'], exe=False)
 
@@ -57,6 +59,6 @@ class PluginCommandTestCase(TestBase):
         retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_ ch abc def ghi",retobj)
 
         if self.TraceOn():
-            print retobj.GetOutput()
+            print(retobj.GetOutput())
 
         self.expect(retobj,substrs = ['abc def ghi'], exe=False)
index 749916f..a1d6176 100644 (file)
@@ -2,6 +2,8 @@
 Test that the Python operating system plugin works correctly
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index bbacc19..379b27b 100644 (file)
@@ -2,6 +2,8 @@
 Test basics of mini dump debugging.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index ed11a48..023da13 100644 (file)
@@ -2,6 +2,8 @@
 Test process attach.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 74013fa..bc0b850 100644 (file)
@@ -2,6 +2,8 @@
 Test denied process attach.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -42,7 +44,7 @@ class AttachDeniedTestCase(TestBase):
             if err.Success() and retcode == 0:
                 break
             else:
-                print msg
+                print(msg)
             if i < max_attempts:
                 # Exponential backoff!
                 time.sleep(pow(2, i) * 0.25)
index 6864c47..c31d817 100644 (file)
@@ -1,5 +1,7 @@
 """Test that we handle inferiors which change their process group"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -39,7 +41,7 @@ class ChangeProcessGroupTestCase(TestBase):
             if err.Success() and retcode == 0:
                 break
             else:
-                print msg
+                print(msg)
             if i < max_attempts:
                 # Exponential backoff!
                 time.sleep(pow(2, i) * 0.25)
index 50e219f..75b3a25 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb process launch flags.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -160,7 +162,7 @@ class ProcessLaunchTestCase(TestBase):
             # Check to see if the 'stdout' file contains the right output
             line = out_f.readline();
             if self.TraceOn():
-                print "line:", line
+                print("line:", line)
             if not re.search(mywd, line):
                 success = False
                 err_msg = err_msg + "The current working directory was not set correctly.\n"
index fa90004..778d880 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb data formatter subsystem.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -45,12 +47,12 @@ class ValueObjectRecursionTestCase(TestBase):
         root = self.frame().FindVariable("root")
         child = root.GetChildAtIndex(1)
         if self.TraceOn():
-             print root
-             print child
+             print(root)
+             print(child)
         for i in range(0,24500):
              child = child.GetChildAtIndex(1)
         if self.TraceOn():
-             print child
+             print(child)
         self.assertTrue(child.IsValid(),"could not retrieve the deep ValueObject")
         self.assertTrue(child.GetChildAtIndex(0).IsValid(),"the deep ValueObject has no value")
         self.assertTrue(child.GetChildAtIndex(0).GetValueAsUnsigned() != 0,"the deep ValueObject has a zero value")
index efdbaaf..b77ade7 100755 (executable)
@@ -2,6 +2,8 @@
 Test the 'register' command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
@@ -176,8 +178,8 @@ class RegisterCommandsTestCase(TestBase):
         for str1 in substrs:
             matched = output.find(str1) != -1
             with recording(self, False) as sbuf:
-                print >> sbuf, "%s sub string: %s" % ('Expecting', str1)
-                print >> sbuf, "Matched" if matched else "Not Matched"
+                print("%s sub string: %s" % ('Expecting', str1), file=sbuf)
+                print("Matched" if matched else "Not Matched", file=sbuf)
             if matched:
                 break
         self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)
@@ -339,7 +341,7 @@ class RegisterCommandsTestCase(TestBase):
         self.addTearDownHook(self.cleanupSubprocesses)
 
         if self.TraceOn():
-            print "pid of spawned process: %d" % pid
+            print("pid of spawned process: %d" % pid)
 
         self.runCmd("process attach -p %d" % pid)
 
index 7d5972b..63b92c9 100644 (file)
@@ -1,6 +1,8 @@
 """
 Test that argdumper is a viable launching strategy.
 """
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 9f7c07a..9ced268 100644 (file)
@@ -2,6 +2,8 @@
 Test getting return-values correctly when stepping out
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index f260bbd..c8b388f 100644 (file)
@@ -2,6 +2,8 @@
 Set the contents of variables and registers using raw data
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 71b96b7..0e3c10b 100644 (file)
@@ -1,5 +1,7 @@
 ï»¿"""Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, signal
index 70b8cf2..b938003 100644 (file)
@@ -1,5 +1,7 @@
 """Test that we can debug inferiors that handle SIGSEGV by themselves"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 6705bfd..8a976b6 100644 (file)
@@ -1,5 +1,7 @@
 """Test that we handle inferiors that send signals to themselves"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -184,7 +186,7 @@ class RaiseTestCase(TestBase):
         # The last WaitForEvent call will time out after 2 seconds.
         while listener.WaitForEvent(2, event):
             if self.TraceOn():
-                print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))
+                print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)))
 
         # now the process should be stopped
         self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
@@ -204,7 +206,7 @@ class RaiseTestCase(TestBase):
         # Clear the events again
         while listener.WaitForEvent(2, event):
             if self.TraceOn():
-                print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))
+                print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)))
 
         # The process should be stopped due to a signal
         self.assertEqual(process.GetState(), lldb.eStateStopped)
index 17af6cb..111940e 100644 (file)
@@ -2,6 +2,8 @@
 Test the lldb command line takes a filename with single quote chars.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -57,13 +59,13 @@ class SingleQuoteInCommandLineTestCase(TestBase):
         
         with open('child_send.txt', 'r') as fs:
             if self.TraceOn():
-                print "\n\nContents of child_send.txt:"
-                print fs.read()
+                print("\n\nContents of child_send.txt:")
+                print(fs.read())
         with open('child_read.txt', 'r') as fr:
             from_child = fr.read()
             if self.TraceOn():
-                print "\n\nContents of child_read.txt:"
-                print from_child
+                print("\n\nContents of child_read.txt:")
+                print(from_child)
 
             self.expect(from_child, exe=False,
                 substrs = ["Current executable set to"])
index 3585b2f..3427ec1 100644 (file)
@@ -2,6 +2,8 @@
 Test thread step-in, step-over and step-out work with the "Avoid no debug" option.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 9158412..916faee 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb target stop-hook command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 211c3f9..cba672e 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb target stop-hook mechanism to see whether it fires off correctly .
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -83,7 +85,7 @@ class StopHookMechanismTestCase(TestBase):
         # make up a whole nother test case for it.
         child.sendline('frame info')
         at_line = 'at main.cpp:%d' % (self.correct_step_line)
-        print 'expecting "%s"' % at_line
+        print('expecting "%s"' % at_line)
         child.expect_exact(at_line)
 
         # Now continue the inferior, we'll stop at another breakpoint which is outside the stop-hook range.
index 28dcd1c..bf1d185 100644 (file)
@@ -2,6 +2,8 @@
 Test some target commands: create, list, select, variable.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
@@ -76,7 +78,7 @@ class targetCommandTestCase(TestBase):
                 if match:
                     # We will start from (index + 1) ....
                     base = int(match.group(1), 10) + 1
-                    #print "base is:", base
+                    #print("base is:", base)
                     break;
 
         self.runCmd("target create " + exe_a, CURRENT_EXECUTABLE_SET)
index 8a2ad59..4ba3ed5 100644 (file)
@@ -2,6 +2,8 @@
 Test number of threads.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3fa1b49..af86dbf 100644 (file)
@@ -10,6 +10,8 @@ until exit or a crash takes place, and the number of events seen by LLDB is
 verified to match the expected number of events.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index a9b0686..4a55aff 100644 (file)
@@ -2,6 +2,8 @@
 Test jumping to different places.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 06225f1..0a434bf 100644 (file)
@@ -2,6 +2,8 @@
 Test thread states.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 3100b36..aa5d09e 100644 (file)
@@ -2,6 +2,8 @@
 Test stepping out from a function in a multi-threaded program.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3979765..facf1aa 100644 (file)
@@ -2,6 +2,8 @@
 Test number of threads.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 79cc264..8706a46 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb command aliases.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 5795218..f5e6e94 100644 (file)
@@ -2,6 +2,8 @@
 Check that types only get completed when necessary.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -72,11 +74,11 @@ class TypeCompletionTestCase(TestBase):
         self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete')
         field0 = name_address_type.GetFieldAtIndex(0)
         if self.TraceOn():
-             print 'field0: ' + str(field0)
+             print('field0: ' + str(field0))
         self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid')
         string = field0.GetType().GetPointeeType()
         if self.TraceOn():
-             print 'string: ' + str(string)
+             print('string: ' + str(string))
         self.assertTrue(string.IsValid(), 'std::string should be valid')
         self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be')
 
@@ -90,11 +92,11 @@ class TypeCompletionTestCase(TestBase):
         self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete')
         field0 = name_address_type.GetFieldAtIndex(0)
         if self.TraceOn():
-             print 'field0: ' + str(field0)
+             print('field0: ' + str(field0))
         self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid')
         string = field0.GetType().GetPointeeType()
         if self.TraceOn():
-             print 'string: ' + str(string)
+             print('string: ' + str(string))
         self.assertTrue(string.IsValid(), 'std::string should be valid')
         self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be')
 
index 4e27a02..26e56c9 100644 (file)
@@ -2,6 +2,8 @@
 Test type lookup command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 2d557f1..7b0fa13 100644 (file)
@@ -2,6 +2,8 @@
 Test that we can backtrace correctly with 'noreturn' functions on the stack
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -42,9 +44,9 @@ class NoreturnUnwind(TestBase):
             abort_frame_number = abort_frame_number + 1
 
         if self.TraceOn():
-            print "Backtrace once we're stopped:"
+            print("Backtrace once we're stopped:")
             for f in thread.frames:
-                print "  %d %s" % (f.GetFrameID(), f.GetFunctionName())
+                print("  %d %s" % (f.GetFrameID(), f.GetFunctionName()))
 
         # I'm going to assume that abort() ends up calling/invoking another
         # function before halting the process.  In which case if abort_frame_number
index fe375b4..a4d25fa 100644 (file)
@@ -2,6 +2,8 @@
 Test that we can backtrace correctly with 'sigtramp' functions on the stack
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -62,9 +64,9 @@ class SigtrampUnwind(TestBase):
                 found_main = True
 
         if self.TraceOn():
-            print "Backtrace once we're stopped:"
+            print("Backtrace once we're stopped:")
             for f in thread.frames:
-                print "  %d %s" % (f.GetFrameID(), f.GetFunctionName())
+                print("  %d %s" % (f.GetFrameID(), f.GetFunctionName()))
 
         if found_handler == False:
             self.fail("Unable to find handler() in backtrace.")
index 58f7db0..bba6a71 100644 (file)
@@ -10,6 +10,8 @@ file up and generate a test case from it in run time (with name test_standard_un
 after escaping some special characters).
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -84,9 +86,9 @@ class StandardUnwindTest(TestBase):
             thread = process.GetThreadAtIndex(0)
 
             if self.TraceOn():
-                print "INDEX: %u" % index
+                print("INDEX: %u" % index)
                 for f in thread.frames:
-                    print f
+                    print(f)
 
             if thread.GetFrameAtIndex(0).GetFunctionName() is not None:
                 found_main = False
@@ -131,7 +133,7 @@ for f in test_source_files:
                 self.setTearDownCleanup(d)
             except:
                 if self.TraceOn():
-                    print sys.exc_info()[0]
+                    print(sys.exc_info()[0])
                 self.skipTest("Inferior not supported")
             self.standard_unwind_tests()
 
index 9a51c58..01914a3 100644 (file)
@@ -2,6 +2,8 @@
 Verify that the hash computing logic for ValueObject's values can't crash us.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index d784faa..da48757 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb watchpoint that uses '-s size' to watch a pointed location with size.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 024791a..48e5e98 100644 (file)
@@ -2,6 +2,8 @@
 Test that lldb watchpoint works for multiple threads.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -126,7 +128,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
                     self.fail("Watchpoint hits not supposed to exceed 1 by design!")
                 # Good, we verified that the watchpoint works!  Now delete the watchpoint.
                 if self.TraceOn():
-                    print "watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops
+                    print("watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops)
                 self.runCmd("watchpoint delete 1")
                 self.expect("watchpoint list -v",
                     substrs = ['No watchpoints currently set.'])
index 821062d..6483f87 100644 (file)
@@ -1,5 +1,7 @@
 """Test that adding, deleting and modifying watchpoints sends the appropriate events."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -82,6 +84,6 @@ class TestWatchpointEvents (TestBase):
         # There shouldn't be another event waiting around:
         found_event = self.listener.PeekAtNextEventForBroadcasterWithType (self.target_bcast, lldb.SBTarget.eBroadcastBitBreakpointChanged, event)
         if found_event:
-            print "Found an event I didn't expect: ", event
+            print("Found an event I didn't expect: ", event)
 
         self.assertTrue (not found_event, "Only one event per change.")
index cdfd435..7763e78 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb watchpoint that uses 'watchpoint set -w write -s size' to watch a pointed location with size.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index f7e7bcf..b6f8091 100644 (file)
@@ -2,6 +2,8 @@
 Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 2c665e1..b25666c 100644 (file)
@@ -4,6 +4,8 @@ Test some lldb help commands.
 See also CommandInterpreter::OutputFormattedHelpText().
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 1899384..3f79233 100644 (file)
@@ -1,5 +1,7 @@
 """Test that anonymous structs/unions are transparent to member access"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 98e839c..85b4ede 100644 (file)
@@ -1,5 +1,7 @@
 """Test breakpoint by file/line number; and list variables with array types."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 024af2d..5f53437 100644 (file)
@@ -1,5 +1,7 @@
 """Show bitfields and check that they display correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 783401e..5ad48ec 100644 (file)
@@ -1,5 +1,7 @@
 """Test that lldb can invoke blocks and access variables inside them"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 30fc91a..2f3a763 100644 (file)
@@ -1,5 +1,7 @@
 """Check that compiler-generated constant values work correctly"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6f1c52d..a8af960 100644 (file)
@@ -1,5 +1,7 @@
 """Look up enum type information and check for correct display."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6db0b30..430f20b 100644 (file)
@@ -1,5 +1,7 @@
 """Test that forward declaration of a data structure gets resolved correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index fb46ea8..ab5d1bc 100644 (file)
@@ -1,5 +1,7 @@
 """Test variable with function ptr type and that break on the function works."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 7d9c0dd..92f2526 100644 (file)
@@ -1,5 +1,7 @@
 """Show global variables and check that they do indeed have global scopes."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 5875c77..c35a687 100644 (file)
@@ -1,5 +1,7 @@
 """Test that importing modules in C works as expected."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index a73bc26..343dcc8 100644 (file)
@@ -1,5 +1,7 @@
 """Check that compiler-generated register values work correctly"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index ae70f77..c568517 100644 (file)
@@ -1,5 +1,7 @@
 """Test settings and readings of program variables."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index dd09527..0d47806 100644 (file)
@@ -1,5 +1,7 @@
 """Test that types defined in shared libraries work correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 611a361..e4dac28 100644 (file)
@@ -1,5 +1,7 @@
 """Test that types defined in shared libraries with stripped symbols work correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index ed50926..170a02b 100644 (file)
@@ -1,5 +1,7 @@
 """Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index e02551b..db8a726 100644 (file)
@@ -2,6 +2,8 @@
 Test thread stepping features in combination with frame select.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 305ff39..0959154 100644 (file)
@@ -1,5 +1,7 @@
 """Test that thread-local storage can be read correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 5c2882b..fc8a5a6 100644 (file)
@@ -1,5 +1,7 @@
 """Look up type information for typedefs of same name at different lexical scope and check for correct display."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 867bfed..72c01ad 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb breakpoint command for CPP methods & functions in a namespace.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 7392f79..0e55bab 100644 (file)
@@ -3,6 +3,8 @@
 Test that the C++11 support for char16_t and char32_t works correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index c9182fe..ba770af 100644 (file)
@@ -2,6 +2,8 @@
 Test display and Python APIs on file and class static variables.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6d737e0..9a46f5d 100644 (file)
@@ -1,5 +1,7 @@
 """Test breakpoint on a class constructor; and variable list the this object."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 031c2b3..f9e0f5f 100644 (file)
@@ -2,6 +2,8 @@
 Test the lldb disassemble command on each call frame when stopped on C's ctor.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -30,8 +32,8 @@ class IterateFrameAndDisassembleTestCase(TestBase):
             match = frameRE.search(line)
             if match:
                 function = match.group(1)
-                #print "line:", line
-                #print "function:", function
+                #print("line:", line)
+                #print("function:", function)
                 self.runCmd("disassemble -n '%s'" % function)
 
     @python_api_test
@@ -51,8 +53,8 @@ class IterateFrameAndDisassembleTestCase(TestBase):
             function = frame.GetFunction()
             # Print the function header.
             if self.TraceOn():
-                print
-                print function
+                print()
+                print(function)
             if function:
                 # Get all instructions for this function and print them out.
                 insts = function.GetInstructions(target)
@@ -61,7 +63,7 @@ class IterateFrameAndDisassembleTestCase(TestBase):
                     # But we want to print to stdout only if self.TraceOn() is True.
                     disasm = str(inst)
                     if self.TraceOn():
-                        print disasm
+                        print(disasm)
 
     def setUp(self):
         # Call super's setUp().
index f46bad7..4d620a9 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb Python API SBValue::Cast(SBType) for C++ types.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -81,8 +83,8 @@ class CppValueCastTestCase(TestBase):
 
         if self.TraceOn():
             for child in tellerA:
-                print "child name:", child.GetName()
-                print child
+                print("child name:", child.GetName())
+                print(child)
 
         # Call SBValue.Cast() to obtain instanceA.
         instanceA = tellerA.Cast(typeA.GetPointerType())
@@ -91,8 +93,8 @@ class CppValueCastTestCase(TestBase):
         # Iterate through all the children and print their values.
         if self.TraceOn():
             for child in instanceA:
-                print "child name:", child.GetName()
-                print child
+                print("child name:", child.GetName())
+                print(child)
         a_member_val = instanceA.GetChildMemberWithName('m_a_val')
         self.DebugSBValue(a_member_val)
         self.assertTrue(a_member_val.GetValueAsUnsigned(error, 0) == 10)
@@ -109,8 +111,8 @@ class CppValueCastTestCase(TestBase):
 
         if self.TraceOn():
             for child in tellerB:
-                print "child name:", child.GetName()
-                print child
+                print("child name:", child.GetName())
+                print(child)
 
         # Call SBValue.Cast() to obtain instanceB.
         instanceB = tellerB.Cast(typeB.GetPointerType())
@@ -119,8 +121,8 @@ class CppValueCastTestCase(TestBase):
         # Iterate through all the children and print their values.
         if self.TraceOn():
             for child in instanceB:
-                print "child name:", child.GetName()
-                print child
+                print("child name:", child.GetName())
+                print(child)
         b_member_val = instanceB.GetChildMemberWithName('m_b_val')
         self.DebugSBValue(b_member_val)
         self.assertTrue(b_member_val.GetValueAsUnsigned(error, 0) == 36)
index 3ef4193..7095e42 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to test dynamic values in C++
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index c0fb310..a31519f 100644 (file)
@@ -1,5 +1,7 @@
 """Look up enum type information and check for correct display."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 51135c7..babe4f2 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb exception breakpoint command for CPP.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 08825c4..40f1298 100644 (file)
@@ -2,6 +2,8 @@
 Test the printing of anonymous and named namespace variables.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 4ac48e1..df1b5ac 100644 (file)
@@ -3,6 +3,8 @@
 Test that the expression parser returns proper Unicode strings.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 8ae2e22..5bac76e 100644 (file)
@@ -2,6 +2,8 @@
 Test that variables with signed types display correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index f221a1a..aaf16d3 100644 (file)
@@ -2,6 +2,8 @@
 Tests that C++ member and static variables have correct layout and scope.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index e326526..66a8dce 100644 (file)
@@ -2,6 +2,8 @@
 Test some expressions involving STL data types.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index dad5bf2..1ffb765 100644 (file)
@@ -2,6 +2,8 @@
 Test the lldb disassemble command on lib stdc++.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -96,9 +98,9 @@ class StdCXXDisassembleTestCase(TestBase):
             if match:
                 LA = match.group(1)
                 if self.TraceOn():
-                    print "line:", line
-                    print "load address:", LA
-                    print "SA:", SA
+                    print("line:", line)
+                    print("load address:", LA)
+                    print("SA:", SA)
                 if SA and LA:
                     if int(LA, 16) > int(SA, 16):
                         self.runCmd("disassemble -s %s -e %s" % (SA, LA))
index a1c9f25..9ac570e 100644 (file)
@@ -2,6 +2,8 @@
 Test that template instaniations of std::vector<long> and <short> in the same module have the correct types.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index a2c8ff7..9154cc6 100644 (file)
@@ -2,6 +2,8 @@
 Test that variables with unsigned types display correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 0904cfc..6863c07 100644 (file)
@@ -2,6 +2,8 @@
 Test C++ virtual function and virtual inheritance.
 """
 
+from __future__ import print_function
+
 import os, time
 import re
 import lldb
@@ -71,7 +73,7 @@ class CppVirtualMadness(TestBase):
             if match:
                 my_expr, val = match.group(1), match.group(2)
                 gl.append((my_expr, val))
-        #print "golden list:", gl
+        #print("golden list:", gl)
 
         # Now iterate through the golden list, comparing against the output from
         # 'expression var'.
index d2b3ab9..70cc028 100644 (file)
@@ -3,6 +3,8 @@
 Test that C++ supports wchar_t correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6c26a3a..a5726c4 100644 (file)
@@ -1,5 +1,7 @@
 """Test the Go OS Plugin."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 457b6d3..2f52563 100644 (file)
@@ -1,5 +1,7 @@
 """Test the go DWARF type parsing."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -103,8 +105,8 @@ class TestGoASTContext(TestBase):
         self.assertEqual(1, v.GetNumChildren())
         self.assertEqual('-10', v.GetChildAtIndex(0).value)
         
-        # print
-        # print os.getpid()
+        # print()
+        # print(os.getpid())
         # time.sleep(60)
         v = self.var('theStruct')
         if v.TypeIsPointerType():
index 1fbf118..e791686 100644 (file)
@@ -1,5 +1,7 @@
 """Test that lldb works correctly on compile units form different languages."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, re
index a629dcf..5e9d55a 100644 (file)
@@ -1,5 +1,7 @@
 """Test printing ivars and ObjC objects captured in blocks that are made in methods of an ObjC class."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -97,5 +99,5 @@ class TestObjCIvarsInBlocks(TestBase):
         self.assertTrue (expr, "Successfully got a local variable in a block in a class method.")
 
         ret_value_signed = expr.GetValueAsSigned (error)
-        # print 'ret_value_signed = %i' % (ret_value_signed)
+        # print('ret_value_signed = %i' % (ret_value_signed))
         self.assertTrue (ret_value_signed == 5, "The local variable in the block was what we expected.")
index 6c2f109..49c2995 100644 (file)
@@ -1,5 +1,7 @@
 """Test that a forward-declared class works when its complete definition is in a library"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 772f5d7..11726c9 100644 (file)
@@ -3,6 +3,8 @@ Test that objective-c constant strings are generated correctly by the expression
 parser.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index cd03e76..6488b98 100644 (file)
@@ -2,6 +2,8 @@
 Test the lldb disassemble command on foundation framework.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -35,7 +37,7 @@ class FoundationDisassembleTestCase(TestBase):
 
         foundation_framework = None
         for module in target.modules:
-            print module
+            print(module)
             if module.file.basename == "Foundation":
                 foundation_framework = module.file.fullpath
                 break
@@ -58,8 +60,8 @@ class FoundationDisassembleTestCase(TestBase):
             match = codeRE.search(line)
             if match:
                 func = match.group(1)
-                #print "line:", line
-                #print "func:", func
+                #print("line:", line)
+                #print("func:", func)
                 self.runCmd('disassemble -n "%s"' % func)
         
 
@@ -71,9 +73,9 @@ class FoundationDisassembleTestCase(TestBase):
         target = self.dbg.CreateTarget("a.out")
         self.assertTrue(target, VALID_TARGET)
 
-        print target
+        print(target)
         for module in target.modules:
-            print module
+            print(module)
 
         # Stop at +[NSString stringWithFormat:].
         symbol_name = "+[NSString stringWithFormat:]"
index 1417d01..ee5fab5 100644 (file)
@@ -3,6 +3,8 @@ Set breakpoints on objective-c class and instance methods in foundation.
 Also lookup objective-c data types and evaluate expressions.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, os.path, time
@@ -253,8 +255,8 @@ class FoundationTestCase(TestBase):
             for line in lines:
                 if string.find(line, "$__lldb") != -1:
                     if num_errors == 0:
-                        print "error: found spurious name lookups when evaluating an expression:"
+                        print("error: found spurious name lookups when evaluating an expression:")
                     num_errors += 1
-                    print line,
+                    print(line, end='')
             self.assertTrue(num_errors == 0, "Spurious lookups detected")
             f.close()
index 9c6ce04..ccc93ca 100644 (file)
@@ -2,6 +2,8 @@
 Test more expression command sequences with objective-c.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6dd9b90..f0b1d0d 100644 (file)
@@ -2,6 +2,8 @@
 Test SBValue.GetObjectDescription() with the value from SBTarget.FindGlobalVariables().
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -52,8 +54,8 @@ class ObjectDescriptionAPITestCase(TestBase):
         for v in value_list1:
             self.DebugSBValue(v)
             if self.TraceOn():
-                print "val:", v
-                print "object description:", v.GetObjectDescription()
+                print("val:", v)
+                print("object description:", v.GetObjectDescription())
             if v.GetName() == 'my_global_str':
                 self.assertTrue(v.GetObjectDescription() == 'This is a global string')
 
@@ -62,7 +64,7 @@ class ObjectDescriptionAPITestCase(TestBase):
         for v in value_list2:
             self.DebugSBValue(v)
             if self.TraceOn():
-                print "val:", v
-                print "object description:", v.GetObjectDescription()
+                print("val:", v)
+                print("object description:", v.GetObjectDescription())
             if v.GetName() == 'my_global_str':
                 self.assertTrue(v.GetObjectDescription() == 'This is a global string')
index a302fcc..357346b 100644 (file)
@@ -2,6 +2,8 @@
 Test that Objective-C methods from the runtime work correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3b1d820..378147e 100644 (file)
@@ -2,6 +2,8 @@
 Test symbol table access for main.m.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -53,14 +55,14 @@ class FoundationSymtabTestCase(TestBase):
         expected_symbols = set(self.symbols_list)
         for symbol in module:
             self.assertTrue(symbol, VALID_SYMBOL)
-            #print "symbol:", symbol
+            #print("symbol:", symbol)
             name = symbol.GetName()
             if name in expected_symbols:
-                #print "Removing %s from known_symbols %s" % (name, expected_symbols)
+                #print("Removing %s from known_symbols %s" % (name, expected_symbols))
                 expected_symbols.remove(name)
 
         # At this point, the known_symbols set should have become an empty set.
         # If not, raise an error.
-        #print "symbols unaccounted for:", expected_symbols
+        #print("symbols unaccounted for:", expected_symbols)
         self.assertTrue(len(expected_symbols) == 0,
                         "All the known symbols are accounted for")
index a36ba61..5b06ea2 100644 (file)
@@ -1,5 +1,7 @@
 """Test that hidden ivars in a shared library are visible from the main executable."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 2ccd8bc..a0c208b 100644 (file)
@@ -2,6 +2,8 @@
 Test that dynamically discovered ivars of type IMP do not crash LLDB
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -11,11 +13,11 @@ from lldbtest import *
 import commands
 
 def execute_command (command):
-    # print '%% %s' % (command)
+    # print('%% %s' % (command))
     (exit_status, output) = commands.getstatusoutput (command)
     # if output:
-    #     print output
-    # print 'status = %u' % (exit_status)
+    #     print(output)
+    # print('status = %u' % (exit_status))
     return exit_status
 
 class ObjCiVarIMPTestCase(TestBase):
index a836cda..c00d0d1 100644 (file)
@@ -1,5 +1,7 @@
 """Test that importing modules in Objective-C works as expected."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 0db2a11..12d4e37 100644 (file)
@@ -1,5 +1,7 @@
 """Test that DWARF types are trusted over module types"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index b322cf0..22d0909 100644 (file)
@@ -1,5 +1,7 @@
 """Test that inline functions from modules are imported correctly"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index aa3351a..f8ed11a 100644 (file)
@@ -1,5 +1,7 @@
 """Test that importing modules in Objective-C works as expected."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 2c5b320..b553035 100644 (file)
@@ -2,6 +2,8 @@
 Make sure that ivars of Objective-C++ classes are visible in LLDB.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index da4b146..d7cdda1 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to test base class resolution for ObjC classes
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index eeedc9b..95a5414 100644 (file)
@@ -1,5 +1,7 @@
 """Test that the expression parser doesn't get confused by 'id' and 'Class'"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 15820b6..b3c4443 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to make sure the dynamic checkers are doing their jobs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 70cb513..a22a2c0 100644 (file)
@@ -1,5 +1,7 @@
 """Test calling functions in class methods."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 9e4a7e2..f6a7b74 100644 (file)
@@ -2,6 +2,8 @@
 Test that we are able to properly report a usable dynamic type
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index bd0bbea..7c2b7dc 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to test dynamic values in ObjC
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 26e09da..c53d84c 100644 (file)
@@ -1,5 +1,7 @@
 """Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index dd4620f..de529e8 100644 (file)
@@ -1,5 +1,7 @@
 """Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 66dc4d5..afdbc61 100644 (file)
@@ -1,5 +1,7 @@
 """Test that the Objective-C syntax for dictionary/array literals and indexing works"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index a2769e2..28712b9 100644 (file)
@@ -7,6 +7,8 @@ or 'self' variable was not properly read if the compiler
 optimized it into a register.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index f21ab34..0806776 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to verify that expression evaluation for property references uses the correct getters and setters
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index a071987..6d230f2 100644 (file)
@@ -1,5 +1,7 @@
 """Test calling functions in static methods with a stripped binary."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 443c4c5..290d29e 100644 (file)
@@ -1,5 +1,7 @@
 """Test calling functions in static methods."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 015992c..2f51a9a 100644 (file)
@@ -1,5 +1,7 @@
 """Test stepping through ObjC method dispatch in various forms."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -85,7 +87,7 @@ class TestObjCStepping(TestBase):
         className = mySource_isa.GetSummary ()
 
         if self.TraceOn():
-             print mySource_isa
+             print(mySource_isa)
 
         # Lets delete mySource so we can check that after stepping a child variable
         # with no parent persists and is useful.
@@ -127,7 +129,7 @@ class TestObjCStepping(TestBase):
         newClassName = mySource_isa.GetSummary ()
 
         if self.TraceOn():
-             print mySource_isa
+             print(mySource_isa)
 
         self.assertTrue (newClassName != className, "The isa did indeed change, swizzled!")
 
index be6e87b..1b4388f 100644 (file)
@@ -1,5 +1,7 @@
 """Test passing structs to Objective-C methods."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index d6fafd7..6045568 100644 (file)
@@ -1,5 +1,7 @@
 """Test calling functions in class methods."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 4aba9e9..051cb25 100644 (file)
@@ -1,5 +1,7 @@
 """Test calling methods on super."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index b1205cf..440f0c4 100644 (file)
@@ -2,6 +2,8 @@
 Test "print object" where another thread blocks the print object from making progress.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -65,7 +67,7 @@ class PrintObjTestCase(TestBase):
         self.assertTrue(other_thread)
         process.SetSelectedThread(other_thread)
         if self.TraceOn():
-            print "selected thread:" + lldbutil.get_description(other_thread)
+            print("selected thread:" + lldbutil.get_description(other_thread))
         self.runCmd("thread backtrace")
 
         # We want to traverse the frame to the one corresponding to blocked.m to
@@ -78,7 +80,7 @@ class PrintObjTestCase(TestBase):
             if name == 'main':
                 other_thread.SetSelectedFrame(i)
                 if self.TraceOn():
-                    print "selected frame:" + lldbutil.get_description(frame)
+                    print("selected frame:" + lldbutil.get_description(frame))
                 break
 
         self.expect("po lock_me", OBJECT_PRINTED_CORRECTLY,
index 726ec82..dd8e967 100644 (file)
@@ -2,6 +2,8 @@
 Test that objective-c method returning BOOL works correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index be9b6cf..1b087c6 100644 (file)
@@ -2,6 +2,8 @@
 Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3523695..b36b82f 100644 (file)
@@ -2,6 +2,8 @@
 Test that we do not attempt to make a dynamic type for a 'const char*'
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 54fa80c..81ec1a8 100644 (file)
@@ -2,6 +2,8 @@
 Test that we are able to find out how many children NSWindow has
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 04e4986..8a87e09 100644 (file)
@@ -1,5 +1,7 @@
 """Test that types defined in shared libraries work correctly."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 3f7641b..635aa85 100644 (file)
@@ -3,6 +3,8 @@ Test lldb ability to unwind a stack with a function containing a call to the
 '__builtin_trap' intrinsic, which GCC (4.6) encodes to an illegal opcode.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 8bcf39e..fdc9b1e 100644 (file)
@@ -3,6 +3,8 @@ This tests that we do not lose control of the inferior, while doing an instructi
 over a thread creation instruction.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 9048541..0f0351c 100644 (file)
@@ -115,22 +115,22 @@ class Window(object):
                 child.resize(new_frame.size)
             
             if adjust_neighbors:
-                #print 'orig_frame = %s\r\n' % (str(orig_frame)),
+                #print('orig_frame = %s\r\n' % (str(orig_frame)), end='')
                 for curr_child in self.children:
                     if curr_child is child:
                         continue
                     curr_child_frame = curr_child.get_frame()
                     if delta_size.w != 0:
-                        #print 'curr_child_frame = %s\r\n' % (str(curr_child_frame)),
+                        #print('curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='')
                         if curr_child_frame.get_min_x() == orig_frame.get_max_x(): 
                             curr_child_frame.origin.x += delta_size.w
                             curr_child_frame.size.w -= delta_size.w
-                            #print 'adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)),
+                            #print('adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='')
                             curr_child.resize (curr_child_frame.size)
                             curr_child.slide_position (Size(w=delta_size.w, h=0))
                         elif curr_child_frame.get_max_x() == orig_frame.get_min_x():
                             curr_child_frame.size.w -= delta_size.w
-                            #print 'adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)),
+                            #print('adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='')
                             curr_child.resize (curr_child_frame.size)
     
     def add_key_action(self, arg, callback, decription):
index f25534e..6110b32 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 29404a8..b8e29a7 100644 (file)
@@ -1584,7 +1584,7 @@ class Base(unittest2.TestCase):
         During test execution, there might be cases where we don't want to show the
         standard output to the user.  For example,
 
-            self.runCmd(r'''sc print "\n\n\tHello!\n"''')
+            self.runCmd(r'''sc print("\n\n\tHello!\n")''')
 
         tests whether command abbreviation for 'script' works or not.  There is no
         need to show the 'Hello' output to the user as long as the 'script' command
index 8c23637..c824990 100644 (file)
@@ -796,7 +796,7 @@ def print_registers(frame, string_buffer = False):
     registerSet = frame.GetRegisters() # Return type of SBValueList.
     print("Frame registers (size of register set = %d):" % registerSet.GetSize(), file=output)
     for value in registerSet:
-        #print >> output, value 
+        #print(value, file=output)
         print("%s (number of children = %d):" % (value.GetName(), value.GetNumChildren()), file=output)
         for child in value:
             print("Name: %s, Value: %s" % (child.GetName(), child.GetValue()), file=output)
@@ -824,7 +824,7 @@ def get_GPRs(frame):
         from lldbutil import get_GPRs
         regs = get_GPRs(frame)
         for reg in regs:
-            print "%s => %s" % (reg.GetName(), reg.GetValue())
+            print("%s => %s" % (reg.GetName(), reg.GetValue()))
         ...
     """
     return get_registers(frame, "general purpose")
@@ -837,7 +837,7 @@ def get_FPRs(frame):
         from lldbutil import get_FPRs
         regs = get_FPRs(frame)
         for reg in regs:
-            print "%s => %s" % (reg.GetName(), reg.GetValue())
+            print("%s => %s" % (reg.GetName(), reg.GetValue()))
         ...
     """
     return get_registers(frame, "floating point")
@@ -850,7 +850,7 @@ def get_ESRs(frame):
         from lldbutil import get_ESRs
         regs = get_ESRs(frame)
         for reg in regs:
-            print "%s => %s" % (reg.GetName(), reg.GetValue())
+            print("%s => %s" % (reg.GetName(), reg.GetValue()))
         ...
     """
     return get_registers(frame, "exception state")
index ae8398f..346b660 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb logging.  This test just makes sure logging doesn't crash, and produces some output.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, string
index 5dae2a0..e5d4202 100644 (file)
@@ -1,5 +1,7 @@
 """Test that the 'add-dsym', aka 'target symbols add', succeeds in the middle of debug session."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 6e739f5..bd25db6 100644 (file)
@@ -2,6 +2,8 @@
 Test that clang produces the __apple accelerator tables, for example, __apple_types, correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -35,29 +37,29 @@ class AppleTypesTestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print "Number of modules for the target: %d" % target.GetNumModules()
+        print("Number of modules for the target: %d" % target.GetNumModules())
         for module in target.module_iter():
-            print module
+            print(module)
 
         # Get the executable module at index 0.
         exe_module = target.GetModuleAtIndex(0)
 
         dwarf_section = exe_module.FindSection("__DWARF")
         self.assertTrue(dwarf_section)
-        print "__DWARF section:", dwarf_section
-        print "Number of sub-sections: %d" % dwarf_section.GetNumSubSections()
+        print("__DWARF section:", dwarf_section)
+        print("Number of sub-sections: %d" % dwarf_section.GetNumSubSections())
         INDENT = ' ' * 4
         for subsec in dwarf_section:
-            print INDENT + str(subsec)
+            print(INDENT + str(subsec))
 
         debug_str_sub_section = dwarf_section.FindSubSection("__debug_str")
         self.assertTrue(debug_str_sub_section)
-        print "__debug_str sub-section:", debug_str_sub_section
+        print("__debug_str sub-section:", debug_str_sub_section)
 
         # Find our __apple_types section by name.
         apple_types_sub_section = dwarf_section.FindSubSection("__apple_types")
         self.assertTrue(apple_types_sub_section)
-        print "__apple_types sub-section:", apple_types_sub_section
+        print("__apple_types sub-section:", apple_types_sub_section)
 
         # These other three all important subsections should also be present.
         self.assertTrue(dwarf_section.FindSubSection("__apple_names") and
index 7f1fabc..3985358 100644 (file)
@@ -1,5 +1,7 @@
 """Test stepping and setting breakpoints in indirect and re-exported symbols."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index b0d9fd9..fee48e0 100644 (file)
@@ -2,6 +2,8 @@
 Test that debug symbols have the correct order as specified by the order file.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 82149e3..77b1b6b 100644 (file)
@@ -1,5 +1,7 @@
 """Test queues inspection SB APIs."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 6e77790..e0e7b74 100644 (file)
@@ -1,5 +1,7 @@
 """Test function call thread safety."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 9628c53..efe49a1 100644 (file)
@@ -1,5 +1,7 @@
 """Test aspects of lldb commands on universal binaries."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index ac5d8aa..3e69995 100644 (file)
@@ -1,9 +1,11 @@
+
+from __future__ import print_function
 import os
 import lldbtest
 
 from builder_base import *
 
-#print "Hello, darwin plugin!"
+#print("Hello, darwin plugin!")
 
 def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True):
     """Build the binaries with dsym debug info."""
index 9c29e6c..245c142 100644 (file)
@@ -2,6 +2,8 @@
 Test SBBreakpoint APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -25,7 +27,7 @@ class BreakpointAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'AFunction'.
         breakpoint = target.BreakpointCreateByName('AFunction', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
index 90e79dc..6ead0af 100644 (file)
@@ -2,6 +2,8 @@
 Test SBType APIs to fetch member function types.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index e7b141e..fb8961d 100644 (file)
@@ -11,6 +11,8 @@ SBCommadnReturnObject, SBStream, and SBSymbolContextList, are all valid objects
 after default construction.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -27,7 +29,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBAddress(self):
         obj = lldb.SBAddress()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_address
@@ -38,7 +40,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBBlock(self):
         obj = lldb.SBBlock()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_block
@@ -49,7 +51,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBBreakpoint(self):
         obj = lldb.SBBreakpoint()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_breakpoint
@@ -60,7 +62,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBBreakpointLocation(self):
         obj = lldb.SBBreakpointLocation()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_breakpointlocation
@@ -71,7 +73,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBBroadcaster(self):
         obj = lldb.SBBroadcaster()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_broadcaster
@@ -83,7 +85,7 @@ class APIDefaultConstructorTestCase(TestBase):
         """SBCommandReturnObject object is valid after default construction."""
         obj = lldb.SBCommandReturnObject()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertTrue(obj)
 
     @python_api_test
@@ -91,7 +93,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBCommunication(self):
         obj = lldb.SBCommunication()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_communication
@@ -102,7 +104,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBCompileUnit(self):
         obj = lldb.SBCompileUnit()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_compileunit
@@ -113,7 +115,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBDebugger(self):
         obj = lldb.SBDebugger()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_debugger
@@ -125,7 +127,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBError(self):
         obj = lldb.SBError()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_error
@@ -138,7 +140,7 @@ class APIDefaultConstructorTestCase(TestBase):
         # This is just to test that typemap, as defined in lldb.swig, works.
         obj2 = lldb.SBEvent(0, "abc")
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_event
@@ -150,7 +152,7 @@ class APIDefaultConstructorTestCase(TestBase):
         # This is just to test that FileSpec(None) does not crash.
         obj2 = lldb.SBFileSpec(None, True)
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_filespec
@@ -161,7 +163,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBFrame(self):
         obj = lldb.SBFrame()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_frame
@@ -172,7 +174,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBFunction(self):
         obj = lldb.SBFunction()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_function
@@ -183,7 +185,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBInstruction(self):
         obj = lldb.SBInstruction()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_instruction
@@ -194,7 +196,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBInstructionList(self):
         obj = lldb.SBInstructionList()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_instructionlist
@@ -205,7 +207,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBLineEntry(self):
         obj = lldb.SBLineEntry()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_lineentry
@@ -216,7 +218,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBListener(self):
         obj = lldb.SBListener()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_listener
@@ -227,7 +229,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBModule(self):
         obj = lldb.SBModule()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_module
@@ -238,7 +240,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBProcess(self):
         obj = lldb.SBProcess()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_process
@@ -249,7 +251,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBSection(self):
         obj = lldb.SBSection()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_section
@@ -261,7 +263,7 @@ class APIDefaultConstructorTestCase(TestBase):
         """SBStream object is valid after default construction."""
         obj = lldb.SBStream()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertTrue(obj)
 
     @python_api_test
@@ -269,7 +271,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBStringList(self):
         obj = lldb.SBStringList()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_stringlist
@@ -280,7 +282,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBSymbol(self):
         obj = lldb.SBSymbol()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_symbol
@@ -291,7 +293,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBSymbolContext(self):
         obj = lldb.SBSymbolContext()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_symbolcontext
@@ -303,7 +305,7 @@ class APIDefaultConstructorTestCase(TestBase):
         """SBSymbolContextList object is valid after default construction."""
         obj = lldb.SBSymbolContextList()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertTrue(obj)
 
     @python_api_test
@@ -311,7 +313,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBTarget(self):
         obj = lldb.SBTarget()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_target
@@ -322,7 +324,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBThread(self):
         obj = lldb.SBThread()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_thread
@@ -334,7 +336,7 @@ class APIDefaultConstructorTestCase(TestBase):
         try:
             obj = lldb.SBType()
             if self.TraceOn():
-                print obj
+                print(obj)
             self.assertFalse(obj)
             # If we reach here, the test fails.
             self.fail("lldb.SBType() should fail, not succeed!")
@@ -353,7 +355,7 @@ class APIDefaultConstructorTestCase(TestBase):
         """SBTypeList object is valid after default construction."""
         obj = lldb.SBTypeList()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertTrue(obj)
 
     @python_api_test
@@ -361,7 +363,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBValue(self):
         obj = lldb.SBValue()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_value
@@ -372,7 +374,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBValueList(self):
         obj = lldb.SBValueList()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_valuelist
@@ -383,7 +385,7 @@ class APIDefaultConstructorTestCase(TestBase):
     def test_SBWatchpoint(self):
         obj = lldb.SBWatchpoint()
         if self.TraceOn():
-            print obj
+            print(obj)
         self.assertFalse(obj)
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_watchpoint
index e16c6f0..a6a1657 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to disassemble raw machine code bytes
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -28,9 +30,9 @@ class DisassembleRawDataTestCase(TestBase):
         inst = insts.GetInstructionAtIndex(0)
 
         if self.TraceOn():
-            print
-            print "Raw bytes:    ", [hex(x) for x in raw_bytes]
-            print "Disassembled%s" % str(inst)
+            print()
+            print("Raw bytes:    ", [hex(x) for x in raw_bytes])
+            print("Disassembled%s" % str(inst))
  
         self.assertTrue (inst.GetMnemonic(target) == "movq")
         self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' + "rbp")
index d25dabc..6e326b8 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python API to disassemble raw machine code bytes
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -31,9 +33,9 @@ class Disassemble_VST1_64(TestBase):
         insts = target.GetInstructions(lldb.SBAddress(), raw_bytes)
 
         if self.TraceOn():
-            print
+            print()
             for i in insts:
-                print "Disassembled%s" % str(i)
+                print("Disassembled%s" % str(i))
 
         # Remove the following return statement when the radar is fixed.
         return
@@ -48,8 +50,8 @@ class Disassemble_VST1_64(TestBase):
         inst = insts.GetInstructionAtIndex(0)
 
         if self.TraceOn():
-            print
-            print "Raw bytes:    ", [hex(x) for x in raw_bytes]
-            print "Disassembled%s" % str(inst)
+            print()
+            print("Raw bytes:    ", [hex(x) for x in raw_bytes])
+            print("Disassembled%s" % str(inst))
  
         self.assertTrue (inst.GetMnemonic(target) == "vst1.64")
index f2d5257..6fcb67f 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb Python event APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -69,17 +71,17 @@ class EventAPITestCase(TestBase):
                 # After that, the thread exits.
                 while not count > 3:
                     if traceOn:
-                        print "Try wait for event..."
+                        print("Try wait for event...")
                     if listener.WaitForEvent(5, event):
                         if traceOn:
                             desc = lldbutil.get_description(event)
-                            print "Event description:", desc
-                            print "Event data flavor:", event.GetDataFlavor()
-                            print "Process state:", lldbutil.state_type_to_str(process.GetState())
-                            print
+                            print("Event description:", desc)
+                            print("Event data flavor:", event.GetDataFlavor())
+                            print("Process state:", lldbutil.state_type_to_str(process.GetState()))
+                            print()
                     else:
                         if traceOn:
-                            print "timeout occurred waiting for event..."
+                            print("timeout occurred waiting for event...")
                     count = count + 1
                 return
 
@@ -112,7 +114,7 @@ class EventAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -146,12 +148,12 @@ class EventAPITestCase(TestBase):
                 # Let's only try at most 3 times to retrieve any kind of event.
                 while not count > 3:
                     if listener.WaitForEvent(5, event):
-                        #print "Got a valid event:", event
-                        #print "Event data flavor:", event.GetDataFlavor()
-                        #print "Event type:", lldbutil.state_type_to_str(event.GetType())
+                        #print("Got a valid event:", event)
+                        #print("Event data flavor:", event.GetDataFlavor())
+                        #print("Event type:", lldbutil.state_type_to_str(event.GetType()))
                         return
                     count = count + 1
-                    print "Timeout: listener.WaitForEvent"
+                    print("Timeout: listener.WaitForEvent")
 
                 return
 
@@ -186,7 +188,7 @@ class EventAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -225,7 +227,7 @@ class EventAPITestCase(TestBase):
         import threading
         class MyListeningThread(threading.Thread):
             def run(self):
-                #print "Running MyListeningThread:", self
+                #print("Running MyListeningThread:", self)
 
                 # Regular expression pattern for the event description.
                 pattern = re.compile("data = {.*, state = (.*)}$")
@@ -235,7 +237,7 @@ class EventAPITestCase(TestBase):
                 while True:
                     if listener.WaitForEvent(5, event):
                         desc = lldbutil.get_description(event)
-                        #print "Event description:", desc
+                        #print("Event description:", desc)
                         match = pattern.search(desc)
                         if not match:
                             break;
@@ -256,7 +258,7 @@ class EventAPITestCase(TestBase):
                             break
                         else:
                             break
-                    print "Timeout: listener.WaitForEvent"
+                    print("Timeout: listener.WaitForEvent")
                     count = count + 1
                     if count > 6:
                         break
index c5bdcb8..6a3be36 100644 (file)
@@ -1,5 +1,7 @@
 """Test that SBFrame::FindValue finds things but does not duplicate the entire variables list"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index b6d693f..7f3075f 100644 (file)
@@ -1,5 +1,7 @@
 """Test Python APIs for working with formatters"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
@@ -324,19 +326,19 @@ class SBFormattersAPITestCase(TestBase):
         frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
         int_vector = frame.FindVariable("int_vector")
         if self.TraceOn():
-             print int_vector
+             print(int_vector)
         self.assertTrue(int_vector.GetNumChildren() == 0, 'synthetic vector is empty')
 
         self.runCmd('settings set target.enable-synthetic-value false')
         frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
         int_vector = frame.FindVariable("int_vector")
         if self.TraceOn():
-             print int_vector
+             print(int_vector)
         self.assertFalse(int_vector.GetNumChildren() == 0, '"physical" vector is not empty')
 
         self.runCmd('settings set target.enable-synthetic-value true')
         frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
         int_vector = frame.FindVariable("int_vector")
         if self.TraceOn():
-             print int_vector
+             print(int_vector)
         self.assertTrue(int_vector.GetNumChildren() == 0, 'synthetic vector is still empty')
index b13edd0..d8cccc6 100644 (file)
@@ -3,6 +3,8 @@ Use lldb Python SBFrame API to get the argument values of the call stacks.
 And other SBFrame API tests.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -27,7 +29,7 @@ class FrameAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -52,7 +54,7 @@ class FrameAPITestCase(TestBase):
             for i in range(numFrames):
                 frame = thread.GetFrameAtIndex(i)
                 if self.TraceOn():
-                    print "frame:", frame
+                    print("frame:", frame)
 
                 name = frame.GetFunction().GetName()
                 if name == 'a':
@@ -70,7 +72,7 @@ class FrameAPITestCase(TestBase):
                     argList.append("(%s)%s=%s" % (val.GetTypeName(),
                                                   val.GetName(),
                                                   val.GetValue()))
-                print >> session, "%s(%s)" % (name, ", ".join(argList))
+                print("%s(%s)" % (name, ", ".join(argList)), file=session)
                 
                 # Also check the generic pc & stack pointer.  We can't test their absolute values,
                 # but they should be valid.  Uses get_GPRs() from the lldbutil module.
@@ -84,7 +86,7 @@ class FrameAPITestCase(TestBase):
                 self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
                 self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
 
-            print >> session, "---"
+            print("---", file=session)
             process.Continue()
 
         # At this point, the inferior process should have exited.
@@ -97,8 +99,8 @@ class FrameAPITestCase(TestBase):
         #     o a((int)val=1, (char)ch='A')
         #     o a((int)val=3, (char)ch='A')
         if self.TraceOn():
-            print "Full stack traces when stopped on the breakpoint 'c':"
-            print session.getvalue()
+            print("Full stack traces when stopped on the breakpoint 'c':")
+            print(session.getvalue())
         self.expect(session.getvalue(), "Argugment values displayed correctly",
                     exe=False,
             substrs = ["a((int)val=1, (char)ch='A')",
@@ -116,7 +118,7 @@ class FrameAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -131,15 +133,15 @@ class FrameAPITestCase(TestBase):
         thread = process.GetThreadAtIndex(0)
         frame = thread.GetFrameAtIndex(0)
         if self.TraceOn():
-            print "frame:", frame
+            print("frame:", frame)
 
         # Boundary condition testings.
         val1 = frame.FindVariable(None, True)
         val2 = frame.FindVariable(None, False)
         val3 = frame.FindValue(None, lldb.eValueTypeVariableGlobal)
         if self.TraceOn():
-            print "val1:", val1
-            print "val2:", val2
+            print("val1:", val1)
+            print("val2:", val2)
 
         frame.EvaluateExpression(None)
 
@@ -155,7 +157,7 @@ class FrameAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -172,7 +174,7 @@ class FrameAPITestCase(TestBase):
 
         frameEntered = thread.GetFrameAtIndex(0)
         if self.TraceOn():
-            print frameEntered
+            print(frameEntered)
             lldbutil.print_stacktrace(thread)
         self.assertTrue(frameEntered)
 
@@ -182,7 +184,7 @@ class FrameAPITestCase(TestBase):
         self.assertTrue(thread)
         frameNow = thread.GetFrameAtIndex(0)
         if self.TraceOn():
-            print frameNow
+            print(frameNow)
             lldbutil.print_stacktrace(thread)
         self.assertTrue(frameNow)
 
@@ -193,7 +195,7 @@ class FrameAPITestCase(TestBase):
         thread.StepOutOfFrame(frameNow)
         frameOutOfC = thread.GetFrameAtIndex(0)
         if self.TraceOn():
-            print frameOutOfC
+            print(frameOutOfC)
             lldbutil.print_stacktrace(thread)
         self.assertTrue(frameOutOfC)
 
index e5e5391..1fc8606 100644 (file)
@@ -2,6 +2,8 @@
 Testlldb Python SBFrame APIs IsInlined() and GetFunctionName().
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -33,7 +35,7 @@ class InlinedFrameAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by the name of 'inner_inline'.
         breakpoint = target.BreakpointCreateByName('inner_inline', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() > 1,
                         VALID_BREAKPOINT)
@@ -48,8 +50,8 @@ class InlinedFrameAPITestCase(TestBase):
         import lldbutil
         stack_traces1 = lldbutil.print_stacktraces(process, string_buffer=True)
         if self.TraceOn():
-            print "Full stack traces when first stopped on the breakpoint 'inner_inline':"
-            print stack_traces1
+            print("Full stack traces when first stopped on the breakpoint 'inner_inline':")
+            print(stack_traces1)
 
         # The first breakpoint should correspond to an inlined call frame.
         # If it's an inlined call frame, expect to find, in the stack trace,
@@ -70,7 +72,7 @@ class InlinedFrameAPITestCase(TestBase):
                             PROCESS_STOPPED)
             stack_traces2 = lldbutil.print_stacktraces(process, string_buffer=True)
             if self.TraceOn():
-                print "Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:"
-                print stack_traces2
+                print("Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:")
+                print(stack_traces2)
                 self.expect(stack_traces2, "Second stop at %s:%d" % (self.source, self.second_stop), exe=False,
                             substrs = ['%s:%d' % (self.source, self.second_stop)])
index 4018b52..7f0dce1 100644 (file)
@@ -2,6 +2,8 @@
 Test retrieval of SBAddress from function/symbol, disassembly, and SBAddress APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -33,8 +35,8 @@ class DisasmAPITestCase(TestBase):
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
-        #print "breakpoint1:", breakpoint1
-        #print "breakpoint2:", breakpoint2
+        #print("breakpoint1:", breakpoint1)
+        #print("breakpoint2:", breakpoint2)
         self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -55,14 +57,14 @@ class DisasmAPITestCase(TestBase):
         self.assertTrue(lineEntry.GetLine() == self.line1)
 
         address1 = lineEntry.GetStartAddress()
-        #print "address1:", address1
+        #print("address1:", address1)
 
         # Now call SBTarget.ResolveSymbolContextForAddress() with address1.
         context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything)
 
         self.assertTrue(context1)
         if self.TraceOn():
-            print "context1:", context1
+            print("context1:", context1)
 
         # Continue the inferior, the breakpoint 2 should be hit.
         process.Continue()
@@ -80,24 +82,24 @@ class DisasmAPITestCase(TestBase):
 
         disasm_output = lldbutil.disassemble(target, symbol)
         if self.TraceOn():
-            print "symbol:", symbol
-            print "disassembly=>\n", disasm_output
+            print("symbol:", symbol)
+            print("disassembly=>\n", disasm_output)
 
         disasm_output = lldbutil.disassemble(target, function)
         if self.TraceOn():
-            print "function:", function
-            print "disassembly=>\n", disasm_output
+            print("function:", function)
+            print("disassembly=>\n", disasm_output)
 
         sa1 = symbol.GetStartAddress()
-        #print "sa1:", sa1
-        #print "sa1.GetFileAddress():", hex(sa1.GetFileAddress())
+        #print("sa1:", sa1)
+        #print("sa1.GetFileAddress():", hex(sa1.GetFileAddress()))
         #ea1 = symbol.GetEndAddress()
-        #print "ea1:", ea1
+        #print("ea1:", ea1)
         sa2 = function.GetStartAddress()
-        #print "sa2:", sa2
-        #print "sa2.GetFileAddress():", hex(sa2.GetFileAddress())
+        #print("sa2:", sa2)
+        #print("sa2.GetFileAddress():", hex(sa2.GetFileAddress()))
         #ea2 = function.GetEndAddress()
-        #print "ea2:", ea2
+        #print("ea2:", ea2)
         self.assertTrue(sa1 and sa2 and sa1 == sa2,
                         "The two starting addresses should be the same")
 
index 1d7a428..bb0a78a 100644 (file)
@@ -2,6 +2,8 @@
 Test newly added SBSymbol and SBAddress APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -34,8 +36,8 @@ class SymbolAPITestCase(TestBase):
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
-        #print "breakpoint1:", breakpoint1
-        #print "breakpoint2:", breakpoint2
+        #print("breakpoint1:", breakpoint1)
+        #print("breakpoint2:", breakpoint2)
         self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -74,5 +76,5 @@ class SymbolAPITestCase(TestBase):
 
         # Now verify that both addresses point to the same module.
         if self.TraceOn():
-            print "UUID:", addr_line1.GetModule().GetUUIDString()
+            print("UUID:", addr_line1.GetModule().GetUUIDString())
         self.assertTrue(addr_line1.GetModule().GetUUIDString() == addr_line2.GetModule().GetUUIDString())
index 1800dd0..5e8343e 100644 (file)
@@ -1,5 +1,7 @@
 """Test Python APIs for target (launch and attach), breakpoint, and process."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index 1f5171d..74baf11 100644 (file)
@@ -1,5 +1,7 @@
 """Test the SBCommandInterpreter APIs."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -56,7 +58,7 @@ class CommandInterpreterAPICase(TestBase):
         res.AppendMessage("Just appended a message.")
         res.AppendMessage(None)
         if self.TraceOn():
-            print res
+            print(res)
 
         process = ci.GetProcess()
         self.assertTrue(process)
index 2812136..90ceed2 100644 (file)
@@ -2,6 +2,8 @@
 Test utility functions for the frame object.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -53,5 +55,5 @@ class FrameUtilsTestCase(TestBase):
         self.assertTrue(frame0_args and parent_args and "(int)val=1" in frame0_args)
         if self.TraceOn():
             lldbutil.print_stacktrace(thread)
-            print "Current frame: %s" % frame0_args
-            print "Parent frame: %s" % parent_args
+            print("Current frame: %s" % frame0_args)
+            print("Parent frame: %s" % parent_args)
index c8ee37c..c8ab813 100644 (file)
@@ -2,6 +2,8 @@
 Test the iteration protocol for some lldb container objects.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -49,8 +51,8 @@ class LLDBIteratorTestCase(TestBase):
         self.assertTrue(len(yours) == len(mine))
         for i in range(len(yours)):
             if self.TraceOn():
-                print "yours[%d]='%s'" % (i, get_description(yours[i]))
-                print "mine[%d]='%s'" % (i, get_description(mine[i]))
+                print("yours[%d]='%s'" % (i, get_description(yours[i])))
+                print("mine[%d]='%s'" % (i, get_description(mine[i])))
             self.assertTrue(yours[i] == mine[i],
                             "UUID+FileSpec of yours[{0}] and mine[{0}] matches".format(i))
 
@@ -81,8 +83,8 @@ class LLDBIteratorTestCase(TestBase):
         self.assertTrue(len(yours) == len(mine))
         for i in range(len(yours)):
             if self.TraceOn():
-                print "yours[%d]='%s'" % (i, get_description(yours[i]))
-                print "mine[%d]='%s'" % (i, get_description(mine[i]))
+                print("yours[%d]='%s'" % (i, get_description(yours[i])))
+                print("mine[%d]='%s'" % (i, get_description(mine[i])))
             self.assertTrue(yours[i] == mine[i],
                             "ID of yours[{0}] and mine[{0}] matches".format(i))
 
@@ -115,6 +117,6 @@ class LLDBIteratorTestCase(TestBase):
             for frame in thread:
                 self.assertTrue(frame.GetThread().GetThreadID() == ID)
                 if self.TraceOn():
-                    print frame
+                    print(frame)
 
         self.assertTrue(stopped_due_to_breakpoint)
index 0a49bc2..43b5d9d 100644 (file)
@@ -2,6 +2,8 @@
 Test the iteration protocol for frame registers.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -44,35 +46,35 @@ class RegistersIteratorTestCase(TestBase):
                 for frame in thread:
                     # Dump the registers of this frame using lldbutil.get_GPRs() and friends.
                     if self.TraceOn():
-                        print frame
+                        print(frame)
 
                     REGs = lldbutil.get_GPRs(frame)
                     num = len(REGs)
                     if self.TraceOn():
-                        print "\nNumber of general purpose registers: %d" % num
+                        print("\nNumber of general purpose registers: %d" % num)
                     for reg in REGs:
                         self.assertTrue(reg)
                         if self.TraceOn():
-                            print "%s => %s" % (reg.GetName(), reg.GetValue())
+                            print("%s => %s" % (reg.GetName(), reg.GetValue()))
 
                     REGs = lldbutil.get_FPRs(frame)
                     num = len(REGs)
                     if self.TraceOn():
-                        print "\nNumber of floating point registers: %d" % num
+                        print("\nNumber of floating point registers: %d" % num)
                     for reg in REGs:
                         self.assertTrue(reg)
                         if self.TraceOn():
-                            print "%s => %s" % (reg.GetName(), reg.GetValue())
+                            print("%s => %s" % (reg.GetName(), reg.GetValue()))
 
                     REGs = lldbutil.get_ESRs(frame)
                     if self.platformIsDarwin():
                         num = len(REGs)
                         if self.TraceOn():
-                            print "\nNumber of exception state registers: %d" % num
+                            print("\nNumber of exception state registers: %d" % num)
                         for reg in REGs:
                             self.assertTrue(reg)
                             if self.TraceOn():
-                                print "%s => %s" % (reg.GetName(), reg.GetValue())
+                                print("%s => %s" % (reg.GetName(), reg.GetValue()))
                     else:
                         self.assertIsNone(REGs)
 
index 7319ce3..859cbdc 100644 (file)
@@ -2,6 +2,8 @@
 Test SBprocess and SBThread APIs with printing of the stack traces using lldbutil.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index d1a69f9..c89ff22 100644 (file)
@@ -2,6 +2,8 @@
 Test some SBModule and SBSection APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -28,31 +30,31 @@ class ModuleAndSectionAPIsTestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print "Number of modules for the target: %d" % target.GetNumModules()
+        print("Number of modules for the target: %d" % target.GetNumModules())
         for module in target.module_iter():
-            print module
+            print(module)
 
         # Get the executable module at index 0.
         exe_module = target.GetModuleAtIndex(0)
 
-        print "Exe module: %s" % str(exe_module)
-        print "Number of sections: %d" % exe_module.GetNumSections()
+        print("Exe module: %s" % str(exe_module))
+        print("Number of sections: %d" % exe_module.GetNumSections())
         INDENT = ' ' * 4
         INDENT2 = INDENT * 2
         for sec in exe_module.section_iter():
-            print sec
-            print INDENT + "Number of subsections: %d" % sec.GetNumSubSections()
+            print(sec)
+            print(INDENT + "Number of subsections: %d" % sec.GetNumSubSections())
             if sec.GetNumSubSections() == 0:
                 for sym in exe_module.symbol_in_section_iter(sec):
-                    print INDENT + str(sym)
-                    print INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType())
+                    print(INDENT + str(sym))
+                    print(INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType()))
             else:
                 for subsec in sec:
-                    print INDENT + str(subsec)
+                    print(INDENT + str(subsec))
                     # Now print the symbols belonging to the subsection....
                     for sym in exe_module.symbol_in_section_iter(subsec):
-                        print INDENT2 + str(sym)
-                        print INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType())
+                        print(INDENT2 + str(sym))
+                        print(INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType()))
 
     @python_api_test
     def test_module_and_section_boundary_condition(self):
@@ -68,15 +70,15 @@ class ModuleAndSectionAPIsTestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print "Number of modules for the target: %d" % target.GetNumModules()
+        print("Number of modules for the target: %d" % target.GetNumModules())
         for module in target.module_iter():
-            print module
+            print(module)
 
         # Get the executable module at index 0.
         exe_module = target.GetModuleAtIndex(0)
 
-        print "Exe module: %s" % str(exe_module)
-        print "Number of sections: %d" % exe_module.GetNumSections()
+        print("Exe module: %s" % str(exe_module))
+        print("Number of sections: %d" % exe_module.GetNumSections())
 
         # Boundary condition testings.  Should not crash lldb!
         exe_module.FindFirstType(None)
@@ -88,7 +90,7 @@ class ModuleAndSectionAPIsTestCase(TestBase):
         # Get the section at index 1.
         if exe_module.GetNumSections() > 1:
             sec1 = exe_module.GetSectionAtIndex(1)
-            print sec1
+            print(sec1)
         else:
             sec1 = None
 
@@ -109,16 +111,17 @@ class ModuleAndSectionAPIsTestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print "Number of modules for the target: %d" % target.GetNumModules()
+        print("Number of modules for the target: %d" % target.GetNumModules())
         for module in target.module_iter():
-            print module
+            print(module)
 
         # Get the executable module at index 0.
         exe_module = target.GetModuleAtIndex(0)
 
-        print "Exe module: %s" % str(exe_module)
-        print "Number of compile units: %d" % exe_module.GetNumCompileUnits()
+        print("Exe module: %s" % str(exe_module))
+        print("Number of compile units: %d" % exe_module.GetNumCompileUnits())
         INDENT = ' ' * 4
         INDENT2 = INDENT * 2
         for cu in exe_module.compile_unit_iter():
-            print cu
+            print(cu)
+
index ed34d43..d856463 100644 (file)
@@ -2,6 +2,8 @@
 Test SBType for ObjC classes.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 15a70d1..e75b78c 100644 (file)
@@ -2,6 +2,8 @@
 Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -50,7 +52,7 @@ class ProcessAPITestCase(TestBase):
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
         if self.TraceOn():
-            print "memory content:", content
+            print("memory content:", content)
 
         self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'x'",
                     exe=False,
@@ -63,7 +65,7 @@ class ProcessAPITestCase(TestBase):
         if not error.Success():
             self.fail("SBProcess.ReadCStringFromMemory() failed")
         if self.TraceOn():
-            print "cstring read is:", cstring
+            print("cstring read is:", cstring)
 
         self.expect(cstring, "Result from SBProcess.ReadCStringFromMemory() matches our expected output",
                     exe=False,
@@ -80,7 +82,7 @@ class ProcessAPITestCase(TestBase):
         if not error.Success():
             self.fail("SBProcess.ReadCStringFromMemory() failed")
         if self.TraceOn():
-            print "cstring read is:", cstring
+            print("cstring read is:", cstring)
 
         self.expect(cstring, "Result from SBProcess.ReadCStringFromMemory() matches our expected output",
                     exe=False,
@@ -97,7 +99,7 @@ class ProcessAPITestCase(TestBase):
         if not error.Success():
             self.fail("SBProcess.ReadCStringFromMemory() failed")
         if self.TraceOn():
-            print "uint32 read is:", my_uint32
+            print("uint32 read is:", my_uint32)
 
         if my_uint32 != 12345:
             self.fail("Result from SBProcess.ReadUnsignedFromMemory() does not match our expected output")
@@ -148,7 +150,7 @@ class ProcessAPITestCase(TestBase):
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
         if self.TraceOn():
-            print "memory content:", content
+            print("memory content:", content)
 
         self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'a'",
                     exe=False,
@@ -242,7 +244,7 @@ class ProcessAPITestCase(TestBase):
         # Dump the memory content....
         if self.TraceOn():
             for i in new_bytes:
-                print "byte:", i
+                print("byte:", i)
 
     @python_api_test
     def test_remote_launch(self):
@@ -257,7 +259,7 @@ class ProcessAPITestCase(TestBase):
         process = target.LaunchSimple (None, None, self.get_process_working_directory())
 
         if self.TraceOn():
-            print "process state:", state_type_to_str(process.GetState())
+            print("process state:", state_type_to_str(process.GetState()))
         self.assertTrue(process.GetState() != lldb.eStateConnected)
 
         error = lldb.SBError()
@@ -283,4 +285,5 @@ class ProcessAPITestCase(TestBase):
         error = lldb.SBError();
         num = process.GetNumSupportedHardwareWatchpoints(error)
         if self.TraceOn() and error.Success():
-            print "Number of supported hardware watchpoints: %d" % num
+            print("Number of supported hardware watchpoints: %d" % num)
+
index 1fce478..162003f 100644 (file)
@@ -1,5 +1,7 @@
 """Test Python APIs for process IO."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
@@ -164,7 +166,7 @@ class ProcessIOTestCase(TestBase):
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         if self.TraceOn():
-            print "process launched."
+            print("process launched.")
 
         # Frame #0 should be at our breakpoint.
         threads = lldbutil.get_threads_stopped_at_breakpoint (self.process, self.breakpoint)
@@ -175,7 +177,7 @@ class ProcessIOTestCase(TestBase):
         self.assertTrue(self.frame, "Frame 0 is valid.")
 
         if self.TraceOn():
-            print "process stopped at breakpoint, sending STDIN via LLDB API."
+            print("process stopped at breakpoint, sending STDIN via LLDB API.")
 
         # Write data to stdin via the public API if we were asked to
         if put_stdin:
@@ -193,8 +195,8 @@ class ProcessIOTestCase(TestBase):
             # once "input line=>1" appears in stdout.
             # See also main.c.
         if self.TraceOn():
-            print "output = '%s'" % output
-            print "error = '%s'" % error
+            print("output = '%s'" % output)
+            print("error = '%s'" % error)
         
         for line in self.lines:
             check_line = 'input line to stdout: %s' % (line)
index 1880dc2..5122a14 100644 (file)
@@ -2,6 +2,8 @@
 Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index beb9fd5..1e8f0e3 100644 (file)
@@ -1,5 +1,7 @@
 """Test the SBData APIs."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -41,16 +43,16 @@ class SBDataAPICase(TestBase):
 
         frame = thread.GetSelectedFrame()
         if self.TraceOn():
-            print frame
+            print(frame)
         foobar = frame.FindVariable('foobar')
         self.assertTrue(foobar.IsValid())
         if self.TraceOn():
-            print foobar
+            print(foobar)
 
         data = foobar.GetPointeeData(0, 2)
 
         if self.TraceOn():
-            print data
+            print(data)
 
         offset = 0
         error = lldb.SBError()
@@ -96,7 +98,7 @@ class SBDataAPICase(TestBase):
         data = star_foobar.GetData()
 
         if self.TraceOn():
-            print data
+            print(data)
         
         offset = 0
         self.assert_data(data.GetUnsignedInt32, offset, 1)
@@ -114,12 +116,12 @@ class SBDataAPICase(TestBase):
         new_foobar = foobar.CreateValueFromAddress("f00", foobar_addr, star_foobar.GetType())
         self.assertTrue(new_foobar.IsValid())
         if self.TraceOn():
-            print new_foobar
+            print(new_foobar)
         
         data = new_foobar.GetData()
 
         if self.TraceOn():
-            print data
+            print(data)
 
         self.assertTrue(data.uint32[0] == 8, 'then foo[1].a == 8')
         self.assertTrue(data.uint32[1] == 7, 'then foo[1].b == 7')
@@ -138,7 +140,7 @@ class SBDataAPICase(TestBase):
         data = new_foobar.GetData()
 
         if self.TraceOn():
-            print data
+            print(data)
 
         offset = 0
         self.assert_data(data.GetUnsignedInt32, offset, 8)
@@ -155,10 +157,10 @@ class SBDataAPICase(TestBase):
         data = barfoo.GetData()
 
         if self.TraceOn():
-            print barfoo
+            print(barfoo)
 
         if self.TraceOn():
-            print data
+            print(data)
 
         offset = 0
         self.assert_data(data.GetUnsignedInt32, offset, 1)
@@ -178,7 +180,7 @@ class SBDataAPICase(TestBase):
         new_object = barfoo.CreateValueFromData("new_object",data,barfoo.GetType().GetBasicType(lldb.eBasicTypeInt))
 
         if self.TraceOn():
-            print new_object
+            print(new_object)
         
         self.assertTrue(new_object.GetValue() == "1", 'new_object == 1')
 
@@ -192,7 +194,7 @@ class SBDataAPICase(TestBase):
         data.Append(data2)
         
         if self.TraceOn():
-            print data
+            print(data)
 
         # this breaks on EBCDIC
         offset = 0
index eca6f41..903eb8b 100644 (file)
@@ -1,5 +1,7 @@
 """Test SBValue::Persist"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index 7a6bc3a..8d7aef4 100755 (executable)
@@ -2,6 +2,8 @@
 Test SBSection APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 from lldbtest import *
index 7bea793..8ddbdf3 100644 (file)
@@ -2,6 +2,8 @@
 Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 5bca394..01509a9 100644 (file)
@@ -2,6 +2,8 @@
 Test SBSymbolContext APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -32,7 +34,7 @@ class SymbolContextAPITestCase(TestBase):
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        #print "breakpoint:", breakpoint
+        #print("breakpoint:", breakpoint)
         self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -64,14 +66,14 @@ class SymbolContextAPITestCase(TestBase):
 
         function = context.GetFunction()
         self.assertTrue(function)
-        #print "function:", function
+        #print("function:", function)
 
         block = context.GetBlock()
         self.assertTrue(block)
-        #print "block:", block
+        #print("block:", block)
 
         lineEntry = context.GetLineEntry()
-        #print "line entry:", lineEntry
+        #print("line entry:", lineEntry)
         self.expect(lineEntry.GetFileSpec().GetDirectory(), "The line entry should have the correct directory",
                     exe=False,
             substrs = [self.mydir])
index e61d82d..eadae1d 100644 (file)
@@ -2,6 +2,8 @@
 Test SBTarget APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -308,8 +310,8 @@ class TargetAPITestCase(TestBase):
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
-        #print "breakpoint1:", breakpoint1
-        #print "breakpoint2:", breakpoint2
+        #print("breakpoint1:", breakpoint1)
+        #print("breakpoint2:", breakpoint2)
         self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
@@ -344,23 +346,23 @@ class TargetAPITestCase(TestBase):
 
         address2 = lineEntry.GetStartAddress()
 
-        #print "address1:", address1
-        #print "address2:", address2
+        #print("address1:", address1)
+        #print("address2:", address2)
 
         # Now call SBTarget.ResolveSymbolContextForAddress() with the addresses from our line entry.
         context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything)
         context2 = target.ResolveSymbolContextForAddress(address2, lldb.eSymbolContextEverything)
 
         self.assertTrue(context1 and context2)
-        #print "context1:", context1
-        #print "context2:", context2
+        #print("context1:", context1)
+        #print("context2:", context2)
 
         # Verify that the context point to the same function 'a'.
         symbol1 = context1.GetSymbol()
         symbol2 = context2.GetSymbol()
         self.assertTrue(symbol1 and symbol2)
-        #print "symbol1:", symbol1
-        #print "symbol2:", symbol2
+        #print("symbol1:", symbol1)
+        #print("symbol2:", symbol2)
 
         from lldbutil import get_description
         desc1 = get_description(symbol1)
index 2fea893..4d8e9b4 100644 (file)
@@ -2,6 +2,8 @@
 Test SBThread APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -85,7 +87,7 @@ class ThreadAPITestCase(TestBase):
         self.runCmd("process status")
 
         proc_of_thread = thread.GetProcess()
-        #print "proc_of_thread:", proc_of_thread
+        #print("proc_of_thread:", proc_of_thread)
         self.assertTrue(proc_of_thread.GetProcessID() == process.GetProcessID())
 
     def get_stop_description(self):
@@ -224,8 +226,8 @@ class ThreadAPITestCase(TestBase):
         start_addr = lineEntry.GetStartAddress().GetLoadAddress(target)
         end_addr = lineEntry.GetEndAddress().GetLoadAddress(target)
         if self.TraceOn():
-            print "start addr:", hex(start_addr)
-            print "end addr:", hex(end_addr)
+            print("start addr:", hex(start_addr))
+            print("end addr:", hex(end_addr))
 
         # Disable the breakpoint.
         self.assertTrue(target.DisableAllBreakpoints())
index 4be01a2..27683c1 100644 (file)
@@ -2,6 +2,8 @@
 Test SBType and SBTypeList API.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -51,7 +53,7 @@ class TypeAndTypeListTestCase(TestBase):
         # Get the type 'Task'.
         type_list = target.FindTypes('Task')
         if self.TraceOn():
-            print "Size of type_list from target.FindTypes('Task') query: %d" % type_list.GetSize()
+            print("Size of type_list from target.FindTypes('Task') query: %d" % type_list.GetSize())
         self.assertTrue(len(type_list) >= 1) # a second Task make be scared up by the Objective-C runtime
         for type in type_list:
             self.assertTrue(type)
index e6d8825..2681350 100644 (file)
@@ -2,6 +2,8 @@
 Test some SBValue APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -73,10 +75,10 @@ class ValueAPITestCase(TestBase):
         cvf = lldbutil.ChildVisitingFormatter(indent_child=2)
         rdf = lldbutil.RecursiveDecentFormatter(indent_child=2)
         if self.TraceOn():
-            print fmt.format(days_of_week)
-            print cvf.format(days_of_week)
-            print cvf.format(weekdays)
-            print rdf.format(g_table)
+            print(fmt.format(days_of_week))
+            print(cvf.format(days_of_week))
+            print(cvf.format(weekdays))
+            print(rdf.format(g_table))
 
         # Get variable 'my_int_ptr'.
         value = frame0.FindVariable('my_int_ptr')
index 0b326b9..452cc63 100644 (file)
@@ -2,6 +2,8 @@
 Test some SBValue APIs.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
index 8270ed8..4c3a9b0 100644 (file)
@@ -3,6 +3,8 @@ Test SBValue API linked_list_iter which treats the SBValue as a linked list and
 supports iteration till the end of list is reached.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -63,12 +65,12 @@ class ValueAsLinkedListTestCase(TestBase):
             # Make sure that 'next' corresponds to an SBValue with pointer type.
             self.assertTrue(t.TypeIsPointerType())
             if self.TraceOn():
-                print cvf.format(t)
+                print(cvf.format(t))
             list.append(int(t.GetChildMemberWithName("id").GetValue()))
 
         # Sanity checks that the we visited all the items (no more, no less).
         if self.TraceOn():
-            print "visited IDs:", list
+            print("visited IDs:", list)
         self.assertTrue(visitedIDs == list)
 
         # Let's exercise the linked_list_iter() API again, this time supplying
@@ -93,12 +95,12 @@ class ValueAsLinkedListTestCase(TestBase):
             # Make sure that 'next' corresponds to an SBValue with pointer type.
             self.assertTrue(t.TypeIsPointerType())
             if self.TraceOn():
-                print cvf.format(t)
+                print(cvf.format(t))
             list.append(int(t.GetChildMemberWithName("id").GetValue()))
 
         # Sanity checks that the we visited all the items (no more, no less).
         if self.TraceOn():
-            print "visited IDs:", list
+            print("visited IDs:", list)
         self.assertTrue(visitedIDs == list)
         
         # Get variable 'empty_task_head'.
@@ -110,7 +112,7 @@ class ValueAsLinkedListTestCase(TestBase):
         # There is no iterable item from empty_task_head.linked_list_iter().
         for t in empty_task_head.linked_list_iter('next', eol):
             if self.TraceOn():
-                print cvf.format(t)
+                print(cvf.format(t))
             list.append(int(t.GetChildMemberWithName("id").GetValue()))
 
         self.assertTrue(len(list) == 0)
@@ -124,7 +126,7 @@ class ValueAsLinkedListTestCase(TestBase):
         # There 3 iterable items from task_evil.linked_list_iter(). :-)
         for t in task_evil.linked_list_iter('next'):
             if self.TraceOn():
-                print cvf.format(t)
+                print(cvf.format(t))
             list.append(int(t.GetChildMemberWithName("id").GetValue()))
 
         self.assertTrue(len(list) == 3)
index 9c0123e..87e0ccd 100644 (file)
@@ -1,5 +1,7 @@
 """Test SBValue::GetValueDidChange"""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, sys, time
index 242b199..5554ff0 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python SBValue API to create a watchpoint for read_write of 'globl' var.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -61,7 +63,7 @@ class SetWatchpointAPITestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print watchpoint
+        print(watchpoint)
 
         # Continue.  Expect the program to stop due to the variable being written to.
         process.Continue()
index f8ae2a2..95dad36 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python SBWatchpoint API to set the ignore count.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -68,12 +70,12 @@ class WatchpointIgnoreCountTestCase(TestBase):
         self.assertTrue(watchpoint.GetIgnoreCount() == 0)
         watch_id = watchpoint.GetID()
         self.assertTrue(watch_id != 0)
-        print watchpoint
+        print(watchpoint)
 
         # Now immediately set the ignore count to 2.  When we continue, expect the
         # inferior to run to its completion without stopping due to watchpoint.
         watchpoint.SetIgnoreCount(2)
-        print watchpoint
+        print(watchpoint)
         process.Continue()
 
         # At this point, the inferior process should have exited.
@@ -83,4 +85,4 @@ class WatchpointIgnoreCountTestCase(TestBase):
         self.assertTrue(watchpoint)
         self.assertTrue(watchpoint.GetWatchSize() == 4)
         self.assertTrue(watchpoint.GetHitCount() == 2)
-        print watchpoint
+        print(watchpoint)
index 0ba73c0..4ce2c0d 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python SBTarget API to iterate on the watchpoint(s) for the target.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -84,11 +86,11 @@ class WatchpointIteratorTestCase(TestBase):
         # We currently only support hardware watchpoint.  Verify that we have a
         # meaningful hardware index at this point.  Exercise the printed repr of
         # SBWatchpointLocation.
-        print watchpoint
+        print(watchpoint)
         self.assertTrue(watchpoint.GetHardwareIndex() != -1)
 
         # SBWatchpoint.GetDescription() takes a description level arg.
-        print lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull)
+        print(lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull))
 
         # Now disable the 'rw' watchpoint.  The program won't stop when it reads
         # 'global' next.
@@ -108,4 +110,5 @@ class WatchpointIteratorTestCase(TestBase):
             self.assertTrue(watchpoint)
             self.assertTrue(watchpoint.GetWatchSize() == 4)
             self.assertTrue(watchpoint.GetHitCount() == 1)
-            print watchpoint
+            print(watchpoint)
+
index dd7c799..582e60e 100644 (file)
@@ -2,6 +2,8 @@
 Test watchpoint condition API.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -71,7 +73,7 @@ class WatchpointConditionAPITestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print watchpoint
+        print(watchpoint)
 
         # Continue.  Expect the program to stop due to the variable being written to.
         process.Continue()
index 51a8955..3ce2445 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python SBValue.WatchPointee() API to create a watchpoint for write of '*g_char_ptr'.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -68,7 +70,7 @@ class SetWatchlocationAPITestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print watchpoint
+        print(watchpoint)
 
         # Continue.  Expect the program to stop due to the variable being written to.
         process.Continue()
index d6a3ca6..884989f 100644 (file)
@@ -2,6 +2,8 @@
 Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of '*g_char_ptr'.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time
@@ -68,7 +70,7 @@ class TargetWatchAddressAPITestCase(TestBase):
         if not self.TraceOn():
             self.HideStdout()
 
-        print watchpoint
+        print(watchpoint)
 
         # Continue.  Expect the program to stop due to the variable being written to.
         process.Continue()
index 65dcaa8..e4eba8b 100755 (executable)
@@ -90,7 +90,7 @@ def redo(suffix, dir, names):
 
     for name in names:
         if name.endswith(suffix):
-            #print "Find a log file:", name
+            #print("Find a log file:", name)
             if name.startswith("Error") or name.startswith("Failure"):
                 if filename_components:
                     if not all([comp in name for comp in filename_components]):
@@ -166,7 +166,7 @@ def main():
             print("No default session directory found, please specify it explicitly.")
             usage()
 
-    #print "The test directory:", test_dir
+    #print("The test directory:", test_dir)
     session_dir_path = where(session_dir, test_dir)
 
     print("Using session dir path:", session_dir_path)
index a20a903..c48ef7b 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb settings command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, re
index 7ef861d..1c1bb8f 100644 (file)
@@ -2,6 +2,8 @@
 Test quoting of arguments to lldb commands
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time, re
index ea6499e..9beaace 100644 (file)
@@ -9,6 +9,8 @@ o test_modify_source_file_while_debugging:
   Test the caching mechanism of the source manager.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
@@ -135,24 +137,24 @@ class SourceManagerTestCase(TestBase):
         with open('main.c', 'r') as f:
             original_content = f.read()
             if self.TraceOn():
-                print "original content:", original_content
+                print("original content:", original_content)
 
         # Modify the in-memory copy of the original source code.
         new_content = original_content.replace('Hello world', 'Hello lldb', 1)
 
         # This is the function to restore the original content.
         def restore_file():
-            #print "os.path.getmtime() before restore:", os.path.getmtime('main.c')
+            #print("os.path.getmtime() before restore:", os.path.getmtime('main.c'))
             time.sleep(1)
             with open('main.c', 'wb') as f:
                 f.write(original_content)
             if self.TraceOn():
                 with open('main.c', 'r') as f:
-                    print "content restored to:", f.read()
+                    print("content restored to:", f.read())
             # Touch the file just to be sure.
             os.utime('main.c', None)
             if self.TraceOn():
-                print "os.path.getmtime() after restore:", os.path.getmtime('main.c')
+                print("os.path.getmtime() after restore:", os.path.getmtime('main.c'))
 
 
 
@@ -161,8 +163,8 @@ class SourceManagerTestCase(TestBase):
             time.sleep(1)
             f.write(new_content)
             if self.TraceOn():
-                print "new content:", new_content
-                print "os.path.getmtime() after writing new content:", os.path.getmtime('main.c')
+                print("new content:", new_content)
+                print("os.path.getmtime() after writing new content:", os.path.getmtime('main.c'))
             # Add teardown hook to restore the file to the original content.
             self.addTearDownHook(restore_file)
 
index 49e91cf..f477577 100644 (file)
@@ -2,6 +2,8 @@
 Test that 'stty -a' displays the same output before and after running the lldb command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -89,30 +91,30 @@ class CommandLineCompletionTestCase(TestBase):
 
         with open('child_send1.txt', 'r') as fs:
             if self.TraceOn():
-                print "\n\nContents of child_send1.txt:"
-                print fs.read()
+                print("\n\nContents of child_send1.txt:")
+                print(fs.read())
         with open('child_read1.txt', 'r') as fr:
             from_child1 = fr.read()
             if self.TraceOn():
-                print "\n\nContents of child_read1.txt:"
-                print from_child1
+                print("\n\nContents of child_read1.txt:")
+                print(from_child1)
 
         with open('child_send2.txt', 'r') as fs:
             if self.TraceOn():
-                print "\n\nContents of child_send2.txt:"
-                print fs.read()
+                print("\n\nContents of child_send2.txt:")
+                print(fs.read())
         with open('child_read2.txt', 'r') as fr:
             from_child2 = fr.read()
             if self.TraceOn():
-                print "\n\nContents of child_read2.txt:"
-                print from_child2
+                print("\n\nContents of child_read2.txt:")
+                print(from_child2)
 
         stty_output1_lines = from_child1.splitlines()
         stty_output2_lines = from_child2.splitlines()
         zipped = zip(stty_output1_lines, stty_output2_lines)
         for tuple in zipped:
             if self.TraceOn():
-                print "tuple->%s" % str(tuple)
+                print("tuple->%s" % str(tuple))
             # Every line should compare equal until the first blank line.
             if len(tuple[0]) == 0:
                 break
index e42496f..f35d34c 100644 (file)
@@ -8,6 +8,8 @@ Provides classes used by the test results reporting infrastructure
 within the LLDB test suite.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import argparse
index 925ad6d..4207bac 100644 (file)
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 """Inferior program used by process control tests."""
+
+from __future__ import print_function
+
 import argparse
 import datetime
 import signal
@@ -67,7 +70,7 @@ def handle_ignore_signals(options, signals):
 
     for signum in signals:
         if options.verbose:
-            print "disabling signum {}".format(signum)
+            print("disabling signum {}".format(signum))
         signal.signal(signum, signal.SIG_IGN)
 
 
@@ -88,7 +91,7 @@ def handle_sleep(options, sleep_seconds):
 
     end_time = datetime.datetime.now() + datetime.timedelta(0, sleep_seconds)
     if options.verbose:
-        print "sleep end time: {}".format(end_time)
+        print("sleep end time: {}".format(end_time))
 
     # Do sleep in a loop: signals can interrupt.
     while datetime.datetime.now() < end_time:
index 3d0463d..2df106f 100644 (file)
@@ -2,6 +2,8 @@
 Test that the lldb-mi driver exits properly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 01f9dc6..f73ed26 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -file-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 45aff71..341ff8e 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -gdb-set and -gdb-show commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index 8413986..03a3f34 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi =library-loaded notifications.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 6f4bb76..63eae64 100644 (file)
@@ -2,6 +2,8 @@
 Test that the lldb-mi driver prints prompt properly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index c08e92e..f482f5a 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -break-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index a17fd66..8b54ec7 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -exec-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 42efeed..d6e440a 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -data-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
index b28c055..6a4a6e8 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi can interpret CLI commands directly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 86eb8ff..45151ef 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -interpreter-exec command.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index e29864a..82c49ba 100644 (file)
@@ -2,6 +2,8 @@
 Base class for lldb-mi test cases.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 from lldbtest import *
@@ -24,9 +26,9 @@ class MiTestCaseBase(Base):
 
     def tearDown(self):
         if self.TraceOn():
-            print "\n\nContents of %s:" % self.mylog
+            print("\n\nContents of %s:" % self.mylog)
             try:
-                print open(self.mylog, "r").read()
+                print(open(self.mylog, "r").read())
             except IOError:
                 pass
         Base.tearDown(self)
index 22f05c3..90cea88 100644 (file)
@@ -2,6 +2,8 @@
 Test that the lldb-mi handles signals properly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index f4ebf30..34dceb4 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -stack-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 8f34119..6137b5c 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi startup options.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 6b0fe28..47e4ace 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -symbol-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 96ff107..b3a501c 100644 (file)
@@ -2,6 +2,8 @@
 Test that the lldb-mi driver understands MI command syntax.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 0166c8d..66b2c78 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -target-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 177ddae..59cb66d 100644 (file)
@@ -3,6 +3,8 @@
 Test lldb-mi -gdb-set and -gdb-show commands for 'print option-name'.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index d1d3bdc..093b85c 100644 (file)
@@ -2,6 +2,8 @@
 Test lldb-mi -var-xxx commands.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldbmi_testcase
index 33a6832..0980b45 100644 (file)
@@ -2,6 +2,8 @@
 Tests the binary ($x) and hex ($m) memory read packets of the remote stub
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
index 797814b..b0e1e3f 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
index 782a3d7..a552536 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
@@ -99,7 +101,7 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
 
         # Ensure auxv data is a multiple of 2*word_size (there should be two unsigned long fields per auxv entry).
         self.assertEquals(len(auxv_data) % (2*word_size), 0)
-        # print "auxv contains {} entries".format(len(auxv_data) / (2*word_size))
+        # print("auxv contains {} entries".format(len(auxv_data) / (2*word_size)))
 
     @debugserver_test
     def test_auxv_data_is_correct_size_debugserver(self):
@@ -137,7 +139,7 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
         for auxv_key in auxv_dict:
             self.assertTrue(auxv_key >= 1)
             self.assertTrue(auxv_key <= 1000)
-        # print "auxv dict: {}".format(auxv_dict)
+        # print("auxv dict: {}".format(auxv_dict))
 
     @debugserver_test
     def test_auxv_keys_look_valid_debugserver(self):
index 9218dbf..f43b4a1 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
@@ -46,7 +48,7 @@ class TestGdbRemoteExpeditedRegisters(gdbremote_testcase.GdbRemoteTestCaseBase):
 
         # Ensure the expedited registers contained it.
         self.assertTrue(reg_info["lldb_register_index"] in expedited_registers)
-        # print "{} reg_info:{}".format(generic_register_name, reg_info)
+        # print("{} reg_info:{}".format(generic_register_name, reg_info))
 
     def stop_notification_contains_any_registers(self):
         # Generate a stop reply, parse out expedited registers from stop notification.
index f4de5a0..2bfe3df 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
index f2d44ca..7bc328e 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
@@ -50,7 +52,7 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):
             self.assertIsNotNone(threads)
             thread_id = threads[0]
             self.assertIsNotNone(thread_id)
-            # print "Running on thread: 0x{:x}".format(thread_id)
+            # print("Running on thread: 0x{:x}".format(thread_id))
         else:
             thread_id = None
 
@@ -64,19 +66,19 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):
         (success, state_id) = self.parse_QSaveRegisterState_response(context)
         self.assertTrue(success)
         self.assertIsNotNone(state_id)
-        # print "saved register state id: {}".format(state_id)
+        # print("saved register state id: {}".format(state_id))
 
         # Remember initial register values.
         initial_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id)
-        # print "initial_reg_values: {}".format(initial_reg_values)
+        # print("initial_reg_values: {}".format(initial_reg_values))
 
         # Flip gpr register values.
         (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(gpr_reg_infos, endian, thread_id=thread_id)
-        # print "successful writes: {}, failed writes: {}".format(successful_writes, failed_writes)
+        # print("successful writes: {}, failed writes: {}".format(successful_writes, failed_writes))
         self.assertTrue(successful_writes > 0)
 
         flipped_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id)
-        # print "flipped_reg_values: {}".format(flipped_reg_values)
+        # print("flipped_reg_values: {}".format(flipped_reg_values))
 
         # Restore register values.
         self.reset_test_sequence()
@@ -87,7 +89,7 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):
 
         # Verify registers match initial register values.
         final_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id)
-        # print "final_reg_values: {}".format(final_reg_values)
+        # print("final_reg_values: {}".format(final_reg_values))
         self.assertIsNotNone(final_reg_values)
         self.assertEquals(final_reg_values, initial_reg_values)
 
index 370d945..48189b3 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import lldb_shared
 
 import gdbremote_testcase
index 9d8f418..a314f16 100644 (file)
@@ -10,6 +10,8 @@ gdb remote packet functional areas.  For now it contains
 the initial set of tests implemented.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import unittest2
@@ -1343,7 +1345,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
 
         # Write flipped bit pattern of existing value to each register.
         (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(gpr_reg_infos, endian)
-        # print "successful writes: {}, failed writes: {}".format(successful_writes, failed_writes)
+        # print("successful writes: {}, failed writes: {}".format(successful_writes, failed_writes))
         self.assertTrue(successful_writes > 0)
 
     # Note: as of this moment, a hefty number of the GPR writes are failing with E32 (everything except rax-rdx, rdi, rsi, rbp).
index 34850c7..f37da8f 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 import gdbremote_testcase
 import lldbgdbserverutils
 import re
@@ -63,7 +65,7 @@ class TestStubReverseConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
         (stub_socket, address) = self.listener_socket.accept()
         self.assertIsNotNone(stub_socket)
         self.assertIsNotNone(address)
-        print "connected to stub {} on {}".format(address, stub_socket.getsockname())
+        print("connected to stub {} on {}".format(address, stub_socket.getsockname()))
 
         # Verify we can do the handshake.  If that works, we'll call it good.
         self.do_handshake(stub_socket, timeout_seconds=self._DEFAULT_TIMEOUT)
index 91f36c0..22e0bc8 100644 (file)
@@ -2,6 +2,8 @@
 Base class for gdb-remote test cases.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import errno
@@ -98,21 +100,21 @@ class GdbRemoteTestCaseBase(TestBase):
             try:
                 named_pipe.close()
             except:
-                print "failed to close named pipe"
+                print("failed to close named pipe")
                 None
 
             # Delete the pipe.
             try:
                 os.remove(named_pipe_path)
             except:
-                print "failed to delete named pipe: {}".format(named_pipe_path)
+                print("failed to delete named pipe: {}".format(named_pipe_path))
                 None
 
             # Delete the temp directory.
             try:
                 os.rmdir(temp_dir)
             except:
-                print "failed to delete temp dir: {}, directory contents: '{}'".format(temp_dir, os.listdir(temp_dir))
+                print("failed to delete temp dir: {}, directory contents: '{}'".format(temp_dir, os.listdir(temp_dir)))
                 None
 
         # Add the shutdown hook to clean up the named pipe.
@@ -1005,7 +1007,7 @@ class GdbRemoteTestCaseBase(TestBase):
             # Flip the value by xoring with all 1s
             all_one_bits_raw = "ff" * (int(reg_info["bitsize"]) / 8)
             flipped_bits_int = initial_reg_value ^ int(all_one_bits_raw, 16)
-            # print "reg (index={}, name={}): val={}, flipped bits (int={}, hex={:x})".format(reg_index, reg_info["name"], initial_reg_value, flipped_bits_int, flipped_bits_int)
+            # print("reg (index={}, name={}): val={}, flipped bits (int={}, hex={:x})".format(reg_index, reg_info["name"], initial_reg_value, flipped_bits_int, flipped_bits_int))
 
             # Handle thread suffix for P.
             if thread_id:
@@ -1031,7 +1033,7 @@ class GdbRemoteTestCaseBase(TestBase):
                 successful_writes += 1
             else:
                 failed_writes += 1
-                # print "reg (index={}, name={}) write FAILED (error: {})".format(reg_index, reg_info["name"], P_response)
+                # print("reg (index={}, name={}) write FAILED (error: {})".format(reg_index, reg_info["name"], P_response))
 
             # Read back the register value, ensure it matches the flipped value.
             if P_response == "OK":
@@ -1049,7 +1051,7 @@ class GdbRemoteTestCaseBase(TestBase):
 
                 if verify_bits != flipped_bits_int:
                     # Some registers, like mxcsrmask and others, will permute what's written.  Adjust succeed/fail counts.
-                    # print "reg (index={}, name={}): read verify FAILED: wrote {:x}, verify read back {:x}".format(reg_index, reg_info["name"], flipped_bits_int, verify_bits)
+                    # print("reg (index={}, name={}): read verify FAILED: wrote {:x}, verify read back {:x}".format(reg_index, reg_info["name"], flipped_bits_int, verify_bits))
                     successful_writes -= 1
                     failed_writes +=1
 
@@ -1134,7 +1136,7 @@ class GdbRemoteTestCaseBase(TestBase):
 
             # Build the packet for the single step instruction.  We replace {thread}, if present, with the thread_id.
             step_packet = "read packet: ${}#00".format(re.sub(r"{thread}", "{:x}".format(thread_id), step_instruction))
-            # print "\nstep_packet created: {}\n".format(step_packet)
+            # print("\nstep_packet created: {}\n".format(step_packet))
 
             # Single step.
             self.reset_test_sequence()
index 1d4f40d..eb38891 100644 (file)
@@ -1,6 +1,8 @@
 """Module for supporting unit testing of the lldb-server debug monitor exe.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os
@@ -701,12 +703,12 @@ class MatchRemoteOutputEntry(GdbRemoteEntryBase):
 
         # If we don't match, wait to try again after next $O content, or time out.
         if not match:
-            # print "re pattern \"{}\" did not match against \"{}\"".format(self._regex.pattern, accumulated_output)
+            # print("re pattern \"{}\" did not match against \"{}\"".format(self._regex.pattern, accumulated_output))
             return context
 
         # We do match.
         self._matched = True
-        # print "re pattern \"{}\" matched against \"{}\"".format(self._regex.pattern, accumulated_output)
+        # print("re pattern \"{}\" matched against \"{}\"".format(self._regex.pattern, accumulated_output))
 
         # Collect up any captures into the context.
         if self._capture:
@@ -835,6 +837,6 @@ def process_is_running(pid, unknown_value=True):
 if __name__ == '__main__':
     EXE_PATH = get_lldb_server_exe()
     if EXE_PATH:
-        print "lldb-server path detected: {}".format(EXE_PATH)
+        print("lldb-server path detected: {}".format(EXE_PATH))
     else:
-        print "lldb-server could not be found"
+        print("lldb-server could not be found")
index 780ff09..a6f42ed 100644 (file)
@@ -1,4 +1,6 @@
 
+from __future__ import print_function
+
 import lldb_shared
 
 import re
@@ -21,8 +23,8 @@ def _handle_output_packet_string(packet_contents):
 
 def _dump_queue(the_queue):
     while not the_queue.empty():
-        print codecs.encode(the_queue.get(True), "string_escape")
-        print "\n"
+        print(codecs.encode(the_queue.get(True), "string_escape"))
+        print("\n")
 
 class SocketPacketPump(object):
     """A threaded packet reader that partitions packets into two streams.
@@ -67,15 +69,15 @@ class SocketPacketPump(object):
         # Warn if there is any content left in any of the queues.
         # That would represent unmatched packets.
         if not self.output_queue().empty():
-            print "warning: output queue entries still exist:"
+            print("warning: output queue entries still exist:")
             _dump_queue(self.output_queue())
-            print "from here:"
+            print("from here:")
             traceback.print_stack()
 
         if not self.packet_queue().empty():
-            print "warning: packet queue entries still exist:"
+            print("warning: packet queue entries still exist:")
             _dump_queue(self.packet_queue())
-            print "from here:"
+            print("from here:")
             traceback.print_stack()
 
     def start_pump_thread(self):
index a4dc1a8..7b78fd7 100644 (file)
@@ -2,6 +2,8 @@
 Abstract base class of basic types provides a generic type tester method.
 """
 
+from __future__ import print_function
+
 import os, time
 import re
 import lldb
@@ -33,7 +35,7 @@ class GenericTester(TestBase):
 
     def tearDown(self):
         """Cleanup the test byproducts."""
-        #print "Removing golden-output.txt..."
+        #print("Removing golden-output.txt...")
         if os.path.exists(self.golden_filename):
             os.remove(self.golden_filename)
         TestBase.tearDown(self)
@@ -117,7 +119,7 @@ class GenericTester(TestBase):
             if match:
                 var, val = match.group(1), match.group(2)
                 gl.append((var, val))
-        #print "golden list:", gl
+        #print("golden list:", gl)
 
         # This test uses a #include of "basic_type.cpp" so we need to enable
         # always setting inlined breakpoints.
@@ -201,7 +203,7 @@ class GenericTester(TestBase):
             if match:
                 var, val = match.group(1), match.group(2)
                 gl.append((var, val))
-        #print "golden list:", gl
+        #print("golden list:", gl)
 
         # This test uses a #include of "basic_type.cpp" so we need to enable
         # always setting inlined breakpoints.
index 1c2e6ca..e08172d 100644 (file)
@@ -2,6 +2,8 @@
 Test that variables of integer basic types are displayed correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import AbstractBase
index fcac507..6b519c1 100644 (file)
@@ -2,6 +2,8 @@
 Test that variables of floating point types are displayed correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import AbstractBase
index 52ba347..5d74b42 100644 (file)
@@ -2,6 +2,8 @@
 Test that variable expressions of floating point types are evaluated correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import AbstractBase
index d592f39..bb26e88 100644 (file)
@@ -2,6 +2,8 @@
 Test that variables of integer basic types are displayed correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import AbstractBase
index a252ca8..5feb34d 100644 (file)
@@ -2,6 +2,8 @@
 Test that variable expressions of integer basic types are evaluated correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import AbstractBase
index f115c9b..34846ba 100644 (file)
@@ -2,6 +2,8 @@
 Test that recursive types are handled correctly.
 """
 
+from __future__ import print_function
+
 import lldb_shared
 
 import lldb
index 7ea233a..b474b60 100644 (file)
@@ -1,5 +1,7 @@
 """Test that the 'add-dsym', aka 'target symbols add', command informs the user about success or failure."""
 
+from __future__ import print_function
+
 import lldb_shared
 
 import os, time