[0/9] Implement the DAP "loadedSources" request

Message ID 20230404-dap-loaded-sources-v1-0-75c796bd644b@adacore.com
Headers
Series Implement the DAP "loadedSources" request |

Message

Tom Tromey April 4, 2023, 5:08 p.m. UTC
  This series implements the DAP "loadedSources" request.  However, it
does so by exposing MI commands to Python, with MI output being
converted to Python objects via a new ui_out implementation.

Regression tested on x86-64 Fedora 36.

---
Tom Tromey (9):
      Use field_signed from Python MI commands
      Use member initializers in mi_parse
      Use accessor for mi_parse::args
      Change mi_parse_argv to a method
      Introduce "static constructor" for mi_parse
      Introduce mi_parse helper methods
      Add second mi_parse constructor
      Implement gdb.execute_mi
      Implement DAP loadedSources request

 gdb/Makefile.in                         |   1 +
 gdb/NEWS                                |   3 +
 gdb/data-directory/Makefile.in          |   1 +
 gdb/doc/python.texi                     |  29 ++++
 gdb/mi/mi-cmds.c                        |   6 +-
 gdb/mi/mi-cmds.h                        |   5 +
 gdb/mi/mi-main.c                        |  19 +-
 gdb/mi/mi-parse.c                       | 192 +++++++++++++++-----
 gdb/mi/mi-parse.h                       |  81 ++++++---
 gdb/python/lib/gdb/dap/__init__.py      |   1 +
 gdb/python/lib/gdb/dap/sources.py       |  40 +++++
 gdb/python/py-mi.c                      | 298 ++++++++++++++++++++++++++++++++
 gdb/python/py-micmd.c                   |  20 ++-
 gdb/python/python-internal.h            |   5 +
 gdb/python/python.c                     |   5 +
 gdb/testsuite/gdb.dap/basic-dap.exp     |   3 +
 gdb/testsuite/gdb.python/py-exec-mi.exp |  32 ++++
 gdb/testsuite/gdb.python/py-mi-cmd.py   |  18 ++
 18 files changed, 682 insertions(+), 77 deletions(-)
---
base-commit: 02d44d76584e4d483fe0fc677c12066ec23d67f4
change-id: 20230404-dap-loaded-sources-5d01323a1240

Best regards,
  

Comments

Matt Rice April 10, 2023, 11:43 p.m. UTC | #1
Can't comment much on the implementation, not being much of a c++ person,
But tried it out, the output looks really sane & much nicer than the
attempts I had made in the bug report,
From what I can tell, you solved most of the issues I'd run into in
that bug report by parsing the table description, and then
building the dictionaries based upon the column information which
seems like a great idea.  Very happy to see those issues
apparently resolved.

On Tue, Apr 4, 2023 at 5:09 PM Tom Tromey via Gdb-patches
<gdb-patches@sourceware.org> wrote:
>
> This series implements the DAP "loadedSources" request.  However, it
> does so by exposing MI commands to Python, with MI output being
> converted to Python objects via a new ui_out implementation.
>
> Regression tested on x86-64 Fedora 36.
>
> ---
> Tom Tromey (9):
>       Use field_signed from Python MI commands
>       Use member initializers in mi_parse
>       Use accessor for mi_parse::args
>       Change mi_parse_argv to a method
>       Introduce "static constructor" for mi_parse
>       Introduce mi_parse helper methods
>       Add second mi_parse constructor
>       Implement gdb.execute_mi
>       Implement DAP loadedSources request
>
>  gdb/Makefile.in                         |   1 +
>  gdb/NEWS                                |   3 +
>  gdb/data-directory/Makefile.in          |   1 +
>  gdb/doc/python.texi                     |  29 ++++
>  gdb/mi/mi-cmds.c                        |   6 +-
>  gdb/mi/mi-cmds.h                        |   5 +
>  gdb/mi/mi-main.c                        |  19 +-
>  gdb/mi/mi-parse.c                       | 192 +++++++++++++++-----
>  gdb/mi/mi-parse.h                       |  81 ++++++---
>  gdb/python/lib/gdb/dap/__init__.py      |   1 +
>  gdb/python/lib/gdb/dap/sources.py       |  40 +++++
>  gdb/python/py-mi.c                      | 298 ++++++++++++++++++++++++++++++++
>  gdb/python/py-micmd.c                   |  20 ++-
>  gdb/python/python-internal.h            |   5 +
>  gdb/python/python.c                     |   5 +
>  gdb/testsuite/gdb.dap/basic-dap.exp     |   3 +
>  gdb/testsuite/gdb.python/py-exec-mi.exp |  32 ++++
>  gdb/testsuite/gdb.python/py-mi-cmd.py   |  18 ++
>  18 files changed, 682 insertions(+), 77 deletions(-)
> ---
> base-commit: 02d44d76584e4d483fe0fc677c12066ec23d67f4
> change-id: 20230404-dap-loaded-sources-5d01323a1240
>
> Best regards,
> --
> Tom Tromey <tromey@adacore.com>
>