From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SyCwMKRkBWCrGQAAWB0awg (envelope-from ) for ; Mon, 18 Jan 2021 05:36:20 -0500 Received: by simark.ca (Postfix, from userid 112) id B93E41EF80; Mon, 18 Jan 2021 05:36:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 659311E945 for ; Mon, 18 Jan 2021 05:36:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 173A13846013; Mon, 18 Jan 2021 10:36:19 +0000 (GMT) Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 255E9384BC21 for ; Mon, 18 Jan 2021 10:36:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 255E9384BC21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sebastian.huber@embedded-brains.de Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1l1RtN-0009g8-Qr; Mon, 18 Jan 2021 11:36:13 +0100 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1l1RtN-000XZg-NO; Mon, 18 Jan 2021 11:36:13 +0100 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 68E182A1610; Mon, 18 Jan 2021 11:36:13 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jpBI6T41SuRQ; Mon, 18 Jan 2021 11:36:13 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 0089E2A165B; Mon, 18 Jan 2021 11:36:12 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zqQTivlaCurb; Mon, 18 Jan 2021 11:36:12 +0100 (CET) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.18]) by mail.embedded-brains.de (Postfix) with ESMTPSA id BE2762A1610; Mon, 18 Jan 2021 11:36:12 +0100 (CET) Subject: Re: [PATCH v3 1/5] gdb: make the remote target track its own thread resume state To: Simon Marchi , gdb-patches@sourceware.org References: <20210108041734.3873826-1-simon.marchi@polymtl.ca> <20210108041734.3873826-2-simon.marchi@polymtl.ca> From: Sebastian Huber Message-ID: <13a343a6-c2f6-9b8c-29b5-bb1faf2583c4@embedded-brains.de> Date: Mon, 18 Jan 2021 11:36:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.102.4/26052/Sun Jan 17 13:33:01 2021) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 18/01/2021 07:04, Simon Marchi wrote: > On 2021-01-18 12:16 a.m., Sebastian Huber wrote: >> Hello Simon, >> >> On 08/01/2021 05:17, Simon Marchi via Gdb-patches wrote: >>> +/* From the remote target's point of view, each thread is in one of = these three >>> +=C2=A0=C2=A0 states.=C2=A0 */ >>> +enum class resume_state >>> +{ >>> +=C2=A0 /* Not resumed - we haven't been asked to resume this thread.= =C2=A0 */ >>> +=C2=A0 NOT_RESUMED, >>> + >>> +=C2=A0 /* We have been asked to resume this thread, but haven't sent= a vCont action >>> +=C2=A0=C2=A0=C2=A0=C2=A0 for it yet.=C2=A0 We'll need to consider it= next time commit_resume is >>> +=C2=A0=C2=A0=C2=A0=C2=A0 called.=C2=A0 */ >>> +=C2=A0 RESUMED_PENDING_VCONT, >>> + >>> +=C2=A0 /* We have been asked to resume this thread, and we have sent= a vCont action >>> +=C2=A0=C2=A0=C2=A0=C2=A0 for it.=C2=A0 */ >>> +=C2=A0 RESUMED, >>> +}; >> there could be a problem with this "enum class" on CentOS 7.9: >> >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1157:38: err= or: 'resume_state' is not a class, namespace, or enumeration >> =C2=A0=C2=A0 enum resume_state m_resume_state =3D resume_state::NOT_R= ESUMED; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ^ >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member f= unction 'void remote_thread_info::set_not_resumed()': >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1115:22: err= or: 'resume_state' is not a class, namespace, or enumeration >> =C2=A0=C2=A0=C2=A0=C2=A0 m_resume_state =3D resume_state::NOT_RESUMED= ; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member f= unction 'void remote_thread_info::set_resumed_pending_vcont(bool, gdb_sig= nal)': >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1121:22: err= or: 'resume_state' is not a class, namespace, or enumeration >> =C2=A0=C2=A0=C2=A0=C2=A0 m_resume_state =3D resume_state::RESUMED_PEN= DING_VCONT; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> In file included from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb= /../gdbsupport/gdb_string_view.h:49:0, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 from ../../sourceware-mirror-binutils-gdb-edf= 0f28/gdb/../gdbsupport/common-utils.h:46, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 from ../../sourceware-mirror-binutils-gdb-edf= 0f28/gdb/../gdbsupport/common-defs.h:125, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 from ../../sourceware-mirror-binutils-gdb-edf= 0f28/gdb/defs.h:28, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 from ../../sourceware-mirror-binutils-gdb-edf= 0f28/gdb/remote.c:22: >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member f= unction 'const resumed_pending_vcont_info& remote_thread_info::resumed_pe= nding_vcont_info() const': >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1132:35: err= or: 'resume_state' is not a class, namespace, or enumeration >> =C2=A0=C2=A0=C2=A0=C2=A0 gdb_assert (m_resume_state =3D=3D resume_sta= te::RESUMED_PENDING_VCONT); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/gdb_ass= ert.h:35:13: note: in definition of macro 'gdb_assert' >> =C2=A0=C2=A0 ((void) ((expr) ? 0 :=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ^ >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member f= unction 'void remote_thread_info::set_resumed()': >> ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1140:22: err= or: 'resume_state' is not a class, namespace, or enumeration >> =C2=A0=C2=A0=C2=A0=C2=A0 m_resume_state =3D resume_state::RESUMED; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> > Huh, maybe it gets confused because there's a method named "remote_stat= e" > as well? Does it work if you rename the method to something else? Thanks for the hint, I will have a look at it, but it may take a while. I noticed another issue on nios2-rtems built on openSUSE: ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:7820:=20 internal-error: ptid_t=20 remote_target::select_thread_for_ambiguous_stop_reply(const=20 target_waitstatus*): Assertion `first_resumed_thread !=3D nullptr' failed= . A problem internal to GDB has been detected, further debugging may prove unreliable. It worked with the GDB commit 4180301. --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/