in cbmc_viewer/tracet.py [0:0]
def parse_xml_step(step, root=None):
"""Parse a step in an xml trace."""
if step.get('hidden') == 'true': # Skip most hidden steps, but...
# ...don't skip a function call or return
function_call_step = step.tag in ['function_call', 'function_return']
# ...don't skip static initialization (do skip internal assignments)
visible_assignment_step = (
step.tag == 'assignment' and
not step.find('full_lhs').text.startswith('__CPROVER') and
not step.find('full_lhs').text.startswith('return_value_')
)
if not function_call_step and not visible_assignment_step:
logging.debug('Skipping step type: %s', step.tag)
return None
kind = step.tag
parser = (parse_xml_failure if kind == 'failure' else
parse_xml_assignment if kind == 'assignment' else
parse_xml_function_call if kind == 'function_call' else
parse_xml_function_return if kind == 'function_return' else
parse_xml_location_only if kind == 'location-only' else None)
if parser is None:
# skip uninteresting kinds of steps
if kind == 'loop-head':
logging.debug('Skipping step type: %s', kind)
return None
# warn about skipping a potentially interesting kind of step
logging.warning('Skipping step type: %s', kind)
return None
parsed_step = parser(step, root)
if parsed_step:
parsed_step['hidden'] = step.get('hidden') == 'true'
return parsed_step