33 def log(self, message):
34 print "%s: note: %s" % (self.
location, message)
42 self.callers.append(caller)
47 print (
"%s: error: %s marked as both 'throw' and 'nothrow'"
62 print (
"%s: error: function %s is marked nothrow but is assumed to throw due to indirect call"
65 print (
"%s: error: function %s is marked nothrow but can throw"
69 while edge
is not None:
70 print (
"%s: info: via call to %s"
71 % (edge.location, edge.to_fn.name))
72 edge = edge.to_fn.reason
84 work_list.append(self)
97 indirect_functions = []
99 process_cleanups =
False
101 process_indirect =
False
105 if fn_name
not in function_map:
106 function_map[fn_name] =
Function(fn_name)
107 return function_map[fn_name]
111 fn.set_location(location)
116 if fn.declare_throw():
124 global process_cleanups
132 to_fn.add_caller(
Edge(frm_fn, to_fn, location))
135 global indirect_functions
138 phony.add_caller(
Edge(fn, phony, location))
139 indirect_functions.append(phony)
142 for callee
in worklist:
143 for edge
in callee.callers:
144 edge.from_fn.mark_throw(edge, worklist, is_indirect)
147 print "Usage: exsummary [OPTION]..."
149 print "Read the .py files from the exception checker plugin and"
150 print "generate an error summary."
152 print " --cleanups Include invalid behavior in cleanups"
153 print " --indirect Include assumed errors due to indirect function calls"
158 global indirect_functions
159 global process_cleanups
160 global process_indirect
163 if arg ==
'--cleanups':
164 process_cleanups =
True
165 elif arg ==
'--indirect':
166 process_indirect =
True
167 elif arg ==
'--help':
170 for fname
in sorted(glob.glob(
'*.c.gdb_exc.py')):
172 print "================"
173 print "= Ordinary marking"
174 print "================"
177 print "================"
178 print "= Indirect marking"
179 print "================"
183 if __name__ ==
'__main__':
def print_stack(self, is_indirect)
def consistency_check(self)
def function_call(to, frm, location)
def declare_throw(fn_name)
def declare_cleanup(fn_name)
def mark_throw(self, edge, work_list, is_indirect)
def declare_nothrow(fn_name)
def define_function(fn_name, location)
def declare_nothrow(self)
def add_caller(self, caller)
def set_location(self, location)
def has_indirect_call(fn_name, location)
def mark_functions(worklist, is_indirect)
def __init__(self, from_fn, to_fn, location)