gdbgui
gdbgui copied to clipboard
gdbgui fails with an unhandled UnicodeDecodeError
When debugging some c++ code via gdbgui, gdbgui ceases to work and I get a popup informing that "The connection to the gdb session has been closed. This tab will no longer function as expected". I have to restart gdbgui to recover.
The terminal in which gdbgui is running offers these diagnostics:
'utf-8' codec can't decode byte 0x90 in position 2006: invalid start byte Traceback (most recent call last): File "/home/jim/.local/pipx/venvs/gdbgui/lib/python3.8/site-packages/gdbgui/server/app.py", line 284, in check_and_forward_pty_output response = debug_session.pty_for_debugged_program.read() File "/home/jim/.local/pipx/venvs/gdbgui/lib/python3.8/site-packages/gdbgui/server/ptylib.py", line 78, in read response = os.read(self.stdout, self.max_read_bytes).decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2006: invalid start byte
Patching the relevant section in ptylib.py to intercept that error as demonstrated in the attached patch prevents the utf8 conversion issue from crashing gdbgui. But maybe there's a better fix I'm not aware of.
Can you create a PR with that, please?