From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by sourceware.org (Postfix) with ESMTPS id 1BF233857806 for ; Wed, 16 Mar 2022 14:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1BF233857806 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22GEjsE1068107 for ; Wed, 16 Mar 2022 09:45:54 -0500 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22GEjsZP015644 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 16 Mar 2022 09:45:54 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 16 Mar 2022 09:45:54 -0500 Received: from DFLE104.ent.ti.com ([fe80::44c:e883:6f6f:384d]) by DFLE104.ent.ti.com ([fe80::44c:e883:6f6f:384d%17]) with mapi id 15.01.2308.014; Wed, 16 Mar 2022 09:45:54 -0500 From: "Denio, Mike" To: "gdb@sourceware.org" Subject: Issue with multiple threads using remote protocol on riscv32 Thread-Topic: Issue with multiple threads using remote protocol on riscv32 Thread-Index: Adg5QM9524ugFxmYRvyzR1DIawmAVw== Date: Wed, 16 Mar 2022 14:45:54 +0000 Message-ID: <0f242330e5e242dea1957fbab47a6473@ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.249.41.28] x-exclaimer-md-config: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 MIME-Version: 1.0 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, KAM_LOTSOFHASH, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 14:45:57 -0000 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 1= 1.2. This GDB was configured as follows: configure --host=3Dx86_64-pc-linux-gnu --target=3Driscv32-unknown-elf --with-auto-load-dir=3D$debugdir:$datadir/auto-load --with-auto-load-safe-path=3D$debugdir:$datadir/auto-load --with-expat --with-gdb-datadir=3D/usr/local/share/gdb (relocatable) --with-jit-reader-dir=3D/usr/local/lib/gdb (relocatable) --without-libunwind-ia64 --with-lzma --without-babeltrace --without-intel-pt --with-mpfr --without-xxhash --with-python=3D/usr --with-python-libdir=3D/usr/lib --without-debuginfod --without-guile --disable-source-highlight --with-separate-debug-dir=3D/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=3D1 (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 in= correct that is confusing it? Thanks, Mike ---[ Remote Log ]------------------ '+' ---> 'qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-= events+;exec-events+;vContSupported+;QThreadEvents+' ---> <--- '+$hwbreak+;vContSupported+;QStartNoAckMode+;Q= NonStop+;PacketSize=3D410#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' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#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' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#80' 'qfThreadInfo' ---> <--- '$m1,2#fc' 'qsThreadInfo' ---> <--- '$l#6c' 'Hg2' ---> <--- '$OK#9a' 'g' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#80' 'qfThreadInfo' ---> <--- '$m1,2#fc' 'qsThreadInfo' ---> <--- '$l#6c' (gdb) set *0x10000000 =3D 1 'X10000000,0:' ---> <--- '$#00' 'M10000000,4:01000000' ---> <--- '$OK#9a' 'g' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#80' 'Hg1' ---> <--- '$OK#9a' 'g' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#80' (gdb) c -a& 'vCont;c:1' ---> <--- '$OK#9a' <--- '%Stop:T05thread:1;#b7' // THIS STOP IS LOST B= ECAUSE GDB IMMEDIATELY TELLS THREAD 1 TO CONTINUE 'vCont;c' ---> <--- '$OK#9a' 'vStopped' ---> <--- '$OK#9a' <--- '%Stop:T05thread:2;#b8' 'g' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000208400080004100020040000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000004000000#a5' 'qfThreadInfo' ---> <--- '$m1,2#fc' 'qsThreadInfo' ---> <--- '$l#6c' 'vStopped' ---> <--- '$OK#9a' 'Hg2' ---> <--- '$OK#9a' 'g' ---> <--- '$00000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 0000000000000000000000000000000000000000000000000000000000000000000000#80' 'qfThreadInfo' ---> <--- '$m1,2#fc' 'qsThreadInfo' ---> <--- '$l#6c'