Read a set of symbols using the nm tool.
(
nm: str, file: Path, exclude: Optional[List[str]] = None
)
| 91 | |
| 92 | |
| 93 | def 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 | |
| 113 | def get_object_symbols( |
no test coverage detected