From 72c7c9557ce0e7b114f93cfd2008b290887f07c9 Mon Sep 17 00:00:00 2001 From: Dimitri Rusin Date: Fri, 19 Jan 2024 16:52:25 +0100 Subject: [PATCH] s --- include/ioh/common/factory.hpp | 71 ---------------------------------- 1 file changed, 71 deletions(-) diff --git a/include/ioh/common/factory.hpp b/include/ioh/common/factory.hpp index bfe47186..5e9d7b43 100644 --- a/include/ioh/common/factory.hpp +++ b/include/ioh/common/factory.hpp @@ -1,11 +1,5 @@ #pragma once -#if defined(_MSC_VER) -#include -#include -#endif - - #include #include #include @@ -27,66 +21,6 @@ #include "container_utils.hpp" #include "file.hpp" - - - -#if defined(_MSC_VER) -void print_windows_backtrace() { - HANDLE process = GetCurrentProcess(); - HANDLE thread = GetCurrentThread(); - - CONTEXT context = {}; - context.ContextFlags = CONTEXT_FULL; - RtlCaptureContext(&context); - - SymInitialize(process, NULL, TRUE); - - STACKFRAME64 stackframe; - ZeroMemory(&stackframe, sizeof(STACKFRAME64)); - DWORD image; - -#ifdef _M_IX86 - image = IMAGE_FILE_MACHINE_I386; - stackframe.AddrPC.Offset = context.Eip; - stackframe.AddrPC.Mode = AddrModeFlat; - stackframe.AddrFrame.Offset = context.Ebp; - stackframe.AddrFrame.Mode = AddrModeFlat; - stackframe.AddrStack.Offset = context.Esp; - stackframe.AddrStack.Mode = AddrModeFlat; -#elif _M_X64 - image = IMAGE_FILE_MACHINE_AMD64; - stackframe.AddrPC.Offset = context.Rip; - stackframe.AddrPC.Mode = AddrModeFlat; - stackframe.AddrFrame.Offset = context.Rsp; - stackframe.AddrFrame.Mode = AddrModeFlat; - stackframe.AddrStack.Offset = context.Rsp; - stackframe.AddrStack.Mode = AddrModeFlat; -#else - #error "Platform not supported!" -#endif - - for (size_t i = 0; i < 62; ++i) { - BOOL result = StackWalk64( - image, process, thread, - &stackframe, &context, NULL, - SymFunctionTableAccess64, SymGetModuleBase64, NULL); - - if (!result) { break; } - - std::cerr << "Frame " << i << ": "; - std::cerr << "PC = " << stackframe.AddrPC.Offset << ", "; - std::cerr << "Frame = " << stackframe.AddrFrame.Offset << ", "; - std::cerr << "Stack = " << stackframe.AddrStack.Offset << std::endl; - } - - SymCleanup(process); -} -#endif - - - - - namespace ioh::problem { //! Defintion interface of problems that are defined in static files @@ -209,11 +143,6 @@ namespace ioh::common if (already_defined) { std::cerr << "Error: The name '" << name << "' has already been defined in the factory.\n"; - - #if defined(_MSC_VER) - print_windows_backtrace(); - #endif - assert(!already_defined && name.c_str()); }