MCPcopy Create free account
hub / github.com/pytorch/executorch / read_nm

Function read_nm

scripts/check_binary_dependencies.py:93–110  ·  view source on GitHub ↗

Read a set of symbols using the nm tool.

(
    nm: str, file: Path, exclude: Optional[List[str]] = None
)

Source from the content-addressed store, hash-verified

91
92
93def read_nm(
94 nm: str, file: Path, exclude: Optional[List[str]] = None
95) -> List[Tuple[str, str]]:
96 """Read a set of symbols using the nm tool."""
97 if exclude is None:
98 exclude = ["N"]
99
100 output = get_tool_output([nm, file])
101 result = []
102 for line in output.splitlines():
103 match = re.search(NM_REGEX, line)
104 if not match:
105 continue
106
107 status = match.group("status").upper()
108 if exclude is None or status not in exclude:
109 result.append((status, match.group("symbol")))
110 return result
111
112
113def get_object_symbols(

Callers 1

get_object_symbolsFunction · 0.85

Calls 2

get_tool_outputFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected