diff --git a/requirements.txt b/requirements.txt index ca7ce590ae9b..a87c0b56d744 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,15 +19,18 @@ pyparsing>=2.0.3,<2.4.0 pyelftools>=0.22 idf-component-manager~=1.0 -gdbgui==0.13.2.0 +gdbgui==0.13.2.0; python_version < "3.11" # 0.13.2.1 supports Python 3.6+ only # Windows is not supported since 0.14.0.0. See https://github.com/cs01/gdbgui/issues/348 -pygdbmi<=0.9.0.2 +pygdbmi<=0.9.0.2; python_version < "3.11" # The pygdbmi required max version 0.9.0.2 since 0.9.0.3 is not compatible with latest gdbgui (>=0.13.2.0) # A compatible Socket.IO should be used. See https://github.com/miguelgrinberg/python-socketio/issues/578 -python-socketio<5 -jinja2<3.1 # See https://github.com/espressif/esp-idf/issues/8760 -itsdangerous<2.1 +python-socketio<5; python_version < "3.11" +jinja2<3.1; python_version < "3.11" # See https://github.com/espressif/esp-idf/issues/8760 +itsdangerous<2.1; python_version < "3.11" + +# gdbgui is not supported on Python 3.11. See https://github.com/cs01/gdbgui/issues/447 +pygdbmi<=0.9.0.2; python_version > "3.10" kconfiglib==13.7.1 diff --git a/tools/idf_py_actions/debug_ext.py b/tools/idf_py_actions/debug_ext.py index 53b94e810a3f..d13fae40c766 100644 --- a/tools/idf_py_actions/debug_ext.py +++ b/tools/idf_py_actions/debug_ext.py @@ -210,8 +210,12 @@ def gdbui(action, ctx, args, gdbgui_port, gdbinit, require_openocd): env['PURE_PYTHON'] = '1' try: process = subprocess.Popen(args, stdout=gdbgui_out, stderr=subprocess.STDOUT, bufsize=1, env=env) - except Exception as e: + except (OSError, subprocess.CalledProcessError) as e: print(e) + if sys.version_info[:2] >= (3, 11): + raise SystemExit('Unfortunately, gdbgui is supported only with Python 3.10 or older. ' + 'See: https://github.com/espressif/esp-idf/issues/10116. ' + 'Please use "idf.py gdb" or debug in Eclipse/Vscode instead.') raise FatalError('Error starting gdbgui. Please make sure gdbgui can be started', ctx) processes['gdbgui'] = process