Explicitly check for mangled external names (starting with "_Z") as __cxa_demangle also handles type mangling, which conflicts with unmangled names such as "f" or "m".
For reference D2552 is the same issue in lldb. See also the discussion at https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-June/001153.html.