From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B57E53858D38; Mon, 6 Feb 2023 17:23:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B57E53858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675704212; bh=R0PI3BRBIXF2g9LBuNRM9A1HkYX7Wo7e1G5Npe1Wnas=; h=From:To:Subject:Date:From; b=SpD12YXZGYGmMLjc9SMjzWMkllJcmnlTnR7FNGKFOdF4LrMMQQGETcwTxG0fHcFSG z6DGMeVvF48Hb1bX6pJTgRotCWgyOPHZQB7pwf2n4MqT0TZ5Zg6F8rOWy7UwPXUfpL P09HGf7+TO/koY4U6kA3gYKtaOZKJvnPiD95ghhE= From: "pedro at palves dot net" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30086 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=20 Num Type Disp Enb Address What 1 breakpoint keep y thread 1 stop only in thread 1.1 1.1 y 0x0000000000001285 in main at=20 gdb.multi/goodbye.c:61 inf 2 1.2 y 0x00005555555551f0 in main at=20 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=20 Num Type Disp Enb Address What 1 breakpoint keep y 0x00005555555551f0 in main at=20 gdb.multi/hello.c:51 thread 1 stop only in thread 1 --=20 You are receiving this mail because: You are on the CC list for the bug.=