[00/25] Many updates to DAP implementation

Message ID 20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com
Headers
Series Many updates to DAP implementation |

Message

Tom Tromey May 24, 2023, 4:36 p.m. UTC
  I've been working steadily on the DAP implementation.  This series
combines a number of patches.

It starts with some general refactoring of Ada catchpoints, to make
them work more like C++ catchpoints.  In particular, now they can be
set before the inferior has started.  This is then used to implement
the DAP setExceptionBreakpoints request.

Other patches add DAP features.  In some cases a new Python API is
added so that it can be used by DAP.

I do have some more patches to come after this series goes in.

Regression tested on x86-64 Fedora 36.

---
Tom Tromey (25):
      Stop gdb in gnat_runtime_has_debug_info
      Use gnat_runtime_has_debug_info in Ada catchpoint tests
      Pass tempflag to ada_catchpoint constructor
      Transfer ownership of exception string to ada_catchpoint
      Combine create_excep_cond_exprs and ada_catchpoint::re_set
      Turn should_stop_exception into a method of ada_catchpoint
      Mark members of ada_catchpoint "private"
      Don't require inferior execution for Ada catchpoints
      Implement DAP setExceptionBreakpoints request
      Implement DAP attach request
      Implement DAP stepOut request
      Add singleThread support to some DAP requests
      Rename one DAP function
      Add test for DAP pause request
      Fix a latent bug in DAP request decorator
      Use tuples for default arguments in DAP
      Add type-checking to DAP requests
      Add gdb.Value.assign method
      Implement DAP setExpression request
      Handle DAP supportsVariableType capability
      Add "target" parameter to DAP attach request
      Add "stop at main" extension to DAP launch request
      Implement DAP breakpointLocations request
      Do not report totalFrames from DAP stackTrace request
      Implement DAP conditional breakpoints

 gdb/NEWS                                       |   2 +
 gdb/ada-lang.c                                 | 210 +++++++++----------------
 gdb/ada-lang.h                                 |   2 +-
 gdb/data-directory/Makefile.in                 |   2 +
 gdb/doc/gdb.texinfo                            |  17 ++
 gdb/doc/python.texi                            |   6 +
 gdb/mi/mi-cmd-catch.c                          |   4 +-
 gdb/python/lib/gdb/dap/__init__.py             |   1 +
 gdb/python/lib/gdb/dap/breakpoint.py           | 143 ++++++++++++++---
 gdb/python/lib/gdb/dap/bt.py                   |  14 +-
 gdb/python/lib/gdb/dap/disassemble.py          |   7 +-
 gdb/python/lib/gdb/dap/evaluate.py             |  38 ++++-
 gdb/python/lib/gdb/dap/launch.py               |  42 ++++-
 gdb/python/lib/gdb/dap/locations.py            |  45 ++++++
 gdb/python/lib/gdb/dap/memory.py               |   4 +-
 gdb/python/lib/gdb/dap/next.py                 |  51 ++++--
 gdb/python/lib/gdb/dap/scopes.py               |   2 +-
 gdb/python/lib/gdb/dap/server.py               |  24 ++-
 gdb/python/lib/gdb/dap/typecheck.py            |  88 +++++++++++
 gdb/python/lib/gdb/dap/varref.py               |   3 +
 gdb/python/py-value.c                          |  30 ++++
 gdb/testsuite/gdb.ada/catch_assert_if.exp      |  28 +---
 gdb/testsuite/gdb.ada/catch_ex.exp             |  18 +--
 gdb/testsuite/gdb.ada/catch_ex_std.exp         |  27 +---
 gdb/testsuite/gdb.ada/excep_handle.exp         |  24 +--
 gdb/testsuite/gdb.ada/mi_catch_assert.exp      |  33 +---
 gdb/testsuite/gdb.ada/mi_catch_ex.exp          |  31 +---
 gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp     |  32 +---
 gdb/testsuite/gdb.ada/mi_ex_cond.exp           |  33 +---
 gdb/testsuite/gdb.dap/attach.c                 |  25 +++
 gdb/testsuite/gdb.dap/attach.exp               |  36 +++++
 gdb/testsuite/gdb.dap/basic-dap.c              |  12 +-
 gdb/testsuite/gdb.dap/basic-dap.exp            |  35 ++++-
 gdb/testsuite/gdb.dap/catch-exception.exp      |  66 ++++++++
 gdb/testsuite/gdb.dap/catch-exception/pck.ads  |  18 +++
 gdb/testsuite/gdb.dap/catch-exception/prog.adb |  44 ++++++
 gdb/testsuite/gdb.dap/cond-bp.c                |  26 +++
 gdb/testsuite/gdb.dap/cond-bp.exp              |  65 ++++++++
 gdb/testsuite/gdb.dap/pause.exp                |  41 +++++
 gdb/testsuite/gdb.dap/remote-dap.exp           |  49 ++++++
 gdb/testsuite/gdb.dap/stop-at-main.exp         |  37 +++++
 gdb/testsuite/gdb.dap/type_check.exp           |  29 ++++
 gdb/testsuite/gdb.dap/type_check.py            |  96 +++++++++++
 gdb/testsuite/gdb.python/py-value.exp          |  14 ++
 gdb/testsuite/lib/ada.exp                      |   2 +
 gdb/testsuite/lib/dap-support.exp              |  43 ++++-
 46 files changed, 1199 insertions(+), 400 deletions(-)
---
base-commit: 389971df23ca74092314dbde1303310a33766ba7
change-id: 20230427-ada-catch-exception-89d3649d3cad

Best regards,
  

Comments

Tom Tromey June 12, 2023, 6:11 p.m. UTC | #1
>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> I've been working steadily on the DAP implementation.  This series
Tom> combines a number of patches.

Tom> It starts with some general refactoring of Ada catchpoints, to make
Tom> them work more like C++ catchpoints.  In particular, now they can be
Tom> set before the inferior has started.  This is then used to implement
Tom> the DAP setExceptionBreakpoints request.

Tom> Other patches add DAP features.  In some cases a new Python API is
Tom> added so that it can be used by DAP.

Tom> I do have some more patches to come after this series goes in.

Tom> Regression tested on x86-64 Fedora 36.

I rebased this and re-tested it.  I'm checking it in now.

I have some more DAP patches to send after this, but not very many now.

Tom