public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Issue with multiple threads using remote protocol on riscv32
@ 2022-03-16 14:45 Denio, Mike
  2022-03-16 14:58 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Denio, Mike @ 2022-03-16 14:45 UTC (permalink / raw)
  To: gdb

I am seeing an issue with the remote protocol  on GDB with multiple threads on a riscv32 using the continue command. Not sure if it's a bug or just me, but it may be me as I am new to GDB.

I am using a custom server. The behavior is the same on both GDB 11.1 and 11.2.

This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=riscv32-unknown-elf
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/local/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/local/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --without-babeltrace
             --without-intel-pt
             --with-mpfr
             --without-xxhash
             --with-python=/usr
             --with-python-libdir=/usr/lib
             --without-debuginfod
             --without-guile
             --disable-source-highlight
             --with-separate-debug-dir=/usr/local/lib/debug (relocatable)

I am running in non-stop mode. A full log of the test is at the end of the email. The GDB commands I execute after connecting are:
(gdb) interrupt -a
(gdb) set *0x10000000=1
(gdb) c -a&

The problem is that the "c -a&" is implemented by a 'vCont;c:1' followed by a 'vCont;c', essentially telling thread 1 to continue twice, causing it to skip over a break.

Am I interpreting the commands incorrectly or am I sending GDB something incorrect that is confusing it?

Thanks,
Mike

---[ Remote Log ]------------------

'+'                     --->
'qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+' --->
                        <--- '+$hwbreak+;vContSupported+;QStartNoAckMode+;QNonStop+;PacketSize=410#e3'
'+'                     --->
'vMustReplyEmpty'       --->
                        <--- '+$#00'
'+'                     --->
'QStartNoAckMode'       --->
                        <--- '+$OK#9a'
'+'                     --->
'!'                     --->
                        <--- '$OK#9a'
'Hg0'                   --->
                        <--- '$OK#9a'
'QNonStop:1'            --->
                        <--- '$OK#9a'
'qfThreadInfo'          --->
                        <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'
'qAttached'             --->
                        <--- '$1#31'
'qTStatus'              --->
                        <--- '$#00'
'?'                     --->
                        <--- '$OK#9a'
'vCont?'                --->
                        <--- '$vCont;c;C;s;t#83'
'vCont;t:2'             --->
                        <--- '$OK#9a'
                        <--- '%Stop:T00thread:2;#b3'
'qSymbol::'             --->
                        <--- '$OK#9a'
'vStopped'              --->
                        <--- '$OK#9a'
'Hg2'                   --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'
'qOffsets'              --->
                        <--- '$#00'
'qSymbol::'             --->
                        <--- '$OK#9a'
'vCont;c'               --->
                        <--- '$OK#9a'

(gdb) interrupt -a

'vCont;t'               --->
                        <--- '$OK#9a'
                        <--- '%Stop:T00thread:1;#b2'
'vStopped'              --->
                        <--- '$T00thread:2;#d3'
'vStopped'              --->
                        <--- '$OK#9a'
'Hg1'                   --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'
'qfThreadInfo'          --->
                        <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'
'Hg2'                   --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'
'qfThreadInfo'          --->
                       <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'

(gdb) set *0x10000000 = 1

'X10000000,0:'          --->
                        <--- '$#00'
'M10000000,4:01000000'  --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'
'Hg1'                   --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'

(gdb) c -a&

'vCont;c:1'             --->
                        <--- '$OK#9a'
                        <--- '%Stop:T05thread:1;#b7' // THIS STOP IS LOST BECAUSE GDB IMMEDIATELY TELLS THREAD 1 TO CONTINUE
'vCont;c'               --->
                        <--- '$OK#9a'
'vStopped'              --->
                        <--- '$OK#9a'
                        <--- '%Stop:T05thread:2;#b8'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000002084000800041000200400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000#a5'
'qfThreadInfo'          --->
                        <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'
'vStopped'              --->
                        <--- '$OK#9a'
'Hg2'                   --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#80'
'qfThreadInfo'          --->
                        <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'





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

end of thread, other threads:[~2022-03-17 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 14:45 Issue with multiple threads using remote protocol on riscv32 Denio, Mike
2022-03-16 14:58 ` Pedro Alves
2022-03-16 15:10   ` [EXTERNAL] " Denio, Mike
2022-03-17 17:52     ` Pedro Alves
2022-03-17 19:11       ` Denio, Mike

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