/*========================== begin_copyright_notice ============================
Copyright (C) 2026 Intel Corporation

SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/

/*!
 * @file A GTPin tool which indicates tool-application target mismatch error.
 * 
 * This tool should not be loaded as part of GTPin run. Its only purpose is to
 * provide a clear error message when a user attempts to load a GTPin tool built
 * for a different target architecture than that of the application.
 */

#include "gtpin_api.h"

#if defined(TARGET_IA32)
std::string app_arch("32-bit");
std::string tool_arch("64-bit");
#else
std::string app_arch("64-bit");
std::string tool_arch("32-bit");
#endif

/* ============================================================================================= */
// GTPin_Entry
/* ============================================================================================= */
EXPORT_C_FUNC void GTPin_Entry(int argc, const char *argv[])
{
    (void)argc;
    (void)argv;
    GTPIN_ERROR_MSG("Target mismatch between gtpin tool (" + tool_arch + ") and application (" + app_arch + ").");
}
