public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit
@ 2023-07-24 18:14 vmakaev at gmail dot com
  2023-07-24 18:15 ` [Bug dap/30678] " vmakaev at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-24 18:14 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30678
           Summary: DAP Server: Extra breakpoint appears when function
                    breakpoint is hit
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dap
          Assignee: unassigned at sourceware dot org
          Reporter: vmakaev at gmail dot com
  Target Milestone: ---

Created attachment 15008
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15008&action=edit
dap logs and main.rs

Repro steps:

1. put breakpoint on main::main
2. launch debugger in VSCode
3. breakpoint is hit
4. in breakpoints window we can see 1 extra breakpoint that persists after
session is ended

Note that this behaviour isn't observed with lldb dap.

In the following video I launch lldb first (which works correctly) and then gdb
with a mentioned bug
(see video https://streamable.com/kf6dyr)

Attaching logs from both dap servers and main.rs (rustc -g main.rs)

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
@ 2023-07-24 18:15 ` vmakaev at gmail dot com
  2023-07-24 18:17 ` vmakaev at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-24 18:15 UTC (permalink / raw)
  To: gdb-prs

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

Vladimir Makaev <vmakaev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org,
                   |                            |vmakaev at gmail dot com

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
  2023-07-24 18:15 ` [Bug dap/30678] " vmakaev at gmail dot com
@ 2023-07-24 18:17 ` vmakaev at gmail dot com
  2023-07-24 18:47 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-24 18:17 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Vladimir Makaev <vmakaev at gmail dot com> ---
Also you can see on the video that GDB debug session isn't ended when program
finishes, while lldb's does. Should I submit separate bug for this?

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
  2023-07-24 18:15 ` [Bug dap/30678] " vmakaev at gmail dot com
  2023-07-24 18:17 ` vmakaev at gmail dot com
@ 2023-07-24 18:47 ` tromey at sourceware dot org
  2023-07-24 18:50 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 18:47 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org
   Last reconfirmed|                            |2023-07-24

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The two traces don't seem to be from the same kind of session,
because in the gdb trace we see:

10:57:31 AM  --> setInstructionBreakpoints
{"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}

... which seems weird anyway, why would it be sending this?

However, that's just an oddity, probably not really important.
I note lldb isn't claiming "supportsInstructionBreakpoints":true,
so that probably explains it...


I'm going to guess the bug here is this event:

10:57:31 AM  <== breakpoint
{"type":"event","event":"breakpoint","body":{"reason":"new","breakpoint":{"id":1,"verified":true,"source":{"name":"main.rs","sourceReference":0,"path":"/home/vmakaev/gdb-test/src/main.rs"},"line":2,"instructionReference":"0x80f7"}},"seq":20}


Probably this ought to be suppressed since it is also the
response to setFunctionBreakpoints.

At the same time, it seems like the client should note that two
breakpoints have the same "id" and ignore one.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (2 preceding siblings ...)
  2023-07-24 18:47 ` tromey at sourceware dot org
@ 2023-07-24 18:50 ` tromey at sourceware dot org
  2023-07-24 19:28 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 18:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Vladimir Makaev from comment #1)
> Also you can see on the video that GDB debug session isn't ended when
> program finishes, while lldb's does. Should I submit separate bug for this?

Probably best.
I didn't really understand what to look for in the video.
From the log maybe it's the lack of a terminated event?
A separate bug would let us investigate it with a separate patch
I suppose.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (3 preceding siblings ...)
  2023-07-24 18:50 ` tromey at sourceware dot org
@ 2023-07-24 19:28 ` tromey at sourceware dot org
  2023-07-24 22:29 ` vmakaev at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 19:28 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Created attachment 15009
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15009&action=edit
patch

Can you try this patch?
This is based on the theory that the "new breakpoint" event is
the cause of the problem.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (4 preceding siblings ...)
  2023-07-24 19:28 ` tromey at sourceware dot org
@ 2023-07-24 22:29 ` vmakaev at gmail dot com
  2023-07-25 12:47 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-24 22:29 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Vladimir Makaev <vmakaev at gmail dot com> ---
It works! Thanks!

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (5 preceding siblings ...)
  2023-07-24 22:29 ` vmakaev at gmail dot com
@ 2023-07-25 12:47 ` tromey at sourceware dot org
  2023-07-25 13:50 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-25 12:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Vladimir Makaev from comment #1)
> Also you can see on the video that GDB debug session isn't ended when
> program finishes, while lldb's does. Should I submit separate bug for this?

I filed https://sourceware.org/bugzilla/show_bug.cgi?id=30681

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (6 preceding siblings ...)
  2023-07-25 12:47 ` tromey at sourceware dot org
@ 2023-07-25 13:50 ` tromey at sourceware dot org
  2023-07-26 15:58 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-25 13:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-July/201097.html

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (7 preceding siblings ...)
  2023-07-25 13:50 ` tromey at sourceware dot org
@ 2023-07-26 15:58 ` tromey at sourceware dot org
  2023-08-01 18:56 ` cvs-commit at gcc dot gnu.org
  2023-08-01 18:56 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-07-26 15:58 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (8 preceding siblings ...)
  2023-07-26 15:58 ` tromey at sourceware dot org
@ 2023-08-01 18:56 ` cvs-commit at gcc dot gnu.org
  2023-08-01 18:56 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-01 18:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8a8a5ccadd18b9f1ecb7943bf56fad29c6f529bc

commit 8a8a5ccadd18b9f1ecb7943bf56fad29c6f529bc
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Jul 24 13:28:58 2023 -0600

    Do not send "new breakpoint" event when breakpoint is set

    When the DAP client sets a breakpoint, gdb currently sends a "new
    breakpoint" event.  However, Vladimir Makaev discovered that this
    causes VSCode to think there are two breakpoints.

    This patch changes gdb to suppress the event in this case.

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

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dap/30678] DAP Server: Extra breakpoint appears when function breakpoint is hit
  2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
                   ` (9 preceding siblings ...)
  2023-08-01 18:56 ` cvs-commit at gcc dot gnu.org
@ 2023-08-01 18:56 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-08-01 18:56 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-08-01 18:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 18:14 [Bug dap/30678] New: DAP Server: Extra breakpoint appears when function breakpoint is hit vmakaev at gmail dot com
2023-07-24 18:15 ` [Bug dap/30678] " vmakaev at gmail dot com
2023-07-24 18:17 ` vmakaev at gmail dot com
2023-07-24 18:47 ` tromey at sourceware dot org
2023-07-24 18:50 ` tromey at sourceware dot org
2023-07-24 19:28 ` tromey at sourceware dot org
2023-07-24 22:29 ` vmakaev at gmail dot com
2023-07-25 12:47 ` tromey at sourceware dot org
2023-07-25 13:50 ` tromey at sourceware dot org
2023-07-26 15:58 ` tromey at sourceware dot org
2023-08-01 18:56 ` cvs-commit at gcc dot gnu.org
2023-08-01 18:56 ` tromey at sourceware dot org

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).