]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Handle EOF more gracefully in DAP
authorTom Tromey <tromey@adacore.com>
Wed, 10 Jan 2024 19:51:10 +0000 (12:51 -0700)
committerTom Tromey <tromey@adacore.com>
Mon, 22 Jan 2024 15:54:27 +0000 (08:54 -0700)
commit46bdb641642d20307521f5db2e1f1c7dcc49d5a7
treeb110f2297893f23939972947289584d8081610be
parent8f42049a8230baf871ccb66b4e607bd2ebcd99ab
Handle EOF more gracefully in DAP

A user pointed out that gdb will print a Python exception when it gets
an EOF in DAP mode.  And, it turns out that an EOF like this also
causes gdb not to exit.  This is due to the refactoring that moved the
JSON reader to its own thread -- previously this caused an exception
to propagate and cause an exit, but now it just leaves the reader
hung.

This patch fixes these problems by arranging to handle EOF more
gracefully.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31217
gdb/python/lib/gdb/dap/io.py
gdb/python/lib/gdb/dap/server.py
gdb/testsuite/gdb.dap/eof.exp [new file with mode: 0644]
gdb/testsuite/lib/dap-support.exp