MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / read_su

Function read_su

tools/WCS.py:160–179  ·  view source on GitHub ↗

Reads the 'local_stack' for each function. Local stack ignores stack used by callees. :param tu: the translation unit :param call_graph: a object used to store information about each function, results go here :return:

(tu, call_graph)

Source from the content-addressed store, hash-verified

158
159
160def read_su(tu, call_graph):
161 """
162 Reads the 'local_stack' for each function. Local stack ignores stack used by callees.
163 :param tu: the translation unit
164 :param call_graph: a object used to store information about each function, results go here
165 :return:
166 """
167
168 su_line = re.compile(r'^([^ :]+):([\d]+):([\d]+):(.+)\t(\d+)\t(\S+)$')
169 i = 1
170
171 for line in open(tu[0:tu.rindex(".")] + su_ext).readlines():
172 m = su_line.match(line)
173 if m:
174 fxn = m.group(4)
175 fxn_dict2 = find_demangled_fxn(tu, fxn, call_graph)
176 fxn_dict2['local_stack'] = int(m.group(5))
177 else:
178 print("error parsing line {} in file {}".format(i, tu))
179 i += 1
180
181
182def read_manual(file, call_graph):

Callers 1

mainFunction · 0.85

Calls 2

find_demangled_fxnFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected