6 print "Usage : --gdb-output-file=filename --in-function=<function-name>, --exclude-function=<function-name>,<function-name>"
7 print "--in-function : show only threads whose stack has functions of name <function-name> (or part thereof)"
8 print "--exclude-function : do not show threads whose stack has functions of name <function-name> (or part thereof)"
9 print "---gdb-output-file : gdb output file to use"
13 opts, args = getopt.getopt(sys.argv[1:], "hg:i:e:", ["help", "gdb-output-file=","in-function=","exclude-function="])
14 except getopt.GetoptError, err:
15 # print help information and exit:
16 print str(err) # will print something like "option -a not recognized"
25 if o in ("-h", "--help"):
28 elif o in ("-g", "--gdb-output-file") :
30 elif o in ('-i', "--in-function") :
32 elif o in ('-e', "--exclude-function") :
35 print "Unknown option %s" % o
48 if len(line) == 0 : continue
49 if "to continue, or q" in line : continue
51 if tokens[0] == "Thread" :
58 if "to continue, or q" in line : continue
60 if len(line) == 0 : break
62 if ttokens[0] == "Thread" :
66 line += f.readline().strip()
67 thisThread.append(line)
73 if useThread and hasKeyword :
74 Threads[tokens[1]]=thisThread
78 for line in Threads[t] :