public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug remote/15275] gdb quit command fails if remote serial link is broken
Date: Tue, 02 Apr 2013 13:51:00 -0000	[thread overview]
Message-ID: <bug-15275-4717-rvezm2RRAn@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15275-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=15275

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-02 13:51:09 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    palves@sourceware.org    2013-04-02 13:51:07

Modified files:
    gdb            : ChangeLog remote.c 

Log message:
    unpush the remote target if serial_write fails.

    PR gdb/15275 notes that when debugging with a remote connection over a
    serial link and the link is disconnected, say by disconnecting USB
    serial port, the GDB quit command no longer works:

    (gdb)
    tar ext /dev/ttyACM0
    &"tar ext /dev/ttyACM0\n"
    ~"Remote debugging using /dev/ttyACM0\n"
    ^done
    (gdb)
    set debug remote 1
    &"set debug remote 1\n"
    ^done
    (gdb)
    quit
    &"quit\n"
    &"Sending packet: $qTStatus#49..."
    &"putpkt: write failed: Input/output error.\n"
    ^error,msg="putpkt: write failed: Input/output error."
    (gdb)
    (gdb)
    quit
    &"quit\n"
    &"Sending packet: $qTStatus#49..."
    &"putpkt: write failed: Input/output error.\n"
    ^error,msg="putpkt: write failed: Input/output error."

    This is not reproducible with TCP connections, as with that, sending
    doesn't error out, but instead the error is detected on the subsequent
    readchar.  When that read fails, we unpush the remote target, and
    throw TARGET_CLOSE_ERROR.  To address PR gdb/15275, instead of
    catching the error in remote_get_trace_status as presently done (which
    leaves this same issue latent for another packet to trip on), or of
    making ser-unix.c fake success too on failed writes, so we'd get to
    readchar detecting the error on serial ports too, better let the error
    propagate out of serial_write, and catch it at the remote.c level,
    throwing away the target if writing fails too, instead of delaying
    that until the next read.

    gdb/
    2013-04-02  Pedro Alves  <palves@redhat.com>

    PR gdb/15275

    * remote.c (send_interrupt_sequence): Use remote_serial_write.
    (remote_serial_write): New function.
    (putpkt_binary, getpkt_or_notif_sane_1): Use remote_serial_write.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15354&r2=1.15355
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&r1=1.535&r2=1.536

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2013-04-02 13:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 23:51 [Bug remote/15275] New: " gareth at blacksphere dot co.nz
2013-03-13 23:54 ` [Bug remote/15275] " gareth at blacksphere dot co.nz
2013-03-14  1:13 ` gareth at blacksphere dot co.nz
2013-03-14  1:32 ` gareth at blacksphere dot co.nz
2013-03-20 17:09 ` jan.kratochvil at redhat dot com
2013-03-25 19:59 ` jan.kratochvil at redhat dot com
2013-03-27 18:20 ` cvs-commit at gcc dot gnu.org
2013-03-27 18:21 ` cvs-commit at gcc dot gnu.org
2013-03-27 18:23 ` jan.kratochvil at redhat dot com
2013-04-02 13:51 ` cvs-commit at gcc dot gnu.org [this message]
2013-04-02 13:54 ` cvs-commit at gcc dot gnu.org
2013-04-02 14:09 ` cvs-commit at gcc dot gnu.org
2013-04-02 14:11 ` cvs-commit at gcc dot gnu.org
2013-04-10 14:10 ` cvs-commit at gcc dot gnu.org

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-15275-4717-rvezm2RRAn@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).