public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "pedro at palves dot net" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/30086] New: thread-specific breakpoints end up unnecessarily set in every inferior / address space
Date: Mon, 06 Feb 2023 17:23:32 +0000	[thread overview]
Message-ID: <bug-30086-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30086

            Bug ID: 30086
           Summary: thread-specific breakpoints end up unnecessarily set
                    in every inferior / address space
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: pedro at palves dot net
  Target Milestone: ---

A thread-specific breakpoint really only needs to have locations for the
address/program space of the inferior which the thread belongs to.  However, we
currently expand the breakpoint spec in every program space anyhow.  Vis:

 (gdb) b main thread 1.1
 Breakpoint 1 at 0x1285: main. (2 locations)
 (gdb) info breakpoints 
 Num     Type           Disp Enb Address            What
 1       breakpoint     keep y   <MULTIPLE>          thread 1
         stop only in thread 1.1
 1.1                         y   0x0000000000001285 in main at 
 gdb.multi/goodbye.c:61 inf 2
 1.2                         y   0x00005555555551f0 in main at 
 gdb.multi/hello.c:51 inf 1

Location 1.1 above is worse than useless, as it'll end up inserted and cause
inferior 2 to unnecessarily stop only to always be re-resumed.

We should instead end up with only one location for inferior 1, just like if
inferior 2 did not exist, like:

 (gdb) b main thread 1.1
 Breakpoint 1 at 0x5555555551f0: file  gdb.multi/hello.c, line 51.
 (gdb) info breakpoints 
 Num     Type           Disp Enb Address            What
 1       breakpoint     keep y   0x00005555555551f0 in main at 
 gdb.multi/hello.c:51 thread 1
         stop only in thread 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

                 reply	other threads:[~2023-02-06 17:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-30086-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).