Skip to content

Commit

Permalink
Merge branch 'fix/gdbgui_py3.13_v5.3' into 'release/v5.3'
Browse files Browse the repository at this point in the history
fix(tools): Print message about GDBGUI being not supported with Python 3.13 (v5.3)

See merge request espressif/esp-idf!34377
  • Loading branch information
kumekay committed Oct 23, 2024
2 parents 70a7de7 + 431cf92 commit ee72cad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 13 additions & 4 deletions tools/idf_py_actions/debug_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,23 @@ def get_gdb_args(project_desc: Dict[str, Any]) -> List:
return args

def _get_gdbgui_version(ctx: Context) -> Tuple[int, ...]:
completed_process = subprocess.run(['gdbgui', '--version'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
captured_output = completed_process.stdout.decode('utf-8', 'ignore')

if completed_process.returncode != 0:
try:
completed_process = subprocess.run(['gdbgui', '--version'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
subprocess_success = True
captured_output = completed_process.stdout.decode('utf-8', 'ignore')
except FileNotFoundError:
# This is happening at least with Python 3.12 when gdbgui is not installed
subprocess_success = False

if not subprocess_success or completed_process.returncode != 0:
if sys.version_info[:2] >= (3, 11) and sys.platform == 'win32':
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.')
if sys.version_info[:2] >= (3, 13) and sys.platform != 'win32':
raise SystemExit('Unfortunately, gdbgui is supported only with Python 3.12 or older. '
'See: https://github.com/cs01/gdbgui/issues/494. '
'Please use "idf.py gdb" or debug in Eclipse/Vscode instead.')
raise FatalError('Error starting gdbgui. Please make sure gdbgui has been installed with '
'"install.{sh,bat,ps1,fish} --enable-gdbgui" and can be started. '
f'Error: {captured_output}', ctx)
Expand Down
3 changes: 2 additions & 1 deletion tools/requirements/requirements.gdbgui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@

# gdbgui Python 3.11 issue https://github.com/cs01/gdbgui/issues/447 was fixed in 0.15.2.0. Windows users need an
# older Python to use since new gdbgui versions don't support Windows anymore.
gdbgui; sys_platform != 'win32'
# Python 3.13 is not supported: https://github.com/cs01/gdbgui/issues/494
gdbgui; sys_platform != 'win32' and python_version < "3.13"
gdbgui; sys_platform == 'win32' and python_version < "3.11"

0 comments on commit ee72cad

Please sign in to comment.