From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCHv8 00/14] thread-specific breakpoints in just some inferiors
Date: Fri, 29 Dec 2023 09:26:55 +0000 [thread overview]
Message-ID: <cover.1703841366.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1702507015.git.aburgess@redhat.com>
In v8:
- Rebased onto current upstream/master branch.
- Reordered the patches a little. Patches 0 to 8 are unchanged from
previous. If there's no objections then I'm planning to merge
these some point soon as I think these are all good cleanup patches.
- Patches 9, 10, and 11 are new. These are also refactoring
commits, but are all tied pretty tightly to what is now patch 12.
- Patch 12 is the most important patch. This has had a complete
rewrite since V7 in order to address Tom's feedback. The general
idea is unchanged; the breakpoint condition string is parsed first
forwards, and then backwards, but we now have a two phase
analysis, rather than immediately parsing things like the
thread-id as we find them. This resolves this problem:
(gdb) break some_function if ( 3 == thread )
Previous GDB would try to match 'thread )' as a thread-id and give
an error that ')' as invalid. Now GDB correctly understands that
the 'thread )' is likely part of the 'if' condition, and parses it
as such.
- Patches 13 and 14 are unchanged from V7. These patches depend on
the changes in patch 12 so can't be merged without that patch.
In v7:
- Addressed all the issues except one that Baris pointed out, this
includes typos, some minor testsuite cleanups, and reformatting an
assert (but not changing the meaning).
- As requested, switched to use std::string_view in
break-parse-cond.c file instead of a custom class, I agree that
this is an improvement.
- I've not changed the handling of -force-condition flag. I replied
to the review email with my thoughts, TLDR: fixing this would be a
bigger task which I'd rather leave for ... the future.
- Rebased and retested.
In v6:
- Rebased to current master, one minor fix due to the C++17 changes,
nothing major. Retested.
In v5:
- Updates after Lancelot's feedback, including, -force-condition can
no longer be abbreviated to '-', and can't be used immediately
after the breakpoint condition.
- More tests to check some of the edge cases.
In v4:
- Big update, this series now handles thread-specific and
inferior-specific breakpoints.
In v3:
- Rebased on to current upstream/master, this includes all Simon's
recent breakpoint changes. Retested with no regressions seen.
In v2:
- Rebased on current upstream/master and retested,
- No changes to code or docs.
---
Andrew Burgess (14):
gdb: create_breakpoint: add asserts and additional comments
gdb: create_breakpoint: asserts relating to extra_string/parse_extra
gdb: change 'if' to gdb_assert in update_dprintf_command_list
gdb: the extra_string in a dprintf breakpoint is never nullptr
gdb: build dprintf commands just once in code_breakpoint constructor
gdb: don't display inferior list for pending breakpoints
gdb: remove breakpoint_re_set_one
gdb: remove tracepoint_probe_create_sals_from_location_spec
gdb: make breakpoint_debug_printf global
gdb: add another overload of startswith
gdb: create new is_thread_id helper function
gdb: parse pending breakpoint thread/task immediately
gdb: don't set breakpoint::pspace in create_breakpoint
gdb: only insert thread-specific breakpoints in the relevant inferior
gdb/Makefile.in | 2 +
gdb/NEWS | 11 +
gdb/ada-lang.c | 6 +-
gdb/break-catch-throw.c | 6 +-
gdb/break-cond-parse.c | 701 ++++++++++++++++
gdb/break-cond-parse.h | 52 ++
gdb/breakpoint.c | 773 ++++++++----------
gdb/breakpoint.h | 109 ++-
gdb/testsuite/gdb.ada/tasks.exp | 6 +-
gdb/testsuite/gdb.base/condbreak.exp | 57 +-
gdb/testsuite/gdb.base/pending.exp | 23 +-
gdb/testsuite/gdb.linespec/explicit.exp | 4 +-
gdb/testsuite/gdb.linespec/keywords.exp | 8 +-
gdb/testsuite/gdb.mi/mi-dprintf-pending.exp | 3 +-
gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp | 8 +-
.../gdb.mi/user-selected-context-sync.exp | 4 +-
.../gdb.multi/bp-thread-specific.exp | 7 +-
.../gdb.multi/inferior-specific-bp.exp | 16 +-
.../gdb.multi/multi-target-continue.exp | 2 +-
.../gdb.multi/multi-target-ping-pong-next.exp | 4 +-
.../gdb.multi/pending-bp-del-inferior.c | 28 +
.../gdb.multi/pending-bp-del-inferior.exp | 214 +++++
gdb/testsuite/gdb.multi/pending-bp-lib.c | 22 +
gdb/testsuite/gdb.multi/pending-bp.c | 66 ++
gdb/testsuite/gdb.multi/pending-bp.exp | 332 ++++++++
gdb/testsuite/gdb.multi/tids.exp | 6 +-
.../gdb.threads/del-pending-thread-bp-lib.c | 22 +
.../gdb.threads/del-pending-thread-bp.c | 85 ++
.../gdb.threads/del-pending-thread-bp.exp | 108 +++
gdb/tid-parse.c | 82 +-
gdb/tid-parse.h | 8 +
gdbsupport/common-utils.h | 10 +
32 files changed, 2279 insertions(+), 506 deletions(-)
create mode 100644 gdb/break-cond-parse.c
create mode 100644 gdb/break-cond-parse.h
create mode 100644 gdb/testsuite/gdb.multi/pending-bp-del-inferior.c
create mode 100644 gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp
create mode 100644 gdb/testsuite/gdb.multi/pending-bp-lib.c
create mode 100644 gdb/testsuite/gdb.multi/pending-bp.c
create mode 100644 gdb/testsuite/gdb.multi/pending-bp.exp
create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp-lib.c
create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp.c
create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp.exp
base-commit: 90827b4eefb06f6e0ab6cbac9eb94922e2cc8aee
--
2.25.4
next prev parent reply other threads:[~2023-12-29 9:27 UTC|newest]
Thread overview: 138+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 23:35 [PATCH 0/9] " Andrew Burgess
2023-04-28 23:35 ` [PATCH 1/9] gdb: create_breakpoint: assert for a valid thread-id Andrew Burgess
2023-04-28 23:35 ` [PATCH 2/9] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-04-28 23:35 ` [PATCH 3/9] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-04-28 23:35 ` [PATCH 4/9] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-04-28 23:35 ` [PATCH 5/9] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-04-28 23:35 ` [PATCH 6/9] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-04-29 6:01 ` Eli Zaretskii
2023-04-28 23:35 ` [PATCH 7/9] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-04-28 23:35 ` [PATCH 8/9] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-04-28 23:35 ` [PATCH 9/9] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-04-29 6:02 ` Eli Zaretskii
2023-05-15 19:27 ` [PATCHv2 0/9] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 1/9] gdb: create_breakpoint: assert for a valid thread-id Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 2/9] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 3/9] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 4/9] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 5/9] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 6/9] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 7/9] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 8/9] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-05-15 19:27 ` [PATCHv2 9/9] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 0/9] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 1/9] gdb: create_breakpoint: assert for a valid thread-id Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 2/9] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 3/9] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 4/9] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 5/9] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 6/9] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 7/9] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 8/9] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-05-30 20:46 ` [PATCHv3 9/9] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 00/10] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 01/10] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 02/10] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 03/10] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 04/10] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 05/10] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 06/10] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-08-23 16:32 ` Eli Zaretskii
2023-09-06 22:06 ` Lancelot SIX
2023-10-02 15:02 ` Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 07/10] gdb: don't set breakpoint::pspace for in create_breakpoint Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 08/10] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 09/10] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-08-23 15:59 ` [PATCHv4 10/10] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 00/10] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 01/10] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 02/10] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 03/10] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 04/10] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 05/10] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 06/10] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 07/10] gdb: don't set breakpoint::pspace for in create_breakpoint Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 08/10] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-10-03 21:29 ` [PATCHv5 09/10] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-12-02 10:42 ` [PATCHv6 00/10] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-12-02 10:42 ` [PATCHv6 01/10] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2023-12-04 19:21 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 02/10] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-12-04 19:40 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 03/10] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-12-02 10:42 ` [PATCHv6 04/10] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-12-05 8:17 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 05/10] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-12-05 8:35 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 06/10] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-12-05 15:09 ` Aktemur, Tankut Baris
2023-12-13 13:51 ` Andrew Burgess
2023-12-27 12:23 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 07/10] gdb: don't set breakpoint::pspace for in create_breakpoint Andrew Burgess
2023-12-05 16:05 ` Aktemur, Tankut Baris
2023-12-02 10:42 ` [PATCHv6 08/10] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-12-02 10:42 ` [PATCHv6 09/10] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-12-02 10:42 ` [PATCHv6 10/10] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 00/11] thread-specific breakpoints in just some inferiors Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 01/11] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 02/11] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-12-15 20:08 ` Tom Tromey
2023-12-13 22:38 ` [PATCHv7 03/11] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 04/11] gdb: the extra_string in a dprintf breakpoint is never nullptr Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 05/11] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 06/11] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 07/11] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-12-15 20:53 ` Tom Tromey
2023-12-18 11:33 ` Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 08/11] gdb: don't set breakpoint::pspace for in create_breakpoint Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 09/11] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 10/11] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-12-13 22:38 ` [PATCHv7 11/11] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2023-12-15 20:54 ` [PATCHv7 00/11] thread-specific breakpoints in just some inferiors Tom Tromey
2023-12-29 9:26 ` Andrew Burgess [this message]
2023-12-29 9:26 ` [PATCHv8 01/14] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2023-12-29 9:26 ` [PATCHv8 02/14] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2023-12-29 9:26 ` [PATCHv8 03/14] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2023-12-29 9:26 ` [PATCHv8 04/14] gdb: the extra_string in a dprintf breakpoint is never nullptr Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 05/14] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 06/14] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 07/14] gdb: remove breakpoint_re_set_one Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 08/14] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 09/14] gdb: make breakpoint_debug_printf global Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 10/14] gdb: add another overload of startswith Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 11/14] gdb: create new is_thread_id helper function Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 12/14] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 13/14] gdb: don't set breakpoint::pspace in create_breakpoint Andrew Burgess
2023-12-29 9:27 ` [PATCHv8 14/14] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 00/14] thread-specific breakpoints in just some inferiors Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 01/14] gdb: create_breakpoint: add asserts and additional comments Andrew Burgess
2024-03-31 10:26 ` Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 02/14] gdb: create_breakpoint: asserts relating to extra_string/parse_extra Andrew Burgess
2024-03-31 10:26 ` Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 03/14] gdb: change 'if' to gdb_assert in update_dprintf_command_list Andrew Burgess
2024-03-31 10:27 ` Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 04/14] gdb: the extra_string in a dprintf breakpoint is never nullptr Andrew Burgess
2024-03-31 10:27 ` Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 05/14] gdb: build dprintf commands just once in code_breakpoint constructor Andrew Burgess
2024-03-31 10:27 ` Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 06/14] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 07/14] gdb: remove breakpoint_re_set_one Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 08/14] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 09/14] gdb: make breakpoint_debug_printf global Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 10/14] gdb: add another overload of startswith Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 11/14] gdb: create new is_thread_id helper function Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 12/14] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 13/14] gdb: don't set breakpoint::pspace in create_breakpoint Andrew Burgess
2024-03-05 15:21 ` [PATCHv9 14/14] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
2024-03-05 15:49 ` Willgerodt, Felix
2024-03-06 14:11 ` Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 0/9] thread-specific breakpoints in just some inferiors Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 1/9] gdb: don't display inferior list for pending breakpoints Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 2/9] gdb: remove breakpoint_re_set_one Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 3/9] gdb: remove tracepoint_probe_create_sals_from_location_spec Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 4/9] gdb: make breakpoint_debug_printf global Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 5/9] gdb: add another overload of startswith Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 6/9] gdb: create new is_thread_id helper function Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 7/9] gdb: parse pending breakpoint thread/task immediately Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 8/9] gdb: don't set breakpoint::pspace in create_breakpoint Andrew Burgess
2024-03-31 10:31 ` [PATCHv10 9/9] gdb: only insert thread-specific breakpoints in the relevant inferior Andrew Burgess
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=cover.1703841366.git.aburgess@redhat.com \
--to=aburgess@redhat.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).