public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17096] New: async support breaks remote debugging on Windows
@ 2014-06-27  8:33 freddie_chopin at op dot pl
  2014-06-27  8:35 ` [Bug gdb/17096] " freddie_chopin at op dot pl
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-27  8:33 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17096
           Summary: async support breaks remote debugging on Windows
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: freddie_chopin at op dot pl

GDB is cross-compiled for Windows using mingw32-w64 toolchain (most recent
package from Arch Linux, so that's GCC 4.9.0), the problem happens for both 32-
and 64-bit version.

When I use GDB with OpenOCD (remote GDB server), I can do most of the things
like single stepping, viewing memory, adding breakpoints (which work fine as
long as the target is stopped), but the moment I do a "continue" when there is
no breakpoint to halt on, I can no longer halt the chip...

Here is the session log:

> > arm-none-eabi-gdb file.elf
> GNU gdb (GNU Tools for ARM Embedded Processors / bleeding-edge-toolchain-140620)
>  7.8.50.20140620-cvs
> Copyright (C) 2014 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from file.elf...done.
> (gdb) target remote localhost:3333
> Remote debugging using localhost:3333
> 0x08001184 in DpAppl_ProfibusInit () at DpAppl.c:368
> 368     }//void DpAppl_ProfibusInit( void )
> (gdb) monitor reset init
> target state: halted
> target halted due to debug-request, current mode: Thread
> xPSR: 0xc1000000 pc: 0x08000120 msp: 0x20001308
> (gdb) c
> Continuing.

At this point I pressed "Ctrl+C" like few minutes ago and absolutely nothing
happens. This very simple scenario works fine with a GDB snapshot right before
"async target support" - "Ctrl+C" halts the target instantly.

The only way to gain control over GDB is to shutdown GDB server (OpenOCD),
which results in a following error:

> Exception condition detected on fd 384
> Remote communication error.  Target disconnected.: No error.
> (gdb)

Do note that GDB is not frozen - when I do something via OpenOCD the output is
seen correctly in the GDB's console - it just somehow cannot receive the
interrupt that halts the target...

This commit (before whole "async support" series) works fine:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=434415618f6bb9ac428a8d18ab33111920cd04dc

This commit (after whole "async support" series) has the problem:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=a09dd4413d1a4ea063173d4822635f41c885f6fe

For completeness - current HEAD still has the problem.

If anyone didn't notice that already, then this probably is Windows specific,
or even mingw-w64 specific, or maybe remote-target-OpenOCD specific.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
@ 2014-06-27  8:35 ` freddie_chopin at op dot pl
  2014-06-27 11:27 ` palves at redhat dot com
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-27  8:35 UTC (permalink / raw)
  To: gdb-prs

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

Freddie Chopin <freddie_chopin at op dot pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
  2014-06-27  8:35 ` [Bug gdb/17096] " freddie_chopin at op dot pl
@ 2014-06-27 11:27 ` palves at redhat dot com
  2014-06-27 15:25 ` freddie_chopin at op dot pl
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-06-27 11:27 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
BTW, also try "maint set target-async off" as a workaround.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
  2014-06-27  8:35 ` [Bug gdb/17096] " freddie_chopin at op dot pl
  2014-06-27 11:27 ` palves at redhat dot com
@ 2014-06-27 15:25 ` freddie_chopin at op dot pl
  2014-06-27 15:32 ` freddie_chopin at op dot pl
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-27 15:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Freddie Chopin <freddie_chopin at op dot pl> ---
Created attachment 7660
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7660&action=edit
log of the version right before the async patch series

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (2 preceding siblings ...)
  2014-06-27 15:25 ` freddie_chopin at op dot pl
@ 2014-06-27 15:32 ` freddie_chopin at op dot pl
  2014-06-27 16:47 ` palves at redhat dot com
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-27 15:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Freddie Chopin <freddie_chopin at op dot pl> ---
(In reply to Pedro Alves from comment #2)
> BTW, also try "maint set target-async off" as a workaround.

This workaround works with the most recent GDB.

I hope that in the logs posted above there is some valuable info (; What else
can I do to help with this problem?

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (3 preceding siblings ...)
  2014-06-27 15:32 ` freddie_chopin at op dot pl
@ 2014-06-27 16:47 ` palves at redhat dot com
  2014-06-27 16:49 ` palves at redhat dot com
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-06-27 16:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Pedro Alves <palves at redhat dot com> ---
> Sending packet: $c#63...
> 
> ### Ctrl+C gives no effect, shutting down remote GDBserver ###
> 
> async_remote_interrupt called
> remote_stop called
> Remote communication error.  Target disconnected.: No error.
> (gdb) async_remote_interrupt_twice called

That "remote_stop called" log indicates that GDB asked the remote end to
stop.  But, if that "remote_stop called" output really comes out only _after_
you close GDBserver, then it looks like the ctrl-c event is not waking up
gdb_select or the event loop, and it's only being processed when the connection
is closed, which itself also wakes up the event loop...  Sounds like another
gdb_select issue...

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (4 preceding siblings ...)
  2014-06-27 16:47 ` palves at redhat dot com
@ 2014-06-27 16:49 ` palves at redhat dot com
  2014-06-27 17:08 ` freddie_chopin at op dot pl
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-06-27 16:49 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Pedro Alves <palves at redhat dot com> ---
> What else can I do to help with this problem?

Other than debugging GDB yourself, can't think of anything right now.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (5 preceding siblings ...)
  2014-06-27 16:49 ` palves at redhat dot com
@ 2014-06-27 17:08 ` freddie_chopin at op dot pl
  2014-06-27 17:15 ` palves at redhat dot com
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-27 17:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Freddie Chopin <freddie_chopin at op dot pl> ---
(In reply to Pedro Alves from comment #6)
> > Sending packet: $c#63...
> > 
> > ### Ctrl+C gives no effect, shutting down remote GDBserver ###
> > 
> > async_remote_interrupt called
> > remote_stop called
> > Remote communication error.  Target disconnected.: No error.
> > (gdb) async_remote_interrupt_twice called
> 
> That "remote_stop called" log indicates that GDB asked the remote end to
> stop.  But, if that "remote_stop called" output really comes out only
> _after_ you close GDBserver, then it looks like the ctrl-c event is not
> waking up gdb_select or the event loop, and it's only being processed when
> the connection is closed, which itself also wakes up the event loop... 
> Sounds like another gdb_select issue...

That's exactly like you described - the line before my ### comment is the last
one I see after doing "continue" and pressing Ctrl+C (multiple times). The rest
appears after I shut down OpenOCD. I've checked that again to be 100% sure.

I have got an interesting observation though... I can also connect to OpenOCD
(GDBserver I'm using for ARM chips) via telnet and examine the target that way.
When I do "continue" in GDB and press Ctrl+C I can verify that the target is
NOT stopped. But after I do this examination OpenOCD sends some text to GDB for
display and at this moment GDB "wakes up", Ctrl+C is delivered and the target
gets halted.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (6 preceding siblings ...)
  2014-06-27 17:08 ` freddie_chopin at op dot pl
@ 2014-06-27 17:15 ` palves at redhat dot com
  2014-06-29  7:55 ` freddie_chopin at op dot pl
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-06-27 17:15 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Pedro Alves <palves at redhat dot com> ---
> When I do "continue" in GDB and press Ctrl+C I can verify that the target is 
> NOT stopped. But after I do this examination OpenOCD sends some text to GDB 
> for display and at this moment GDB "wakes up", Ctrl+C is delivered and the 
> target gets halted.

Thanks.  That very much confirms that ctrl-c is getting stuck and not waking up
GDB's event loop when it should.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (7 preceding siblings ...)
  2014-06-27 17:15 ` palves at redhat dot com
@ 2014-06-29  7:55 ` freddie_chopin at op dot pl
  2014-07-07 16:30 ` palves at redhat dot com
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-06-29  7:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Freddie Chopin <freddie_chopin at op dot pl> ---
Another important observation - this issue is Windows-specific - I've asked my
brother to test current HEAD on Linux and everything works fine there.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (8 preceding siblings ...)
  2014-06-29  7:55 ` freddie_chopin at op dot pl
@ 2014-07-07 16:30 ` palves at redhat dot com
  2014-07-07 16:39 ` freddie_chopin at op dot pl
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-07-07 16:30 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at sourceware dot org   |palves at redhat dot com

--- Comment #11 from Pedro Alves <palves at redhat dot com> ---
Testing a fix.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (9 preceding siblings ...)
  2014-07-07 16:30 ` palves at redhat dot com
@ 2014-07-07 16:39 ` freddie_chopin at op dot pl
  2014-07-07 18:00 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-07-07 16:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #12 from Freddie Chopin <freddie_chopin at op dot pl> ---
(In reply to Pedro Alves from comment #11)
> Testing a fix.

If the patch is available somewhere I can help with the testing.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (10 preceding siblings ...)
  2014-07-07 16:39 ` freddie_chopin at op dot pl
@ 2014-07-07 18:00 ` cvs-commit at gcc dot gnu.org
  2014-07-07 18:06 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-07-07 18:00 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #13 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  b2ee242b93e9580406e03abb18ff969de7de1976 (commit)
      from  3510a7b805f8ad1345b9d2671a21a40a09d9f2a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit b2ee242b93e9580406e03abb18ff969de7de1976
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jul 7 17:51:04 2014 +0100

    PR gdb/17096: async support breaks remote debugging on Windows

    On Windows, with "maint set target-async on" (the default since
    a09dd441), Ctrl-C fails to stop a remote target.

    With maint target-async on, the SIGINT signal handler doesn't send the
    remote interrupt request immediately.  Instead, it marks an async
    handler as ready, and then the main event loop wakes up and notices
    that the SIGINT async signal handler token was set, and calls the
    corresponding event handler, which sends the remote interrupt request.

    On POSIX-like systems, the SIGINT signal makes the select/poll in the
    main event loop wake up / return with EINTR.  However, on Windows,
    signal handlers run on a separate thread, and Windows doesn't really
    have a concept of EINTR.  So, just marking the async handler
    (effectively just setting a flag) does not wake up gdb_select.
    Instead, we need to call gdb_call_async_signal_handler from the signal
    handler.  The Windows version (in mingw-hdep.c) sets a Windows event
    that gdb_select's WaitForMultipleObjects is waiting for.

    Confirmed that with this, Ctrl-C interrupts the remote target on
    Windows.  Also regression tested on x86_64 Fedora 20 against
    GDBserver.

    gdb/
    2014-07-07  Pedro Alves  <palves@redhat.com>

        * remote.c (async_handle_remote_sigint)
        (async_handle_remote_sigint_twice): Call
        gdb_call_async_signal_handler instead of
        mark_async_signal_handler.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog |    7 +++++++
 gdb/remote.c  |    7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (11 preceding siblings ...)
  2014-07-07 18:00 ` cvs-commit at gcc dot gnu.org
@ 2014-07-07 18:06 ` cvs-commit at gcc dot gnu.org
  2014-07-07 18:11 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-07-07 18:06 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #14 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  8a869bcaa54364e8ea6583097a4a6e8414470c4f (commit)
      from  b2ee242b93e9580406e03abb18ff969de7de1976 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit 8a869bcaa54364e8ea6583097a4a6e8414470c4f
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jul 7 19:05:04 2014 +0100

    Mention PR gdb/17096 in ChangeLog

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (12 preceding siblings ...)
  2014-07-07 18:06 ` cvs-commit at gcc dot gnu.org
@ 2014-07-07 18:11 ` cvs-commit at gcc dot gnu.org
  2014-07-07 18:15 ` palves at redhat dot com
  2014-07-07 18:35 ` freddie_chopin at op dot pl
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-07-07 18:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #15 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.8-branch has been updated
       via  5bbc46815600d34fe7e5f3b8cda4bad0a70e95ad (commit)
      from  780400a0c9f76242dd7f0b3caf6c22947e909e88 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5bbc46815600d34fe7e5f3b8cda4bad0a70e95ad

commit 5bbc46815600d34fe7e5f3b8cda4bad0a70e95ad
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jul 7 19:06:35 2014 +0100

    PR gdb/17096: async support breaks remote debugging on Windows

    On Windows, with "maint set target-async on" (the default since
    a09dd441), Ctrl-C fails to stop a remote target.

    With maint target-async on, the SIGINT signal handler doesn't send the
    remote interrupt request immediately.  Instead, it marks an async
    handler as ready, and then the main event loop wakes up and notices
    that the SIGINT async signal handler token was set, and calls the
    corresponding event handler, which sends the remote interrupt request.

    On POSIX-like systems, the SIGINT signal makes the select/poll in the
    main event loop wake up / return with EINTR.  However, on Windows,
    signal handlers run on a separate thread, and Windows doesn't really
    have a concept of EINTR.  So, just marking the async handler
    (effectively just setting a flag) does not wake up gdb_select.
    Instead, we need to call gdb_call_async_signal_handler from the signal
    handler.  The Windows version (in mingw-hdep.c) sets a Windows event
    that gdb_select's WaitForMultipleObjects is waiting for.

    Confirmed that with this, Ctrl-C interrupts the remote target on
    Windows.  Also regression tested on x86_64 Fedora 20 against
    GDBserver.

    gdb/
    2014-07-07  Pedro Alves  <palves@redhat.com>

        gdb/17096
        * remote.c (async_handle_remote_sigint)
        (async_handle_remote_sigint_twice): Call
        gdb_call_async_signal_handler instead of
        mark_async_signal_handler.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog |    8 ++++++++
 gdb/remote.c  |    7 +++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (13 preceding siblings ...)
  2014-07-07 18:11 ` cvs-commit at gcc dot gnu.org
@ 2014-07-07 18:15 ` palves at redhat dot com
  2014-07-07 18:35 ` freddie_chopin at op dot pl
  15 siblings, 0 replies; 17+ messages in thread
From: palves at redhat dot com @ 2014-07-07 18:15 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

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

--- Comment #16 from Pedro Alves <palves at redhat dot com> ---
(In reply to Freddie Chopin from comment #12)
> If the patch is available somewhere I can help with the testing.

Thanks.  I went ahead and pushed the fix to both mainline and the 7.8 branch.
Let me know if ctrl-c still doesn't work for you.

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


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

* [Bug gdb/17096] async support breaks remote debugging on Windows
  2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
                   ` (14 preceding siblings ...)
  2014-07-07 18:15 ` palves at redhat dot com
@ 2014-07-07 18:35 ` freddie_chopin at op dot pl
  15 siblings, 0 replies; 17+ messages in thread
From: freddie_chopin at op dot pl @ 2014-07-07 18:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #17 from Freddie Chopin <freddie_chopin at op dot pl> ---
It works fine now - thanks!

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


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

end of thread, other threads:[~2014-07-07 18:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-27  8:33 [Bug gdb/17096] New: async support breaks remote debugging on Windows freddie_chopin at op dot pl
2014-06-27  8:35 ` [Bug gdb/17096] " freddie_chopin at op dot pl
2014-06-27 11:27 ` palves at redhat dot com
2014-06-27 15:25 ` freddie_chopin at op dot pl
2014-06-27 15:32 ` freddie_chopin at op dot pl
2014-06-27 16:47 ` palves at redhat dot com
2014-06-27 16:49 ` palves at redhat dot com
2014-06-27 17:08 ` freddie_chopin at op dot pl
2014-06-27 17:15 ` palves at redhat dot com
2014-06-29  7:55 ` freddie_chopin at op dot pl
2014-07-07 16:30 ` palves at redhat dot com
2014-07-07 16:39 ` freddie_chopin at op dot pl
2014-07-07 18:00 ` cvs-commit at gcc dot gnu.org
2014-07-07 18:06 ` cvs-commit at gcc dot gnu.org
2014-07-07 18:11 ` cvs-commit at gcc dot gnu.org
2014-07-07 18:15 ` palves at redhat dot com
2014-07-07 18:35 ` freddie_chopin at op dot pl

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