This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] gdbserver/linux: Always wake up event loop after resume


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

commit 1bebeeca940f4f6339e66eb7fb486c81cd951522
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Nov 30 16:05:26 2015 +0000

    gdbserver/linux: Always wake up event loop after resume
    
    Running killed-outside.exp in with "maint set target-non-stop on"
    hangs currently.  This test has the inferior process die with a
    SIGKILL while stopped.  gdbserver gets a SIGCHLD and reacts by
    retrieveing the SIGKILL events out of waitpid.  But because the
    process is not resumed from GDB's perspective, the event is left
    pending.  When GDB resumes the process afterwards, the process is not
    really resumed because it already has the event pending.  But nothing
    wakes up the event loop to consume the event.
    
    Handle this in the same way nat/linux-nat.c:linux_nat_resume handles
    this.
    
    gdb/gdbserver/ChangeLog:
    2015-11-30  Pedro Alves  <palves@redhat.com>
    
    	* linux-low.c (linux_resume): Wake up the event loop before
    	returning.

Diff:
---
 gdb/gdbserver/ChangeLog   | 5 +++++
 gdb/gdbserver/linux-low.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 86ca736..6330c03 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
 2015-11-30  Pedro Alves  <palves@redhat.com>
 
+	* linux-low.c (linux_resume): Wake up the event loop before
+	returning.
+
+2015-11-30  Pedro Alves  <palves@redhat.com>
+
 	* mem-break.c (check_gdb_bp_preconditions): Remove current_thread
 	check.
 	(set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 28abe41..086b202 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4770,6 +4770,11 @@ linux_resume (struct thread_resume *resume_info, size_t n)
       debug_printf ("linux_resume done\n");
       debug_exit ();
     }
+
+  /* We may have events that were pending that can/should be sent to
+     the client now.  Trigger a linux_wait call.  */
+  if (target_is_async_p ())
+    async_file_mark ();
 }
 
 /* This function is called once per thread.  We check the thread's


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]