There is a program on remote-debugging a multi-threaded program which uses signals. After receiving a signal (configured to "nostop"), the thread which receives it resumes normally but other threads leave stopped. I'm using gdb/snapshots/branch/gdb-6.0.90.tar.bz2 (Mar 1) on i386-linux. The test program to reproduce this problem is attached (sigtest.c). It creates a thread which waits SIGUSR1 and main thread sends SIGUSR1 to the thread every 10 secs. Usual output is: $ ./sigtest [sigtest:26616:1024]:main [sigtest:26618:1026]:func [sigtest:26616:1024]:send SIGUSR1 [sigtest:26618:1026]:sigwait 10 [sigtest:26616:1024]:send SIGUSR1 [sigtest:26618:1026]:sigwait 10 ... gdb debug session log is: (gdb) target remote localhost:50000 Remote debugging using localhost:50000 0x080480e0 in _start () (gdb) handle SIGUSR1 nostop Signal Stop Print Pass to program Description SIGUSR1 No Yes Yes User defined signal 1 (gdb) c Continuing. [New Thread 1024] [New Thread 1026] and gdbserver side log is: $ ./gdbserver host:50000 ./sigtest Process ./sigtest created; pid = 26599 Listening on port 50000 Remote debugging from host 127.0.0.1 [sigtest:26599:1024]:main [sigtest:26601:1026]:func [sigtest:26599:1024]:send SIGUSR1 [sigtest:26601:1026]:sigwait 10 (no more output) ps output is: $ ps a PID TTY STAT TIME COMMAND 26598 pts/4 S 0:00 ./gdbserver host:50000 ./sigtest 26599 pts/4 T 0:00 ./sigtest 26600 pts/4 T 0:00 ./sigtest 26601 pts/4 S 0:00 ./sigtest PID 26601 is a thread which receives SIGUSR1. This was resumed but others are still stopped. I tried "set remote verbose-resume-packet off" and got same results. It seems gdbserver does not handle 'continue with signal' case correctly. I tried to fix this problem and create a patch below, and it seems work, but I'm not sure this is a correct fix (or correct place). diff -up gdb-6.0.90.org/gdb/gdbserver/server.c gdb-6.0.90/gdb/gdbserver/server.c --- gdb-6.0.90.org/gdb/gdbserver/server.c Mon Mar 1 01:49:38 2004 +++ gdb-6.0.90/gdb/gdbserver/server.c Wed Mar 3 23:49:42 2004 @@ -235,6 +235,8 @@ handle_v_cont (char *own_buf, char *stat cont_thread = resume_info[0].thread; else cont_thread = -1; + if (cont_thread != -1 && n == 1 && !resume_info[0].step) + resume_info[i].leave_stopped = 0; /* signal the thread and run others */ set_desired_inferior (0); (*the_target->resume) (resume_info); @@ -292,7 +294,7 @@ myresume (int step, int sig) resume_info[n].thread = -1; resume_info[n].step = 0; resume_info[n].sig = 0; - resume_info[n].leave_stopped = (cont_thread > 0); + resume_info[n].leave_stopped = step && (cont_thread > 0); (*the_target->resume) (resume_info); } Other attached files are some session logs for gdb (set debug remote 1) and gdbserver (debug_thread = 1). gdb.output1 and gdbserver.output1 are logs with "verbose-resume on". gdb.output2 and gdbserver.output2 are logs with "verbose-resume off". --- Atsushi Nemoto