2023-11-12 01:22:01 +01:00
|
|
|
#include <hex/helpers/utils.hpp>
|
|
|
|
#include <hex/api/localization.hpp>
|
|
|
|
|
|
|
|
#include <llvm/Demangle/Demangle.h>
|
|
|
|
|
|
|
|
#include <imgui.h>
|
|
|
|
|
|
|
|
#include <hex/ui/imgui_imhex_extensions.h>
|
|
|
|
|
|
|
|
namespace hex::plugin::builtin {
|
|
|
|
namespace impl {
|
|
|
|
void drawDemangler() {
|
|
|
|
static std::string mangledName, demangledName;
|
|
|
|
|
|
|
|
if (ImGui::InputTextWithHint("hex.builtin.tools.demangler.mangled"_lang, "Itanium, MSVC, Dlang & Rust", mangledName)) {
|
|
|
|
demangledName = llvm::demangle(mangledName);
|
|
|
|
|
|
|
|
if (demangledName == mangledName) {
|
|
|
|
demangledName = "???";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-16 22:24:06 +01:00
|
|
|
ImGuiExt::Header("hex.builtin.tools.demangler.demangled"_lang);
|
2023-11-12 01:22:01 +01:00
|
|
|
if (ImGui::BeginChild("demangled", ImVec2(0, 200_scaled), true)) {
|
2023-11-16 22:24:06 +01:00
|
|
|
ImGuiExt::TextFormattedWrappedSelectable("{}", demangledName);
|
2023-11-12 01:22:01 +01:00
|
|
|
}
|
|
|
|
ImGui::EndChild();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|