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

Function validate_all_data

tools/WCS.py:203–221  ·  view source on GitHub ↗

Check that every entry in the call graph has the following fields: .calls, .has_ptr_call, .local_stack, .scope, .src_line

(call_graph)

Source from the content-addressed store, hash-verified

201
202
203def validate_all_data(call_graph):
204 """
205 Check that every entry in the call graph has the following fields:
206 .calls, .has_ptr_call, .local_stack, .scope, .src_line
207 """
208
209 def validate_dict(d):
210 if not ('calls' in d and 'has_ptr_call' in d and 'local_stack' in d
211 and 'name' in d and 'tu' in d):
212 print("Error data is missing in fxn dictionary {}".format(d))
213
214 # Loop through every global and local function
215 # and resolve each call, save results in r_calls
216 for fxn_dict2 in call_graph['globals'].values():
217 validate_dict(fxn_dict2)
218
219 for l_dict in call_graph['locals'].values():
220 for fxn_dict2 in l_dict.values():
221 validate_dict(fxn_dict2)
222
223def resolve_all_calls(call_graph):
224 def resolve_calls(fxn_dict2):

Callers 1

mainFunction · 0.85

Calls 1

validate_dictFunction · 0.85

Tested by

no test coverage detected