This commit is contained in:
udo
2026-06-13 15:10:42 +00:00
parent afaa4dd7c0
commit 5a56d4f39e
14 changed files with 531 additions and 83 deletions
+6 -2
View File
@@ -15,7 +15,11 @@
#include <string>
#include <vector>
#if defined(__GNUG__)
// The demangler is a host-side nicety for trap traces. wasi-libc++ does not
// provide __cxa_demangle, and a wasm unit that merely includes uce_lib.h must
// not pull it in as an unresolvable import — so it is host-only.
#if defined(__GNUG__) && !defined(__wasm__)
#define UCE_WASM_TRACE_HAVE_DEMANGLE 1
#include <cxxabi.h>
#endif
@@ -30,7 +34,7 @@ struct WasmTraceSummary
inline std::string wasm_trace_demangle(const std::string& name)
{
#if defined(__GNUG__)
#if defined(UCE_WASM_TRACE_HAVE_DEMANGLE)
// frame names look like "module!symbol"; demangle the symbol part
auto bang = name.find('!');
std::string prefix = bang == std::string::npos ? "" : name.substr(0, bang + 1);