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

Function read_symbols

tools/WCS.py:28–48  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

26
27
28def read_symbols(file):
29 from subprocess import check_output
30
31 def to_symbol(read_elf_line):
32 v = read_elf_line.split()
33
34 s2 = Symbol()
35 s2.value = int(v[1], 16)
36 s2.size = int(v[2])
37 s2.type = v[3]
38 s2.binding = v[4]
39 if len(v) >= 8:
40 s2.name = v[7]
41 else:
42 s2.name = ""
43
44 return s2
45
46 output = check_output([read_elf_path, "-s", "-W", file]).decode(stdout_encoding)
47 lines = output.splitlines()[3:]
48 return [to_symbol(line) for line in lines]
49
50
51def read_obj(tu, call_graph):

Callers 1

read_objFunction · 0.85

Calls 2

check_outputFunction · 0.85
to_symbolFunction · 0.85

Tested by

no test coverage detected