From 3fdf02fd5105669367331fb8082480619fd423e5 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Sat, 20 Feb 2016 01:08:55 -0800 Subject: [PATCH] Resolve pyconfig pain point in Windows build scenario --- src/_frida.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/_frida.c b/src/_frida.c index 10b4fa3..8c4944d 100644 --- a/src/_frida.c +++ b/src/_frida.c @@ -14,6 +14,21 @@ #ifdef _POSIX_C_SOURCE # undef _POSIX_C_SOURCE #endif + +/* + * Don't propogate _DEBUG state to pyconfig as it incorrectly attempts to load + * debug libraries that don't normally ship with Python (e.g. 2.x). Debuggers + * wishing to spelunk the Python core can override this workaround by defining + * _FRIDA_ENABLE_PYDEBUG. + */ +#if defined (_DEBUG) && !defined (_FRIDA_ENABLE_PYDEBUG) +# undef _DEBUG +# include +# define _DEBUG +#else +# include +#endif + #include #include #ifdef _MSC_VER