public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/15275] New: gdb quit command fails if remote serial link is broken
@ 2013-03-13 23:51 gareth at blacksphere dot co.nz
  2013-03-13 23:54 ` [Bug remote/15275] " gareth at blacksphere dot co.nz
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: gareth at blacksphere dot co.nz @ 2013-03-13 23:51 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 15275
           Summary: gdb quit command fails if remote serial link is broken
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: remote
        AssignedTo: unassigned@sourceware.org
        ReportedBy: gareth@blacksphere.co.nz
    Classification: Unclassified


If 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 must be forcibly killed.  The MI -gdb-exit command does
still work.

This is tested on a Debian Wheezy amd64 host system with GDB 7.5.1 for
arm-none-eabi target.

This may be a duplicate of bug 11221 and/or 12853 as the symptoms are very
similar.

(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-exit
^exit

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
@ 2013-03-13 23:54 ` gareth at blacksphere dot co.nz
  2013-03-14  1:13 ` gareth at blacksphere dot co.nz
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gareth at blacksphere dot co.nz @ 2013-03-13 23:54 UTC (permalink / raw)
  To: gdb-prs

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

Gareth McMullin <gareth at blacksphere dot co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |arm-none-eabi
               Host|                            |i686-pc-linux-gnu
           See Also|                            |http://sourceware.org/bugzi
                   |                            |lla/show_bug.cgi?id=12853,
                   |                            |http://sourceware.org/bugzi
                   |                            |lla/show_bug.cgi?id=11221
              Build|                            |i686-pc-linux-gnu

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken 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
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gareth at blacksphere dot co.nz @ 2013-03-14  1:13 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Gareth McMullin <gareth at blacksphere dot co.nz> 2013-03-14 01:13:31 UTC ---
The CLI 'quit' command quit_command() calls disconnect_tracing() which
ultimately calls the failing putpkt() that raises an exception causing GDB not
to exit.

The MI '-gdb-exit' command mi_cmd_gdb_exit() never calls disconnect_tracing()
and therefore exits correctly.

I've never used tracing, but I assume this is an error and disconnect_tracing()
should be called from mi_cmd_gdb_exit().

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken 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
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gareth at blacksphere dot co.nz @ 2013-03-14  1:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Gareth McMullin <gareth at blacksphere dot co.nz> 2013-03-14 01:32:22 UTC ---
Created attachment 6934
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6934
Include putpkt call in TRY_CATCH in remote_get_trace_status()

Including the call to putpkt in the TRY_CATCH in remote_get_trace_status allows
the exception to be caught and reported, but still allows GDB to exit on the
quit command.

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (2 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-03-20 17:09 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2013-03-20 17:09:55 UTC ---
replied:
http://sourceware.org/ml/gdb-patches/2013-03/msg00751.html

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (3 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-03-25 19:59 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #4 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2013-03-25 19:59:05 UTC ---
Valid bugreport, as verified in:
http://sourceware.org/ml/gdb-patches/2013-03/msg00948.html

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (4 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-03-27 18:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-03-27 18:20:12 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    jkratoch@sourceware.org    2013-03-27 18:20:10

Modified files:
    gdb            : ChangeLog remote.c 

Log message:
    gdb/
    PR gdb/15275
    * remote.c (remote_get_trace_status): Include putpkt in TRY_CATCH.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15326&r2=1.15327
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&r1=1.533&r2=1.534

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (5 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-03-27 18:21 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-03-27 18:21:55 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_6-branch
Changes by:    jkratoch@sourceware.org    2013-03-27 18:21:54

Modified files:
    gdb            : ChangeLog remote.c 

Log message:
    gdb/
    PR gdb/15275
    * remote.c (remote_get_trace_status): Include putpkt in TRY_CATCH.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.16&r2=1.15260.2.17
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.528.2.2&r2=1.528.2.3

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (6 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-03-27 18:23 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

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

--- Comment #7 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2013-03-27 18:23:42 UTC ---
Checked in.

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (7 preceding siblings ...)
  2013-03-27 18:23 ` jan.kratochvil at redhat dot com
@ 2013-04-02 13:51 ` cvs-commit at gcc dot gnu.org
  2013-04-02 13:54 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-02 13:51 UTC (permalink / raw)
  To: gdb-prs

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.


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (8 preceding siblings ...)
  2013-04-02 13:51 ` cvs-commit at gcc dot gnu.org
@ 2013-04-02 13:54 ` cvs-commit at gcc dot gnu.org
  2013-04-02 14:09 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-02 13:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-02 13:54:22 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_6-branch
Changes by:    palves@sourceware.org    2013-04-02 13:54:21

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&only_with_tag=gdb_7_6-branch&r1=1.15260.2.21&r2=1.15260.2.22
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.528.2.3&r2=1.528.2.4

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (9 preceding siblings ...)
  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
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-02 14:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-02 14:09:10 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    jkratoch@sourceware.org    2013-04-02 14:09:08

Modified files:
    gdb            : ChangeLog remote.c 

Log message:
    gdb/
    Revert this patch:
    PR gdb/15275
    * remote.c (remote_get_trace_status): Include putpkt in TRY_CATCH.

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

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (10 preceding siblings ...)
  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
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-02 14:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #11 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-02 14:11:01 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_6-branch
Changes by:    jkratoch@sourceware.org    2013-04-02 14:11:00

Modified files:
    gdb            : ChangeLog remote.c 

Log message:
    gdb/
    Revert this patch:
    PR gdb/15275
    * remote.c (remote_get_trace_status): Include putpkt in TRY_CATCH.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.22&r2=1.15260.2.23
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.528.2.4&r2=1.528.2.5

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


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

* [Bug remote/15275] gdb quit command fails if remote serial link is broken
  2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken gareth at blacksphere dot co.nz
                   ` (11 preceding siblings ...)
  2013-04-02 14:11 ` cvs-commit at gcc dot gnu.org
@ 2013-04-10 14:10 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-10 14:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-10 14:10:37 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    palves@sourceware.org    2013-04-10 14:10:35

Modified files:
    gdb            : ChangeLog infcmd.c top.c tracepoint.c 
                     tracepoint.h 
    gdb/cli        : cli-cmds.c 

Log message:
    make -gdb-exit call disconnect_tracing too, and don't lose history if the
target errors on "quit"

    Gareth mentions in PR gdb/15275:

    "The MI '-gdb-exit' command mi_cmd_gdb_exit() never calls
disconnect_tracing()
    and therefore exits correctly."

    It should, so to get out of tfind mode, as quit may detach instead of
    kill, and we don't want to confuse the memory/register accesses
    etc. of the detach process.  So we should push down the disconnect
    tracing bits at least to quit_force.  But we can't as is, as that
    would swallow the error thrown by answering "no" to:

    Trace is running but will stop on detach; detach anyway? (y or n)

    So to address that, we split disconnect_tracing in two.  One part that
    does the query, and another part that does the rest, and we make
    quit_force call the latter.

    Looking at quit_force, it does several things, some of which are a bit
    independent of the others.  It first kills/detaches, and then writes
    history, and then runs the final cleanups.  It seems better to me to
    do each of these things even if the previous thing throws.  E.g., as
    is, if something throws while detaching, then we skip writing history.

    Tested on x86_64 Fedora 17.

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

    * cli/cli-cmds.c (quit_command): Call query_if_trace_running
    instead of disconnect_tracing.
    * infcmd.c (detach_command, disconnect_command): Call
    query_if_trace_running.  Adjust.
    * top.c: Include "tracepoint.h".
    (quit_target): Delete.  Contents moved ...
    (quit_force): ... here.  Wrap each stage of teardown in
    TRY_CATCH.  Call disconnect_tracing before detaching.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15392&r2=1.15393
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infcmd.c.diff?cvsroot=src&r1=1.327&r2=1.328
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/top.c.diff?cvsroot=src&r1=1.231&r2=1.232
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/tracepoint.c.diff?cvsroot=src&r1=1.298&r2=1.299
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/tracepoint.h.diff?cvsroot=src&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cli/cli-cmds.c.diff?cvsroot=src&r1=1.152&r2=1.153

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


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

end of thread, other threads:[~2013-04-10 14:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13 23:51 [Bug remote/15275] New: gdb quit command fails if remote serial link is broken 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
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

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