diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 | 
| commit | ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f (patch) | |
| tree | 27916256fdeeb57d10d2f3d6948be5d71a703215 /examples/python/crashlog.py | |
| parent | 76e0736e7fcfeb179779e49c05604464b1ccd704 (diff) | |
Notes
Diffstat (limited to 'examples/python/crashlog.py')
| -rwxr-xr-x | examples/python/crashlog.py | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/python/crashlog.py b/examples/python/crashlog.py index 7270f60f4373b..227fce1140524 100755 --- a/examples/python/crashlog.py +++ b/examples/python/crashlog.py @@ -680,7 +680,7 @@ def interactive_crashlogs(options, args):      interpreter.cmdloop() -def save_crashlog(debugger, command, result, dict): +def save_crashlog(debugger, command, exe_ctx, result, dict):      usage = "usage: %prog [options] <output-path>"      description = '''Export the state of current target into a crashlog file'''      parser = optparse.OptionParser( @@ -709,11 +709,12 @@ def save_crashlog(debugger, command, result, dict):              "error: failed to open file '%s' for writing...",              args[0])          return -    target = debugger.GetSelectedTarget() +    target = exe_ctx.target      if target:          identifier = target.executable.basename -        if lldb.process: -            pid = lldb.process.id +        process = exe_ctx.process +        if process: +            pid = process.id              if pid != lldb.LLDB_INVALID_PROCESS_ID:                  out_file.write(                      'Process:         %s [%u]\n' % @@ -726,8 +727,8 @@ def save_crashlog(debugger, command, result, dict):              'OS Version:      Mac OS X %s (%s)\n' %              (platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')))          out_file.write('Report Version:  9\n') -        for thread_idx in range(lldb.process.num_threads): -            thread = lldb.process.thread[thread_idx] +        for thread_idx in range(process.num_threads): +            thread = process.thread[thread_idx]              out_file.write('\nThread %u:\n' % (thread_idx))              for (frame_idx, frame) in enumerate(thread.frames):                  frame_pc = frame.pc  | 
