Verify the default cache line size for android targets
"""
+from __future__ import print_function
+
import lldb_shared
import os
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
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))
"""Test the lldb public C++ api when doing multiple debug sessions simultaneously."""
+from __future__ import print_function
+
import lldb_shared
import os, re
# 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:
"""Test the lldb public C++ api breakpoint callbacks."""
+from __future__ import print_function
+
import lldb_shared
import os, re
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:
Test some ARM instruction emulation.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.')
#!/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"
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)
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()
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()
class SanityCheckTestCase(LLDBTestCase):
def runTest(self):
ret = self.runCommand("show arch", "show-arch")
- #print ret
+ #print(ret)
def getCategories(self):
return []
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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))
"""Disassemble lldb's Driver::MainLoop() functions comparing lldb against gdb."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
@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
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):
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
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
@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)
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")
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
"""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
@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
pass
if self.TraceOn():
- print "gdb disassembly benchmark:", str(self.stopwatch)
+ print("gdb disassembly benchmark:", str(self.stopwatch))
self.child = None
"""Test lldb's expression evaluations and collect statistics."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
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
"""Test evaluating expressions repeatedly comparing lldb against gdb."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
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
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):
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
"""Test lldb's response time for 'frame variable' command."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
@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
"""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
@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
"""Test lldb's stepping speed."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
@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
"""Test lldb's stepping speed."""
+from __future__ import print_function
+
import lldb_shared
import os, sys
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
"""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
@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
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))))
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
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):
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 = []
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:
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.
# 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
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:
framework.
"""
+from __future__ import print_function
+
import lldb_shared
import asyncore
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.
data = self.consume_payload_bytes(data)
def handle_close(self):
- # print "socket reader: closing port"
+ # print("socket reader: closing port")
self.close()
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)
Test that the lldb driver's batch mode works correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test calling std::String member functions.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
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
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
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
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
+from __future__ import print_function
+
import lldb_shared
import lldb
"""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
Test using LLDB data formatters with frozen objects coming from the expression parser.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
expected in a SyntheticChildrenProvider
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test expression command options.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that we can p *objcObject
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test that we can have persistent pointer variables
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test that nested persistent types work.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that lldb persistent types works correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that lldb persistent variables works correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that the po command acts correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test the robustness of lldb expression parser.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
The evaluating printf(...) after break stop and then up a stack frame.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test example snippets from the lldb 'help expression' output.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Throw some expression commands with quotes at lldb.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test some more expression commands.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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
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
Test some lldb command abbreviations and aliases for proper resolution.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.
many commands remain available even after we add/delete commands in the future.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test breaking inside functions defined within a BSD archive file libfoo.a."""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that ASan memory history provider returns correct stack traces
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test the AddressSanitizer runtime support for report breakpoint and data extraction.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test process attach/resume.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test whether a process started by lldb has no extra file descriptors open.
"""
+from __future__ import print_function
+
import lldb_shared
import os
Test that backticks without a target should work (not infinite looping).
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb breakpoint command add/list/delete.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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.
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:",
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.
Test that you can set breakpoint commands successfully with the Python API's:
"""
+from __future__ import print_function
+
import lldb_shared
import os
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":
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")
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
+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()
Test breakpoint conditions with 'breakpoint modify -c <expr> id'.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
Test lldb breakpoint ids.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test breakpoint ignore count features.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test breakpoint commands for a breakpoint ID with multiple locations.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test breakpoint command for different options.
"""
+from __future__ import print_function
+
import lldb_shared
import os
"""
Test breakpoint command with AT_comp_dir set to symbolic link.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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
Test lldb breakpoint ids.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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):
Test that you can set breakpoint and hit the C++ language exception breakpoint
"""
+from __future__ import print_function
+
import lldb_shared
import os
Test breakpoint commands set before we have a target
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
another source file) works correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
parser.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test the command history mechanism
"""
+from __future__ import print_function
+
import lldb_shared
import os
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
Test lldb Python commands.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test custom import command to import files by path."""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
+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):
+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
+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
+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):
"""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
+from __future__ import print_function
+
import lldb
import sys
import os
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
+from __future__ import print_function
import lldb, sys
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):
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')
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)
See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
"""
+from __future__ import print_function
+
import lldb_shared
import os, sys
+from __future__ import print_function
+
def date():
import datetime
today = datetime.date.today()
- print today
+ print(today)
Test the lldb command line completion mechanism.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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:
Test conditionally break on a function and inspect its variables.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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:
# 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()
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,
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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')
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
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time, re
corruption).
"""
+from __future__ import print_function
+
import lldb_shared
import os, time, re
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
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")
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
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
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Check that vector types format properly
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
Test that breakpoint works correctly in the presence of dead-code stripping.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test some lldb command abbreviations.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that dynamic values update their child count correctly
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test convenience variables when you drop in from lldb prompt into an embedded interpreter."""
+from __future__ import print_function
+
import lldb_shared
import os
# 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])
"""
Test some lldb command abbreviations.
"""
+from __future__ import print_function
+
import lldb_shared
import commands
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):
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
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)
"""
Test some lldb command abbreviations.
"""
+from __future__ import print_function
+
import lldb_shared
import commands
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):
Test the command history mechanism
"""
+from __future__ import print_function
+
import lldb_shared
import os
"""Test that lldb functions correctly after the inferior has asserted."""
+from __future__ import print_function
+
import lldb_shared
import os, time
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()
"""Test lldb reloads the inferior after it was changed during the session."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that lldb functions correctly after the inferior has crashed."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""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
"""Test stepping over and into inlined functions."""
+from __future__ import print_function
+
import lldb_shared
import os, time, sys
"""Test for the JITLoaderGDB interface"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""
Test that argdumper is a viable launching strategy.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test that breakpoint by symbol name works correctly with dynamic libs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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")
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
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
Test the 'memory read' command.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""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
"""
Test that using a non-existent architecture name does not crash LLDB.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
foreign-architecture object files.
"""
+from __future__ import print_function
+
import lldb_shared
import os.path
"""
Test some lldb command abbreviations.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test some lldb platform commands.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that plugins that load commands work correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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)
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)
Test that the Python operating system plugin works correctly
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test basics of mini dump debugging.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test process attach.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test denied process attach.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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)
"""Test that we handle inferiors which change their process group"""
+from __future__ import print_function
+
import lldb_shared
import os
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)
Test lldb process launch flags.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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"
Test lldb data formatter subsystem.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
Test the 'register' command.
"""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
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)
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)
"""
Test that argdumper is a viable launching strategy.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test getting return-values correctly when stepping out
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Set the contents of variables and registers using raw data
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""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
"""Test that we can debug inferiors that handle SIGSEGV by themselves"""
+from __future__ import print_function
+
import lldb_shared
import os
"""Test that we handle inferiors that send signals to themselves"""
+from __future__ import print_function
+
import lldb_shared
import os
# 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)
# 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)
Test the lldb command line takes a filename with single quote chars.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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"])
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
Test lldb target stop-hook command.
"""
+from __future__ import print_function
+
import lldb_shared
import os
Test lldb target stop-hook mechanism to see whether it fires off correctly .
"""
+from __future__ import print_function
+
import lldb_shared
import os
# 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.
Test that lldb stop-hook works for multiple threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test some target commands: create, list, select, variable.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
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)
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
verified to match the expected number of events.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test that step-inst over a crash behaves correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os
Test thread creation after process attach.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test jumping to different places.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test thread states.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test stepping out from a function in a multi-threaded program.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test number of threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that we obey thread conditioned breakpoints.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb command aliases.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Check that types only get completed when necessary.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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')
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')
Test type lookup command.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that we can backtrace correctly with 'noreturn' functions on the stack
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test that we can backtrace correctly with 'sigtramp' functions on the stack
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.")
after escaping some special characters).
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
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
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()
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
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
Test my first lldb watchpoint.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that lldb watchpoint works for multiple threads.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.'])
"""Test stepping over watchpoints."""
+from __future__ import print_function
+
import lldb_shared
import lldb
Test that a variable watchpoint should only hit when in scope.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test watchpoint list, enable, disable, and delete commands.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test 'watchpoint command'.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test 'watchpoint command'.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test watchpoint modify command to set condition on a watchpoint.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that adding, deleting and modifying watchpoints sends the appropriate events."""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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.")
Test displayed value of a vector variable while doing watchpoint operations
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
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
See also CommandInterpreter::OutputFormattedHelpText().
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that anonymous structs/unions are transparent to member access"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test breakpoint by file/line number; and list variables with array types."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Show bitfields and check that they display correctly."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that lldb can invoke blocks and access variables inside them"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Check that compiler-generated constant values work correctly"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Look up enum type information and check for correct display."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that forward declaration of a data structure gets resolved correctly."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test variable with function ptr type and that break on the function works."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Show global variables and check that they do indeed have global scopes."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that importing modules in C works as expected."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Check that compiler-generated register values work correctly"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test settings and readings of program variables."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that types defined in shared libraries work correctly."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test that types defined in shared libraries with stripped symbols work correctly."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test thread stepping features in combination with frame select.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that thread-local storage can be read correctly."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""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
Test lldb breakpoint command for CPP methods & functions in a namespace.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test display and Python APIs on file and class static variables.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test breakpoint on a class constructor; and variable list the this object."""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
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
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)
# 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().
Test lldb Python API SBValue::Cast(SBType) for C++ types.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
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())
# 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)
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())
# 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)
Use lldb Python API to test dynamic values in C++
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Look up enum type information and check for correct display."""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test lldb exception breakpoint command for CPP.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test the printing of anonymous and named namespace variables.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that the expression parser returns proper Unicode strings.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test that variables with signed types display correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Tests that C++ member and static variables have correct layout and scope.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test some expressions involving STL data types.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test the lldb disassemble command on lib stdc++.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
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))
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
Test that variables with unsigned types display correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test C++ virtual function and virtual inheritance.
"""
+from __future__ import print_function
+
import os, time
import re
import lldb
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'.
Test that C++ supports wchar_t correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test the Go OS Plugin."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test the go DWARF type parsing."""
+from __future__ import print_function
+
import lldb_shared
import os, time
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():
"""Test that lldb works correctly on compile units form different languages."""
+from __future__ import print_function
+
import lldb_shared
import os, time, re
"""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
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.")
"""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
parser.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test the lldb disassemble command on foundation framework.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
foundation_framework = None
for module in target.modules:
- print module
+ print(module)
if module.file.basename == "Foundation":
foundation_framework = module.file.fullpath
break
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)
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:]"
Also lookup objective-c data types and evaluate expressions.
"""
+from __future__ import print_function
+
import lldb_shared
import os, os.path, time
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()
Test more expression command sequences with objective-c.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test SBValue.GetObjectDescription() with the value from SBTarget.FindGlobalVariables().
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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')
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')
Test that Objective-C methods from the runtime work correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test symbol table access for main.m.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
"""Test that hidden ivars in a shared library are visible from the main executable."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test that dynamically discovered ivars of type IMP do not crash LLDB
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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):
"""Test that importing modules in Objective-C works as expected."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test that DWARF types are trusted over module types"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test that inline functions from modules are imported correctly"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test that importing modules in Objective-C works as expected."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Make sure that ivars of Objective-C++ classes are visible in LLDB.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Use lldb Python API to test base class resolution for ObjC classes
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that the expression parser doesn't get confused by 'id' and 'Class'"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
"""Test calling functions in class methods."""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that we are able to properly report a usable dynamic type
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Use lldb Python API to test dynamic values in ObjC
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""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
"""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
"""Test that the Objective-C syntax for dictionary/array literals and indexing works"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
optimized it into a register.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
"""Test calling functions in static methods with a stripped binary."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test calling functions in static methods."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test stepping through ObjC method dispatch in various forms."""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.
newClassName = mySource_isa.GetSummary ()
if self.TraceOn():
- print mySource_isa
+ print(mySource_isa)
self.assertTrue (newClassName != className, "The isa did indeed change, swizzled!")
"""Test passing structs to Objective-C methods."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test calling functions in class methods."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test calling methods on super."""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test "print object" where another thread blocks the print object from making progress.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
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,
Test that objective-c method returning BOOL works correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
Test that we are able to find out how many children NSWindow has
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test that types defined in shared libraries work correctly."""
+from __future__ import print_function
+
import lldb_shared
import os, time
'__builtin_trap' intrinsic, which GCC (4.6) encodes to an illegal opcode.
"""
+from __future__ import print_function
+
import lldb_shared
import os
over a thread creation instruction.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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):
+from __future__ import print_function
+
import lldb_shared
import lldb
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
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)
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")
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")
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")
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
"""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
Test that clang produces the __apple accelerator tables, for example, __apple_types, correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
"""Test stepping and setting breakpoints in indirect and re-exported symbols."""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
"""Test queues inspection SB APIs."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
"""Test function call thread safety."""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test aspects of lldb commands on universal binaries."""
+from __future__ import print_function
+
import lldb_shared
import unittest2
+
+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."""
Test SBBreakpoint APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
Test SBType APIs to fetch member function types.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
after default construction.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
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
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
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
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
"""SBCommandReturnObject object is valid after default construction."""
obj = lldb.SBCommandReturnObject()
if self.TraceOn():
- print obj
+ print(obj)
self.assertTrue(obj)
@python_api_test
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
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
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
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
# 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
# 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
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
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
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
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
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
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
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
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
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
"""SBStream object is valid after default construction."""
obj = lldb.SBStream()
if self.TraceOn():
- print obj
+ print(obj)
self.assertTrue(obj)
@python_api_test
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
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
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
"""SBSymbolContextList object is valid after default construction."""
obj = lldb.SBSymbolContextList()
if self.TraceOn():
- print obj
+ print(obj)
self.assertTrue(obj)
@python_api_test
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
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
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!")
"""SBTypeList object is valid after default construction."""
obj = lldb.SBTypeList()
if self.TraceOn():
- print obj
+ print(obj)
self.assertTrue(obj)
@python_api_test
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
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
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
Use lldb Python API to disassemble raw machine code bytes
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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")
Use lldb Python API to disassemble raw machine code bytes
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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
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")
Test lldb Python event APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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
# 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)
# 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
# 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)
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 = (.*)}$")
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;
break
else:
break
- print "Timeout: listener.WaitForEvent"
+ print("Timeout: listener.WaitForEvent")
count = count + 1
if count > 6:
break
"""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
"""Test Python APIs for working with formatters"""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
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')
And other SBFrame API tests.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
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':
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.
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.
# 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')",
# 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)
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)
# 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)
frameEntered = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameEntered
+ print(frameEntered)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameEntered)
self.assertTrue(thread)
frameNow = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameNow
+ print(frameNow)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameNow)
thread.StepOutOfFrame(frameNow)
frameOutOfC = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameOutOfC
+ print(frameOutOfC)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameOutOfC)
Testlldb Python SBFrame APIs IsInlined() and GetFunctionName().
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
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,
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)])
Test retrieval of SBAddress from function/symbol, disassembly, and SBAddress APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
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()
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")
Test newly added SBSymbol and SBAddress APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
# 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())
"""Test Python APIs for target (launch and attach), breakpoint, and process."""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
"""Test the SBCommandInterpreter APIs."""
+from __future__ import print_function
+
import lldb_shared
import os
res.AppendMessage("Just appended a message.")
res.AppendMessage(None)
if self.TraceOn():
- print res
+ print(res)
process = ci.GetProcess()
self.assertTrue(process)
Test utility functions for the frame object.
"""
+from __future__ import print_function
+
import lldb_shared
import os
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)
Test the iteration protocol for some lldb container objects.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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))
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))
for frame in thread:
self.assertTrue(frame.GetThread().GetThreadID() == ID)
if self.TraceOn():
- print frame
+ print(frame)
self.assertTrue(stopped_due_to_breakpoint)
Test the iteration protocol for frame registers.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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)
Test SBprocess and SBThread APIs with printing of the stack traces using lldbutil.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test some SBModule and SBSection APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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):
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)
# Get the section at index 1.
if exe_module.GetNumSections() > 1:
sec1 = exe_module.GetSectionAtIndex(1)
- print sec1
+ print(sec1)
else:
sec1 = None
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)
+
Test SBType for ObjC classes.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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,
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,
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,
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")
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,
# 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):
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()
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)
+
"""Test Python APIs for process IO."""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
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)
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:
# 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)
Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
"""Test the SBData APIs."""
+from __future__ import print_function
+
import lldb_shared
import os
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()
data = star_foobar.GetData()
if self.TraceOn():
- print data
+ print(data)
offset = 0
self.assert_data(data.GetUnsignedInt32, offset, 1)
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')
data = new_foobar.GetData()
if self.TraceOn():
- print data
+ print(data)
offset = 0
self.assert_data(data.GetUnsignedInt32, offset, 8)
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)
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')
data.Append(data2)
if self.TraceOn():
- print data
+ print(data)
# this breaks on EBCDIC
offset = 0
"""Test SBValue::Persist"""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
Test SBSection APIs.
"""
+from __future__ import print_function
+
import lldb_shared
from lldbtest import *
Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
Test SBSymbolContext APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
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])
Test SBTarget APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
# 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)
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)
Test SBThread APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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):
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())
Test SBType and SBTypeList API.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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)
Test some SBValue APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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')
Test some SBValue APIs.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
supports iteration till the end of list is reached.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
# 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
# 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'.
# 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)
# 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)
"""Test SBValue::GetValueDidChange"""
+from __future__ import print_function
+
import lldb_shared
import os, sys, time
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
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()
Use lldb Python SBWatchpoint API to set the ignore count.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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.
self.assertTrue(watchpoint)
self.assertTrue(watchpoint.GetWatchSize() == 4)
self.assertTrue(watchpoint.GetHitCount() == 2)
- print watchpoint
+ print(watchpoint)
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
# 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.
self.assertTrue(watchpoint)
self.assertTrue(watchpoint.GetWatchSize() == 4)
self.assertTrue(watchpoint.GetHitCount() == 1)
- print watchpoint
+ print(watchpoint)
+
Test watchpoint condition API.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
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()
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
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()
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
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()
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]):
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)
Test lldb settings command.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time, re
Test quoting of arguments to lldb commands
"""
+from __future__ import print_function
+
import lldb_shared
import os, time, re
Test the caching mechanism of the source manager.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
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'))
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)
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
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
within the LLDB test suite.
"""
+from __future__ import print_function
+
import lldb_shared
import argparse
#!/usr/bin/env python
"""Inferior program used by process control tests."""
+
+from __future__ import print_function
+
import argparse
import datetime
import signal
for signum in signals:
if options.verbose:
- print "disabling signum {}".format(signum)
+ print("disabling signum {}".format(signum))
signal.signal(signum, signal.SIG_IGN)
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:
Test that the lldb-mi driver exits properly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -file-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -gdb-set and -gdb-show commands.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test lldb-mi =library-loaded notifications.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test that the lldb-mi driver prints prompt properly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -break-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test lldb-mi -exec-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -data-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
Test lldb-mi can interpret CLI commands directly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -interpreter-exec command.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Base class for lldb-mi test cases.
"""
+from __future__ import print_function
+
import lldb_shared
from lldbtest import *
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)
Test that the lldb-mi handles signals properly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -stack-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi startup options.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -symbol-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test that the lldb-mi driver understands MI command syntax.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -target-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -gdb-set and -gdb-show commands for 'print option-name'.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Test lldb-mi -var-xxx commands.
"""
+from __future__ import print_function
+
import lldb_shared
import lldbmi_testcase
Tests the binary ($x) and hex ($m) memory read packets of the remote stub
"""
+from __future__ import print_function
+
import lldb_shared
import os
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
# 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):
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):
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
# 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.
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
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
(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()
# 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)
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import sys
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
the initial set of tests implemented.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
# 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).
+from __future__ import print_function
+
import gdbremote_testcase
import lldbgdbserverutils
import re
(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)
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
Base class for gdb-remote test cases.
"""
+from __future__ import print_function
+
import lldb_shared
import errno
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.
# 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:
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":
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
# 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()
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
+from __future__ import print_function
+
import lldb_shared
import gdbremote_testcase
"""Module for supporting unit testing of the lldb-server debug monitor exe.
"""
+from __future__ import print_function
+
import lldb_shared
import os
# 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:
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")
+from __future__ import print_function
+
import lldb_shared
import re
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.
# 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):
+from __future__ import print_function
+
import lldb_shared
import unittest2
Abstract base class of basic types provides a generic type tester method.
"""
+from __future__ import print_function
+
import os, time
import re
import lldb
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)
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.
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.
Test that variables of integer basic types are displayed correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import AbstractBase
Test that variables of floating point types are displayed correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import AbstractBase
Test that variable expressions of floating point types are evaluated correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import AbstractBase
Test that variables of integer basic types are displayed correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import AbstractBase
Test that variable expressions of integer basic types are evaluated correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import AbstractBase
Test that recursive types are handled correctly.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
"""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