reg_info = g_register_infos[reg_num]
key_value_pair[0] = reg_info.name()
key_value_pair[1] = reg_info.get_value_from_hex_string (key_value_pair[1])
+ elif key == 'jthreads' or key == 'jstopinfo':
+ key_value_pair[1] = binascii.unhexlify(key_value_pair[1])
key_value_pairs.insert(0, ['signal', signo])
dump_key_value_pairs (key_value_pairs)
elif stop_type == 'W':
else:
print "not supported"
+def cmd_c(options, cmd, args):
+ print "continue()"
+
+def cmd_s(options, cmd, args):
+ print "step()"
+
def cmd_vCont(options, cmd, args):
if args == '?':
print "%s: get supported extended continue modes" % (cmd)
'qHostInfo' : { 'cmd' : cmd_query_packet , 'rsp' : rsp_dump_key_value_pairs, 'name' : "get host information" },
'vCont' : { 'cmd' : cmd_vCont , 'rsp' : rsp_vCont , 'name' : "extended continue command" },
'vAttach' : { 'cmd' : cmd_vAttach , 'rsp' : rsp_stop_reply , 'name' : "attach to process" },
+ 'c' : { 'cmd' : cmd_c , 'rsp' : rsp_stop_reply , 'name' : "continue" },
+ 's' : { 'cmd' : cmd_s , 'rsp' : rsp_stop_reply , 'name' : "step" },
'qRegisterInfo' : { 'cmd' : cmd_qRegisterInfo , 'rsp' : rsp_qRegisterInfo , 'name' : "query register info" },
'qfThreadInfo' : { 'cmd' : cmd_qThreadInfo , 'rsp' : rsp_qThreadInfo , 'name' : "get current thread list" },
'qsThreadInfo' : { 'cmd' : cmd_qThreadInfo , 'rsp' : rsp_qThreadInfo , 'name' : "get current thread list" },
def calculate_mean_and_standard_deviation(floats):
sum = 0.0
count = len(floats)
+ if count == 0:
+ return (0.0, 0.0)
for f in floats:
sum += f
mean = sum / count
std_dev = math.sqrt(accum / (count-1));
return (mean, std_dev)
+
+def parse_gdb_log_file(path, options):
+ f = open(path)
+ parse_gdb_log(f)
+ f.close()
-def parse_gdb_log_file(file, options):
+def parse_gdb_log(file, options):
'''Parse a GDB log file that was generated by enabling logging with:
(lldb) log enable --threadsafe --timestamp --file <FILE> gdb-remote packets
This log file will contain timestamps and this function will then normalize
packet_total_times = {}
packet_times = []
packet_count = {}
- file = open(file)
lines = file.read().splitlines()
last_command = None
last_command_args = None
# This script is being run from the command line, create a debugger in case we are
# going to use any debugger functions in our function.
- for file in args:
- print '#----------------------------------------------------------------------'
- print "# GDB remote log file: '%s'" % file
- print '#----------------------------------------------------------------------'
- parse_gdb_log_file (file, options)
- if options.symbolicator:
- print '%s' % (options.symbolicator)
+ if len(args):
+ for file in args:
+ print '#----------------------------------------------------------------------'
+ print "# GDB remote log file: '%s'" % file
+ print '#----------------------------------------------------------------------'
+ parse_gdb_log_file (file, options)
+ if options.symbolicator:
+ print '%s' % (options.symbolicator)
+ else:
+ parse_gdb_log(sys.stdin, options)
else:
import lldb