public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/22992] GDB and Microsoft Windows thread pool
       [not found] <bug-22992-4717@http.sourceware.org/bugzilla/>
@ 2020-04-08 20:50 ` cvs-commit at gcc dot gnu.org
  2020-04-08 20:51 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-08 20:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #19 from cvs-commit at gcc dot gnu.org <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=0a4afda3c63687cc5cbbdae78850ee66967cd648

commit 0a4afda3c63687cc5cbbdae78850ee66967cd648
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Apr 8 14:33:35 2020 -0600

    Handle pending stops from the Windows kernel

    PR gdb/22992 concerns an assertion failure in gdb when debugging a
    certain inferior:

        int finish_step_over(execution_control_state*): Assertion
`ecs->event_thread->control.trap_expected' failed.

    Initially the investigation centered on the discovery that gdb was not
    suspending other threads when attempting to single-step.  This
    oversight is corrected in this patch: now, when stepping a thread, gdb
    will call SuspendThread on all other threads.

    However, the bug persisted even after this change.  In particular,
    WaitForDebugEvent could see a stop for a thread that was ostensibly
    suspended.  Our theory of what is happening here is that there are
    actually simultaneous breakpoint hits, and the Windows kernel queues
    the events, causing the second stop to be reported on a suspended
    thread.

    In Windows 10 or later gdb could use the DBG_REPLY_LATER flag to
    ContinueDebugEvent to request that such events be re-reported later.
    However, relying on that did not seem advisable, so this patch instead
    arranges to queue such "pending" stops, and then to report them later,
    once the step has completed.

    In the PR, Pedro pointed out that it's best in this scenario to
    implement the stopped_by_sw_breakpoint method, so this patch does this
    as well.

    gdb/ChangeLog
    2020-04-08  Tom Tromey  <tromey@adacore.com>

            PR gdb/22992
            * windows-nat.c (current_event): Update comment.
            (last_wait_event, desired_stop_thread_id): New globals.
            (struct pending_stop): New.
            (pending_stops): New global.
            (windows_nat_target) <stopped_by_sw_breakpoint>
            <supports_stopped_by_sw_breakpoint>: New methods.
            (windows_fetch_one_register): Add assertions.  Adjust PC.
            (windows_continue): Handle pending stops.  Suspend other threads
            when stepping.  Use last_wait_event
            (wait_for_debug_event): New function.
            (get_windows_debug_event): Use wait_for_debug_event.  Handle
            pending stops.  Queue spurious stops.
            (windows_nat_target::wait): Set stopped_at_software_breakpoint.
            (windows_nat_target::kill): Use wait_for_debug_event.
            * nat/windows-nat.h (struct windows_thread_info)
            <stopped_at_software_breakpoint>: New field.
            * nat/windows-nat.c (windows_thread_info::resume): Clear
            stopped_at_software_breakpoint.

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

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

* [Bug gdb/22992] GDB and Microsoft Windows thread pool
       [not found] <bug-22992-4717@http.sourceware.org/bugzilla/>
  2020-04-08 20:50 ` [Bug gdb/22992] GDB and Microsoft Windows thread pool cvs-commit at gcc dot gnu.org
@ 2020-04-08 20:51 ` cvs-commit at gcc dot gnu.org
  2020-04-08 20:55 ` tromey at sourceware dot org
  2020-04-09  5:33 ` ruslanngaripov at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-08 20:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #20 from cvs-commit at gcc dot gnu.org <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=360ad8b3505faea96190283270854bf9b397f334

commit 360ad8b3505faea96190283270854bf9b397f334
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Apr 8 14:33:35 2020 -0600

    Add pending stop support to gdbserver's Windows port

    This changes gdbserver to also handle pending stops, the same way that
    gdb does.  This is PR gdb/22992.

    gdbserver/ChangeLog
    2020-04-08  Tom Tromey  <tromey@adacore.com>

            PR gdb/22992
            * win32-low.c (child_continue): Call matching_pending_stop.
            (get_child_debug_event): Call fetch_pending_stop.  Push pending
            stop when needed.

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

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

* [Bug gdb/22992] GDB and Microsoft Windows thread pool
       [not found] <bug-22992-4717@http.sourceware.org/bugzilla/>
  2020-04-08 20:50 ` [Bug gdb/22992] GDB and Microsoft Windows thread pool cvs-commit at gcc dot gnu.org
  2020-04-08 20:51 ` cvs-commit at gcc dot gnu.org
@ 2020-04-08 20:55 ` tromey at sourceware dot org
  2020-04-09  5:33 ` ruslanngaripov at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2020-04-08 20:55 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #21 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] 4+ messages in thread

* [Bug gdb/22992] GDB and Microsoft Windows thread pool
       [not found] <bug-22992-4717@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-04-08 20:55 ` tromey at sourceware dot org
@ 2020-04-09  5:33 ` ruslanngaripov at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: ruslanngaripov at gmail dot com @ 2020-04-09  5:33 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #22 from Ruslan Garipov <ruslanngaripov at gmail dot com> ---
Thanks a lot for your huge work!

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

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

end of thread, other threads:[~2020-04-09  5:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22992-4717@http.sourceware.org/bugzilla/>
2020-04-08 20:50 ` [Bug gdb/22992] GDB and Microsoft Windows thread pool cvs-commit at gcc dot gnu.org
2020-04-08 20:51 ` cvs-commit at gcc dot gnu.org
2020-04-08 20:55 ` tromey at sourceware dot org
2020-04-09  5:33 ` ruslanngaripov at gmail dot com

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