1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

AK: Don't demangle in serenity :(

In order to remove libstdc++ completely, we need to give up on their
implementation of abi::__cxa_demangle. The demangler logic will actually
have to be quite complex, and included in both the kernel and userspace.

A definite fixme for the future, to parse the mangled names into real
deal names.
This commit is contained in:
Andrew Kaster 2020-05-16 14:05:35 -06:00 committed by Andreas Kling
parent aff594f1e7
commit 4361a50225
2 changed files with 4 additions and 3 deletions

View file

@ -29,7 +29,7 @@
#include <AK/String.h>
#include <AK/StringView.h>
#ifndef BUILDING_SERENITY_TOOLCHAIN
#ifndef __serenity__
# include <cxxabi.h>
#endif
@ -37,9 +37,10 @@ namespace AK {
inline String demangle(const StringView& name)
{
#ifdef BUILDING_SERENITY_TOOLCHAIN
#ifdef __serenity__
return name;
#else
// FIXME: Implement __cxa_demangle in serenity
int status = 0;
auto* demangled_name = abi::__cxa_demangle(name.to_string().characters(), nullptr, nullptr, &status);
auto string = String(status == 0 ? demangled_name : name);