Check that every entry in the call graph has the following fields: .calls, .has_ptr_call, .local_stack, .scope, .src_line
(call_graph)
| 201 | |
| 202 | |
| 203 | def 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 | |
| 223 | def resolve_all_calls(call_graph): |
| 224 | def resolve_calls(fxn_dict2): |