diff options
| author | Davide Italiano <davide@freebsd.org> | 2019-03-06 22:54:11 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2019-03-06 22:54:11 +0000 |
| commit | a658ab9f55662f4048cb59e9520b7bf9b1b20494 (patch) | |
| tree | f9cb17e226666029abf50f560520227cdf67d950 /lldb/examples/darwin/heap_find/heap.py | |
| parent | 798174455f4f2cc2a11308136daf0f201d7c3d0f (diff) | |
| download | bcm5719-llvm-a658ab9f55662f4048cb59e9520b7bf9b1b20494.tar.gz bcm5719-llvm-a658ab9f55662f4048cb59e9520b7bf9b1b20494.zip | |
[testsuite] Port crashlog to python 3, second attempt.
llvm-svn: 355562
Diffstat (limited to 'lldb/examples/darwin/heap_find/heap.py')
| -rw-r--r-- | lldb/examples/darwin/heap_find/heap.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lldb/examples/darwin/heap_find/heap.py b/lldb/examples/darwin/heap_find/heap.py index c463380bf49..3157dfb5e87 100644 --- a/lldb/examples/darwin/heap_find/heap.py +++ b/lldb/examples/darwin/heap_find/heap.py @@ -9,7 +9,6 @@ #---------------------------------------------------------------------- import lldb -import commands import optparse import os import os.path @@ -228,7 +227,7 @@ def append_regex_callback(option, opt, value, parser): ivar_regex = re.compile(value) parser.values.ivar_regex_blacklist.append(ivar_regex) except: - print 'error: an exception was thrown when compiling the ivar regular expression for "%s"' % value + print('error: an exception was thrown when compiling the ivar regular expression for "%s"' % value) def add_common_options(parser): @@ -389,16 +388,16 @@ def find_variable_containing_address(verbose, frame, match_addr): if var_addr != lldb.LLDB_INVALID_ADDRESS: byte_size = var.GetType().GetByteSize() if verbose: - print 'frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), var.load_addr, var.load_addr + byte_size, var.name) + print('frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), var.load_addr, var.load_addr + byte_size, var.name)) if var_addr == match_addr: if verbose: - print 'match' + print('match') return var else: if byte_size > 0 and var_addr <= match_addr and match_addr < ( var_addr + byte_size): if verbose: - print 'match' + print('match') return var return None @@ -616,10 +615,10 @@ lldb_info''' % (options.max_frames, options.max_history, addr) expr_options.SetPrefix(expr_prefix) expr_sbvalue = frame.EvaluateExpression(expr, expr_options) if options.verbose: - print "expression:" - print expr - print "expression result:" - print expr_sbvalue + print("expression:") + print(expr) + print("expression result:") + print(expr_sbvalue) if expr_sbvalue.error.Success(): if history: malloc_stack_history = lldb.value(expr_sbvalue) @@ -670,10 +669,10 @@ def display_match_results( expr_options.SetPrefix(expr_prefix) expr_sbvalue = frame.EvaluateExpression(expr, expr_options) if options.verbose: - print "expression:" - print expr - print "expression result:" - print expr_sbvalue + print("expression:") + print(expr) + print("expression result:") + print(expr_sbvalue) if expr_sbvalue.error.Success(): match_value = lldb.value(expr_sbvalue) i = 0 @@ -863,14 +862,14 @@ def find_variable(debugger, command, result, dict): for arg in args: var_addr = int(arg, 16) - print >>result, "Finding a variable with address %#x..." % (var_addr) + print("Finding a variable with address %#x..." % (var_addr), file=result) done = False for thread in process: for frame in thread: var = find_variable_containing_address( options.verbose, frame, var_addr) if var: - print var + print(var) done = True break if done: @@ -1519,4 +1518,4 @@ lldb.debugger.HandleCommand( lldb.debugger.HandleCommand( 'command script add -f %s.objc_refs objc_refs' % __name__) -print '"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.' +print('"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.') |

