build: Move all demangler uses into the trace library

This commit is contained in:
WerWolv
2025-07-30 20:57:53 +02:00
parent ec9461741c
commit 6fcc3e8cb3
12 changed files with 28 additions and 59 deletions

View File

@@ -58,7 +58,7 @@ set_target_properties(main PROPERTIES
target_compile_definitions(main PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
target_link_libraries(main PRIVATE libromfs-imhex libimhex libwolv ${LIBBACKTRACE_LIBRARIES} LLVMDemangle)
target_link_libraries(main PRIVATE libromfs-imhex libimhex libwolv ${LIBBACKTRACE_LIBRARIES})
if (WIN32)
target_link_libraries(main PRIVATE usp10 wsock32 ws2_32 Dwmapi.lib Winmm.lib)

View File

@@ -13,11 +13,9 @@
#include <init/tasks.hpp>
#include <hex/trace/stacktrace.hpp>
#include <llvm/Demangle/Demangle.h>
#include <nlohmann/json.hpp>
#include <hex/trace/stacktrace.hpp>
#include <llvm/Demangle/Demangle.h>
#include <csignal>
#include <exception>
@@ -164,7 +162,7 @@ namespace hex::crash {
try {
std::rethrow_exception(std::current_exception());
} catch (std::exception &ex) {
std::string exceptionStr = hex::format("{}()::what() -> {}", llvm::demangle(std::string("_Z") + typeid(ex).name()), ex.what());
std::string exceptionStr = hex::format("{}()::what() -> {}", trace::demangle(typeid(ex).name()), ex.what());
handleCrash(exceptionStr);
log::fatal("Program terminated with uncaught exception: {}", exceptionStr);