Skip to content

Commit

Permalink
AK: Turn off demangler in userland
Browse files Browse the repository at this point in the history
For some reason, the default CXXFLAGS and such don't get us the
__cxa_demangle symbol in userland.
  • Loading branch information
ADKaster authored and awesomekling committed Jan 1, 2020
1 parent 96a8646 commit c24fe71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion AK/Demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ namespace AK {

inline String demangle(const char* name)
{
#ifdef KERNEL
int status = 0;
auto* demangled_name = abi::__cxa_demangle(name, nullptr, nullptr, &status);
auto string = String(status == 0 ? demangled_name : name);
if (status == 0)
kfree(demangled_name);
return string;
#else
return name;
#endif
}

}

using AK::demangle;

0 comments on commit c24fe71

Please sign in to comment.