public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive
@ 2023-05-19 15:06 tromey at sourceware dot org
  2023-06-05 15:15 ` [Bug dap/30472] " tromey at sourceware dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-05-19 15:06 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30472
           Summary: DAP "repl" evaluation can make gdb unresponsive
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: dap
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

gdb implements the "repl" context for the "evaluate" request
by passing the string to gdb as a command.
However, if the command is something like "continue", gdb will
simply continue -- but the DAP thread will presumably wait,
because eval_request uses send_gdb_with_response.

At least... I think this should happen.  Step 1 would be to write
a test for this.  Then, if it fails, some solution would have to
be found.  Perhaps a global flag to automatically treat continue
commands as if they had a "&" would work.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
@ 2023-06-05 15:15 ` tromey at sourceware dot org
  2023-06-05 15:40 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-06-05 15:15 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
It occurs to me that this could also happen with the "target"
command, and for that one, "&" isn't implemented.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
  2023-06-05 15:15 ` [Bug dap/30472] " tromey at sourceware dot org
@ 2023-06-05 15:40 ` tromey at sourceware dot org
  2023-07-27 19:43 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-06-05 15:40 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
See bug#7251.  Bug #7253 is also maybe relevant.

Maybe it would be enough to use send_gdb and then
have any output from the command be sent as output
events, not in the response.  Then the reader thread
could accept interrupt requests.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
  2023-06-05 15:15 ` [Bug dap/30472] " tromey at sourceware dot org
  2023-06-05 15:40 ` tromey at sourceware dot org
@ 2023-07-27 19:43 ` tromey at sourceware dot org
  2023-11-06 21:19 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-07-27 19:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Most of the problem could be solved by noticing when
the inferior continues and telling the DAP response that
it is done.
This wouldn't help with the "target" problem though.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (2 preceding siblings ...)
  2023-07-27 19:43 ` tromey at sourceware dot org
@ 2023-11-06 21:19 ` tromey at sourceware dot org
  2023-11-06 21:20 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-11-06 21:19 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I realized somewhat belatedly that this problem also
affects evaluation of expressions that involve an
inferior call.  These can't be handled by changing
how the output is directed.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (3 preceding siblings ...)
  2023-11-06 21:19 ` tromey at sourceware dot org
@ 2023-11-06 21:20 ` tromey at sourceware dot org
  2023-11-07 14:11 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-11-06 21:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I was thinking this could be handled by implementing cancellation,
but that will give weird results when used to interrupt an
inferior call.  Like, I suppose it would work, but the inferior
will be left in a somewhat weird state.

Also it seems a little strange to use cancellation to interrupt
a gdb CLI "continue" but not a DAP "continue".

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (4 preceding siblings ...)
  2023-11-06 21:20 ` tromey at sourceware dot org
@ 2023-11-07 14:11 ` tromey at sourceware dot org
  2023-11-16 20:58 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-11-07 14:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Tom Tromey from comment #5)

> Also it seems a little strange to use cancellation to interrupt
> a gdb CLI "continue" but not a DAP "continue".

I go back and forth on this, but I suppose the difference is
that a repl evaluation of "continue" won't return a result,
so cancel would be correct.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (5 preceding siblings ...)
  2023-11-07 14:11 ` tromey at sourceware dot org
@ 2023-11-16 20:58 ` tromey at sourceware dot org
  2023-12-01 15:41 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-11-16 20:58 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
I'm working on this.

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (6 preceding siblings ...)
  2023-11-16 20:58 ` tromey at sourceware dot org
@ 2023-12-01 15:41 ` tromey at sourceware dot org
  2023-12-11 18:54 ` cvs-commit at gcc dot gnu.org
  2023-12-11 18:55 ` tromey at sourceware dot org
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-12-01 15:41 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-December/204689.html

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (7 preceding siblings ...)
  2023-12-01 15:41 ` tromey at sourceware dot org
@ 2023-12-11 18:54 ` cvs-commit at gcc dot gnu.org
  2023-12-11 18:55 ` tromey at sourceware dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-11 18:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Sourceware Commits <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=1c79c8dad90e4382100b51694a2b9ee7e913a04a

commit 1c79c8dad90e4382100b51694a2b9ee7e913a04a
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Nov 7 10:56:07 2023 -0700

    Implement DAP cancellation

    This implements DAP cancellation.  A new object is introduced that
    handles the details of cancellation.  While cancellation is inherently
    racy, this code attempts to make it so that gdb doesn't inadvertently
    cancel the wrong request.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30472
    Approved-By: Eli Zaretskii <eliz@gnu.org>
    Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>

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

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

* [Bug dap/30472] DAP "repl" evaluation can make gdb unresponsive
  2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
                   ` (8 preceding siblings ...)
  2023-12-11 18:54 ` cvs-commit at gcc dot gnu.org
@ 2023-12-11 18:55 ` tromey at sourceware dot org
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at sourceware dot org @ 2023-12-11 18:55 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |15.1
             Status|NEW                         |RESOLVED

--- Comment #10 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] 11+ messages in thread

end of thread, other threads:[~2023-12-11 18:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 15:06 [Bug dap/30472] New: DAP "repl" evaluation can make gdb unresponsive tromey at sourceware dot org
2023-06-05 15:15 ` [Bug dap/30472] " tromey at sourceware dot org
2023-06-05 15:40 ` tromey at sourceware dot org
2023-07-27 19:43 ` tromey at sourceware dot org
2023-11-06 21:19 ` tromey at sourceware dot org
2023-11-06 21:20 ` tromey at sourceware dot org
2023-11-07 14:11 ` tromey at sourceware dot org
2023-11-16 20:58 ` tromey at sourceware dot org
2023-12-01 15:41 ` tromey at sourceware dot org
2023-12-11 18:54 ` cvs-commit at gcc dot gnu.org
2023-12-11 18:55 ` 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).