diff --git a/idapyswitch.cpp b/idapyswitch.cpp index adeb39c..24bd8d7 100644 --- a/idapyswitch.cpp +++ b/idapyswitch.cpp @@ -273,6 +273,23 @@ struct pyver_tool_t { do_find_python_libs(result); + // Remove Python 3.9 entries + { + auto p = result->entries.begin(); + while ( p != result->entries.end() ) + { + const pylib_entry_t &e = *p; + if ( e.version.major == 3 && e.version.minor >= 9 ) + { + out("Ignoring unusable Python 3.9.x \"%s\"\n", + !e.paths.empty() ? e.paths[0].c_str() : "?"); + p = result->entries.erase(p); + } + else + ++p; + } + } + #ifdef __UNIX__ set_preferred_pylib_version(result); #endif @@ -323,7 +340,14 @@ bool pyver_tool_t::do_pick_sip( const pylib_entry_t &entry, qstring *errbuf) const { - const char *src_sip_subdir = entry.version.minor >= 8 ? "python_3.8" : "python_3.4"; + if ( entry.version.minor >= 9 ) + { + errbuf->sprnt("IDAPython 7.5 is incompatible with Python 3.9.x"); + return false; + } + + const char *src_sip_subdir = entry.version.minor >= 8 ? "python_3.8" + : "python_3.4"; char src_sip_path[QMAXPATH]; qmakepath(src_sip_path, sizeof(src_sip_path), idadir(""), "python", "3", "PyQt5", src_sip_subdir, "sip" PY_MODULE_EXT, nullptr); diff --git a/makefile b/makefile index 00446dd..4701403 100644 --- a/makefile +++ b/makefile @@ -846,7 +846,7 @@ endif PYDOC_INJECTIONS_IDAT_CMD=$(USE_PYTHON2_ENVVAR) $(IDAT_CMD) $(BATCH_SWITCH) "-OIDAPython:AUTOIMPORT_COMPAT_IDA695=NO" -S"$< $@ $(ST_WRAP) $(DUMPDOC_IS_64)" -t -L$(F)dumpdoc.log >/dev/null pydoc_injections: $(ST_PYDOC_INJECTIONS) $(ST_PYDOC_INJECTIONS): tools/dumpdoc.py $(IDAPYTHON_MODULES) $(PYTHON_BINARY_MODULES) -ifeq ($(or $(__CODE_CHECKER__),$(NO_CMP_API),$(__ASAN__)),) +ifeq ($(or $(__CODE_CHECKER__),$(NO_CMP_API),$(__ASAN__),$(IDAHOME)),) $(QPYDOC_INJECTIONS)$(PYDOC_INJECTIONS_IDAT_CMD) || \ (echo "Command \"$(PYDOC_INJECTIONS_IDAT_CMD)\" failed. Check \"$(F)dumpdoc.log\" for details." && false) $(Q)(diff -w $(PYDOC_INJECTIONS) $(ST_PYDOC_INJECTIONS)) > /dev/null || \ diff --git a/out_of_tree/parsed_notifications.zip b/out_of_tree/parsed_notifications.zip index 9c3875a..2e6358d 100644 Binary files a/out_of_tree/parsed_notifications.zip and b/out_of_tree/parsed_notifications.zip differ diff --git a/pydoc_injections2.txt b/pydoc_injections2.txt index 7b66e42..be60700 100644 --- a/pydoc_injections2.txt +++ b/pydoc_injections2.txt @@ -29772,11 +29772,10 @@ class mcallarg_t(mop_t) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) @@ -31781,11 +31780,10 @@ class mop_addr_t(mop_t) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) @@ -32590,11 +32588,10 @@ class mop_t(__builtin__.object) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) diff --git a/pydoc_injections3.txt b/pydoc_injections3.txt index 37fc366..f9e1c72 100644 --- a/pydoc_injections3.txt +++ b/pydoc_injections3.txt @@ -29822,11 +29822,10 @@ class mcallarg_t(mop_t) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' @@ -31826,11 +31825,10 @@ class mop_addr_t(mop_t) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' @@ -32640,11 +32638,10 @@ class mop_t(builtins.object) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' diff --git a/release_pydoc_injections2.txt b/release_pydoc_injections2.txt index 52acfc4..9b0c355 100644 --- a/release_pydoc_injections2.txt +++ b/release_pydoc_injections2.txt @@ -28779,11 +28779,10 @@ class mcallarg_t(mop_t) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) @@ -30788,11 +30787,10 @@ class mop_addr_t(mop_t) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) @@ -31597,11 +31595,10 @@ class mop_t(__builtin__.object) | make_fpnum(self, *args) | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) diff --git a/release_pydoc_injections3.txt b/release_pydoc_injections3.txt index 0719188..49b1bd4 100644 --- a/release_pydoc_injections3.txt +++ b/release_pydoc_injections3.txt @@ -28825,11 +28825,10 @@ class mcallarg_t(mop_t) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' @@ -30829,11 +30828,10 @@ class mop_addr_t(mop_t) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' @@ -31643,11 +31641,10 @@ class mop_t(builtins.object) | make_fpnum(self, *args) -> 'bool' | Create a floating point constant operand. | - | make_fpnum(self, bytes, _size) -> bool + | make_fpnum(self, bytes) -> bool | @param bytes: pointer to the floating point value as used by the | current processor (e.g. for x86 it must be in IEEE 754) | (C++: const void *) - | @param _size: number of bytes occupied by the constant. (C++: size_t) | @return: success | | make_gvar(self, *args) -> 'void' diff --git a/swig/hexrays.i b/swig/hexrays.i index a9db474..448f777 100644 --- a/swig/hexrays.i +++ b/swig/hexrays.i @@ -210,9 +210,12 @@ SWIGINTERN void __raise_vdf(const vd_failure_t &e) %define_hexrays_lifecycle_object(mba_t); #ifdef PY3 %const_void_pointer_and_size(uchar, bytes, nbytes); +%const_void_pointer_and_size(void, bytes, _size); #else %apply (char *STRING, int LENGTH) { (const uchar *bytes, size_t nbytes) }; %apply Pointer NONNULL { const uchar *bytes }; +%apply (char *STRING, int LENGTH) { (const void *bytes, size_t _size) }; +%apply Pointer NONNULL { const void *bytes }; #endif %define_hexrays_lifecycle_object(valrng_t);