public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/31554] New: gdbserver --once --multi mishandles run & attach failures
@ 2024-03-25 18:19 pedro at palves dot net
  2024-03-25 18:20 ` [Bug server/31554] " pedro at palves dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pedro at palves dot net @ 2024-03-25 18:19 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31554
           Summary: gdbserver --once --multi mishandles run & attach
                    failures
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: pedro at palves dot net
  Target Milestone: ---

"gdbserver --once --multi" mishandles run or attach failures.  GDBserver
exits/disconnects on run/attach failure, but it should not.  From --help:

  --multi               Start server without a specific program, and
                        only quit when explicitly commanded.
  --once                Exit after the first connection has closed.


E.g., for "run":

    On GDB side:

     ...
     (gdb) tar extended-remote :9999
     ...
     Remote debugging using :9999
     (gdb) r
     Starting program:
     Running ".../gdb.base/run-fail-twice/run-fail-twice.nox" on the remote
target failed
     (gdb)

    On GDBserver side:

     $ gdbserver --once --multi :9999
     Remote debugging from host 127.0.0.1, port 34344
     bash: line 1: .../gdb.base/run-fail-twice/run-fail-twice.nox: Permission
denied
     bash: line 1: exec: .../gdb.base/run-fail-twice/run-fail-twice.nox: cannot
execute: Permission denied
     gdbserver: During startup program exited with code 126.
     $   # gdbserver exited

This gdbserver exit is wrong, as we've connected with extended-remote/--multi.

Here's an example for "attach":

    On GDB side:

     ...
     (gdb) tar extended-remote :9999
     ...
     Remote debugging using :19999
     (gdb) attach 1
     Attaching to process 1
     Attaching to process 1 failed
     (gdb) 

    On GDBserver side:

     $ gdbserver --once --multi :9999
     Listening on port 9999
     Remote debugging from host 127.0.0.1, port 37464
     gdbserver: Cannot attach to process 1: Operation not permitted (1)
     $   # gdbserver exited

This gdbserver exit is also wrong, as we've connected with
extended-remote/--multi.

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

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

end of thread, other threads:[~2024-04-26 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 18:19 [Bug server/31554] New: gdbserver --once --multi mishandles run & attach failures pedro at palves dot net
2024-03-25 18:20 ` [Bug server/31554] " pedro at palves dot net
2024-04-12 17:45 ` cvs-commit at gcc dot gnu.org
2024-04-26 20:24 ` cvs-commit at gcc dot gnu.org
2024-04-26 21:12 ` pedro at palves dot net

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