Re: Issue with multiple threads using remote protocol on riscv32

Pedro Alves <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hi!

On 2022-03-16 14:45, Denio, Mike via Gdb wrote:

> (gdb) c -a&
> 
> 'vCont;c:1'             --->
>                         <--- '$OK#9a'
>                         <--- '%Stop:T05thread:1;#b7' // THIS STOP IS LOST BECAUSE GDB IMMEDIATELY TELLS THREAD 1 TO CONTINUE

This stop hasn't been acknowledged yet with vStopped at this point, so ...

> 'vCont;c'               --->
>                         <--- '$OK#9a'

... from this 'vCont;c''s perspective, thread 1 is still running, so the server should ignore the 'c' action for thread 1.

gdbserver does this here, in linux-low.c::linux_set_resume_request

...
	  /* If the thread has a pending event that has already been
	     reported to GDBserver core, but GDB has not pulled the
	     event out of the vStopped queue yet, likewise, ignore the
	     (wildcard) resume request.  */
	  if (in_queued_stop_replies (thread->id))
	    {
	      threads_debug_printf
		("not resuming LWP %ld: has queued stop reply",
		 lwpid_of (thread));
	      continue;
	    }
...

Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.