[0/6] Implement DAP cancellation

Message ID 20231201-dap-cancel-v1-0-872022fc328a@adacore.com
Headers
Series Implement DAP cancellation |

Message

Tom Tromey Dec. 1, 2023, 3:40 p.m. UTC
  DAP specifies a way to cancel requests.  Previously, I didn't
implement this, because it didn't seem necessary.  However, I realized
later that a 'repl' evaluation can cause the inferior to continue (or
gdb to invoke a long-running CLI or Python command), and a request
like this will not finish -- cancellation is necessary.

This series implements this feature.  I've split it into bite-sized
pieces.

Tested on x86-64 Fedora 38.

---
Tom Tromey (6):
      Clean up handling of DAP not-stopped response
      Move DAP JSON reader to its own thread
      Introduce gdb.interrupt
      Rename a couple of DAP procs in the testsuite
      Catch BaseException in send_gdb_with_response
      Implement DAP cancellation

 gdb/NEWS                          |   2 +
 gdb/doc/gdb.texinfo               |  16 ++++++
 gdb/doc/python.texi               |  11 ++++
 gdb/python/lib/gdb/dap/server.py  | 115 ++++++++++++++++++++++++++++++++++++--
 gdb/python/lib/gdb/dap/startup.py |   4 +-
 gdb/python/python.c               |  19 +++++++
 gdb/testsuite/gdb.dap/pause.exp   |  71 +++++++++++++++++++++++
 gdb/testsuite/lib/dap-support.exp |  10 ++--
 8 files changed, 236 insertions(+), 12 deletions(-)
---
base-commit: 946df73fa09e782b15f75fc82729bff6a00d2554
change-id: 20231201-dap-cancel-2c292d80ba37

Best regards,
  

Comments

Kévin Le Gouguec Dec. 5, 2023, 9:17 a.m. UTC | #1
Tom Tromey <tromey@adacore.com> writes:

> DAP specifies a way to cancel requests.  Previously, I didn't
> implement this, because it didn't seem necessary.  However, I realized
> later that a 'repl' evaluation can cause the inferior to continue (or
> gdb to invoke a long-running CLI or Python command), and a request
> like this will not finish -- cancellation is necessary.
>
> This series implements this feature.  I've split it into bite-sized
> pieces.
>
> Tested on x86-64 Fedora 38.
>
> ---
> Tom Tromey (6):
>       Clean up handling of DAP not-stopped response
>       Move DAP JSON reader to its own thread
>       Introduce gdb.interrupt
>       Rename a couple of DAP procs in the testsuite
>       Catch BaseException in send_gdb_with_response
>       Implement DAP cancellation
>
>  gdb/NEWS                          |   2 +
>  gdb/doc/gdb.texinfo               |  16 ++++++
>  gdb/doc/python.texi               |  11 ++++
>  gdb/python/lib/gdb/dap/server.py  | 115 ++++++++++++++++++++++++++++++++++++--
>  gdb/python/lib/gdb/dap/startup.py |   4 +-
>  gdb/python/python.c               |  19 +++++++
>  gdb/testsuite/gdb.dap/pause.exp   |  71 +++++++++++++++++++++++
>  gdb/testsuite/lib/dap-support.exp |  10 ++--
>  8 files changed, 236 insertions(+), 12 deletions(-)
> ---
> base-commit: 946df73fa09e782b15f75fc82729bff6a00d2554
> change-id: 20231201-dap-cancel-2c292d80ba37
>
> Best regards,

Beside my remark re. BaseException, nothing more to add, this looks good
to me.  For the series:

Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>