From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oQaYF+4kBWDZEgAAWB0awg (envelope-from ) for ; Mon, 18 Jan 2021 01:04:30 -0500 Received: by simark.ca (Postfix, from userid 112) id 52FFC1EF80; Mon, 18 Jan 2021 01:04:30 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 04EE11E945 for ; Mon, 18 Jan 2021 01:04:30 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 50254385482D; Mon, 18 Jan 2021 06:04:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50254385482D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610949869; bh=ZwULwZ1U8WxAHnaPh5WaQn6wGpJpQSuh7ucYxQBMn1k=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mF6QVZiB0ixXu1ONCusmyYjCVPtcqUBmM2l4J6i4b1klnuPWrwHqCW+c4h/rxVH4f gN8jB7lleTg7ImuhK7ilnDt5GColR85cE5wjWPBJzmTWxfoOj+a2PxZfpU343S2yw0 JA54WtJH5P/GMcJutoqM2OP29Ec7OXNw8vavV3p4= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id DB0F6385482D for ; Mon, 18 Jan 2021 06:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DB0F6385482D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10I6433o008642 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Jan 2021 01:04:08 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10I6433o008642 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 568E51E945; Mon, 18 Jan 2021 01:04:03 -0500 (EST) Subject: Re: [PATCH v3 1/5] gdb: make the remote target track its own thread resume state To: Sebastian Huber , gdb-patches@sourceware.org References: <20210108041734.3873826-1-simon.marchi@polymtl.ca> <20210108041734.3873826-2-simon.marchi@polymtl.ca> Message-ID: Date: Mon, 18 Jan 2021 01:04:03 -0500 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 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 18 Jan 2021 06:04:03 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 >> +   states.  */ >> +enum class resume_state >> +{ >> +  /* Not resumed - we haven't been asked to resume this thread.  */ >> +  NOT_RESUMED, >> + >> +  /* We have been asked to resume this thread, but haven't sent a vCont action >> +     for it yet.  We'll need to consider it next time commit_resume is >> +     called.  */ >> +  RESUMED_PENDING_VCONT, >> + >> +  /* We have been asked to resume this thread, and we have sent a vCont action >> +     for it.  */ >> +  RESUMED, >> +}; > > there could be a problem with this "enum class" on CentOS 7.9: > > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1157:38: error: 'resume_state' is not a class, namespace, or enumeration >    enum resume_state m_resume_state = resume_state::NOT_RESUMED; >                                       ^ > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function 'void remote_thread_info::set_not_resumed()': > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1115:22: error: 'resume_state' is not a class, namespace, or enumeration >      m_resume_state = resume_state::NOT_RESUMED; >                       ^ > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function 'void remote_thread_info::set_resumed_pending_vcont(bool, gdb_signal)': > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1121:22: error: 'resume_state' is not a class, namespace, or enumeration >      m_resume_state = resume_state::RESUMED_PENDING_VCONT; >                       ^ > In file included from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/gdb_string_view.h:49:0, >                  from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/common-utils.h:46, >                  from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/common-defs.h:125, >                  from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/defs.h:28, >                  from ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:22: > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function 'const resumed_pending_vcont_info& remote_thread_info::resumed_pending_vcont_info() const': > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1132:35: error: 'resume_state' is not a class, namespace, or enumeration >      gdb_assert (m_resume_state == resume_state::RESUMED_PENDING_VCONT); >                                    ^ > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/gdb_assert.h:35:13: note: in definition of macro 'gdb_assert' >    ((void) ((expr) ? 0 :                                                       \ >              ^ > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function 'void remote_thread_info::set_resumed()': > ../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1140:22: error: 'resume_state' is not a class, namespace, or enumeration >      m_resume_state = resume_state::RESUMED; >                       ^ > Huh, maybe it gets confused because there's a method named "remote_state" as well? Does it work if you rename the method to something else? Simon