public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v3 0/5] Fix DAP pause bug
Date: Tue, 20 Feb 2024 12:46:11 -0700	[thread overview]
Message-ID: <20240220-py-simple-exc-v3-0-a2825caa4b74@adacore.com> (raw)

Tom de Vries pointed out that the DAP pause.exp test wasn't actually
testing interruption of Python.  Digging into this revealed that the
"python" and "source" commands don't handle Python exceptions in the
normal way (in gdb terms).

This series changes how these are implemented and fixes the original
problem that Tom pointed out.

Tested on x86-64 Fedora 38.

---
Changes in v3:
- Fix style.exp failure when Pygments is missing, pointed out by CI
- Link to v2: https://inbox.sourceware.org/gdb-patches/20240220-py-simple-exc-v2-0-c672f1984b4d@adacore.com

Changes in v2:
- Renamed new function in first patch
- Link to v1: https://inbox.sourceware.org/gdb-patches/20240216-py-simple-exc-v1-0-c275bcfb5e4a@adacore.com

---
Tom Tromey (5):
      Introduce read_remainder_of_file
      Fix formatting buglet in python.c
      kfail a FinishBreakpoint test
      Rewrite "python" command exception handling
      Use the .py file in gdb.dap/pause.exp

 gdb/python/lib/gdb/__init__.py                    |  27 ------
 gdb/python/python.c                               | 111 +++++++++-------------
 gdb/testsuite/gdb.ada/tasks.exp                   |   8 +-
 gdb/testsuite/gdb.dap/pause.exp                   |   2 +-
 gdb/testsuite/gdb.python/py-arch.exp              |   2 +-
 gdb/testsuite/gdb.python/py-block.exp             |   4 +-
 gdb/testsuite/gdb.python/py-breakpoint.exp        |  18 ++--
 gdb/testsuite/gdb.python/py-connection.exp        |   8 +-
 gdb/testsuite/gdb.python/py-disasm.exp            |  32 +++----
 gdb/testsuite/gdb.python/py-error.exp             |   9 +-
 gdb/testsuite/gdb.python/py-finish-breakpoint.exp |   8 +-
 gdb/testsuite/gdb.python/py-format-address.exp    |  28 +++---
 gdb/testsuite/gdb.python/py-format-string.exp     |   8 +-
 gdb/testsuite/gdb.python/py-frame.exp             |  18 ++--
 gdb/testsuite/gdb.python/py-inferior.exp          |  24 ++---
 gdb/testsuite/gdb.python/py-lazy-string.exp       |   6 +-
 gdb/testsuite/gdb.python/py-mi-cmd.exp            |  40 ++++----
 gdb/testsuite/gdb.python/py-missing-debug.exp     |  16 ++--
 gdb/testsuite/gdb.python/py-objfile.exp           |   2 +-
 gdb/testsuite/gdb.python/py-parameter.exp         |  14 +--
 gdb/testsuite/gdb.python/py-pp-registration.exp   |   2 +-
 gdb/testsuite/gdb.python/py-progspace-events.exp  |   2 +-
 gdb/testsuite/gdb.python/py-progspace.exp         |   8 +-
 gdb/testsuite/gdb.python/py-record-btrace.exp     |   4 +-
 gdb/testsuite/gdb.python/py-record-full.exp       |   4 +-
 gdb/testsuite/gdb.python/py-template.exp          |   2 +-
 gdb/testsuite/gdb.python/py-thrhandle.exp         |   2 +-
 gdb/testsuite/gdb.python/py-type.exp              |  20 ++--
 gdb/testsuite/gdb.python/py-unwind.exp            |  24 ++---
 gdb/testsuite/gdb.python/py-value.exp             |  36 +++----
 gdb/testsuite/gdb.python/python.exp               |  10 +-
 gdb/testsuite/gdb.python/tui-window-names.exp     |  16 ++--
 gdb/testsuite/gdb.python/tui-window.exp           |   2 +-
 gdb/testsuite/lib/gdb-python.exp                  |   2 +-
 gdbsupport/filestuff.cc                           |  24 +++--
 gdbsupport/filestuff.h                            |   4 +
 36 files changed, 261 insertions(+), 286 deletions(-)
---
base-commit: 94a75b0363b1e09416e9bd24cac72d98864688d8
change-id: 20240216-py-simple-exc-91903ca871f5

Best regards,
-- 
Tom Tromey <tromey@adacore.com>


             reply	other threads:[~2024-02-20 19:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 19:46 Tom Tromey [this message]
2024-02-20 19:46 ` [PATCH v3 1/5] Introduce read_remainder_of_file Tom Tromey
2024-02-27  9:33   ` Tom de Vries
2024-02-20 19:46 ` [PATCH v3 2/5] Fix formatting buglet in python.c Tom Tromey
2024-02-27  9:35   ` Tom de Vries
2024-02-20 19:46 ` [PATCH v3 3/5] kfail a FinishBreakpoint test Tom Tromey
2024-02-27  9:18   ` Tom de Vries
2024-02-20 19:46 ` [PATCH v3 4/5] Rewrite "python" command exception handling Tom Tromey
2024-02-27 10:37   ` Tom de Vries
2024-02-27 13:59     ` Tom Tromey
2024-02-20 19:46 ` [PATCH v3 5/5] Use the .py file in gdb.dap/pause.exp Tom Tromey
2024-02-27  9:36   ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240220-py-simple-exc-v3-0-a2825caa4b74@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).