MCPcopy Create free account
hub / github.com/FastLED/FastLED / demangle_symbol

Function demangle_symbol

ci/util/symbol_analysis.py:152–174  ·  view source on GitHub ↗

Demangle a C++ symbol using c++filt

(mangled_name: str, cppfilt_path: str)

Source from the content-addressed store, hash-verified

150
151
152def demangle_symbol(mangled_name: str, cppfilt_path: str) -> str:
153 """Demangle a C++ symbol using c++filt"""
154 try:
155 cmd = f'echo "{mangled_name}" | "{cppfilt_path}"'
156 proc = RunningProcess(cmd, shell=True, auto_run=True, timeout=10)
157 output = ""
158 from running_process import EndOfStream
159
160 while line := proc.get_next_line(timeout=10):
161 if isinstance(line, EndOfStream):
162 break
163 output += str(line)
164 exit_code = proc.wait()
165 demangled = output.strip()
166 # If demangling failed, c++filt returns the original name
167 return demangled if demangled and demangled != mangled_name else mangled_name
168 except KeyboardInterrupt as ki:
169 handle_keyboard_interrupt(ki)
170 raise
171 except Exception as e:
172 print(f"Error demangling symbol: {mangled_name}")
173 print(f"Error: {e}")
174 return mangled_name
175
176
177def analyze_symbols(

Callers 2

analyze_symbolsFunction · 0.70
analyze_function_callsFunction · 0.70

Calls 3

printFunction · 0.50
waitMethod · 0.45

Tested by

no test coverage detected