MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / get_symdb

Function get_symdb

tools/compare_ast_symdb.py:38–56  ·  view source on GitHub ↗
(debug)

Source from the content-addressed store, hash-verified

36
37
38def get_symdb(debug):
39 debug = re.sub(r'0x[0-9a-fA-F]+', '0x12345678', debug)
40 debug = re.sub(r'nestedIn: Struct', 'nestedIn: Class', debug)
41 debug = re.sub(r'classDef: struct', 'classDef: class', debug)
42 debug = re.sub(r'isInline: [a-z]+', 'isInline: ---', debug)
43 debug = re.sub(r'definedType: .*', 'definedType: ---', debug)
44 debug = re.sub(r'needInitialization: .*', 'needInitialization: ---', debug)
45 debug = re.sub(r'functionOf: .*', 'functionOf: ---', debug)
46 debug = re.sub(r'0x12345678 Struct', '0x12345678 Class', debug)
47
48 pos1 = debug.rfind('\n### Symbol database ###\n')
49 if pos1 < 0:
50 return ''
51 pos1 = debug.find('\n', pos1) + 1
52 assert pos1 > 0
53 pos2 = debug.find("\n##", pos1)
54 if pos2 < 0:
55 return debug[pos1:]
56 return debug[pos1:pos2-1]
57
58
59def compare_ast_symdb(cppcheck_parameters: str):

Callers 1

compare_ast_symdbFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected