From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Geb/NZThc2KVeQQAWB0awg (envelope-from ) for ; Thu, 05 May 2022 10:39:16 -0400 Received: by simark.ca (Postfix, from userid 112) id D09EE1E058; Thu, 5 May 2022 10:39:16 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 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 36D831E00E for ; Thu, 5 May 2022 10:39:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 698E83858430 for ; Thu, 5 May 2022 14:39:15 +0000 (GMT) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 0644F3857C6F for ; Thu, 5 May 2022 14:38:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0644F3857C6F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id m62so2777286wme.5 for ; Thu, 05 May 2022 07:38:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=oTr+eUzC4sHj6F0MhTW0oEh+I5Gujp47/lWoGA2Tv94=; b=4cD1BRXfGq2wEMnQqXhxmjCZAxk05Ysa60L9vpffxDv7gnGhJbkg3f9TWadqVNa7+U hFg7YHVJOi0qkkVuVkanp0drFPBdTGOZAcMSpFZSK6/xfmA7Pn8Ia6Cv6AcmdMDuOV/5 QpnqA9TWOhqqZf94YiKN0QzxctxfyVq/AoEdg681gscPhF+GiIXymmD4NVxXbz2jJGBZ /oHZOVWGgcaprnGQ7+lDPrD8AzPG8R9UDp4I8wkDC6v92be3qViVG99UAEk2Hbw/+DOd atGtsu3wEzOB8/i8lSNdldWvqWBOurFnIgrCl7bgHDhQi9qUxvgpcgpe+aVFcHOxEdbR ddrw== X-Gm-Message-State: AOAM531P3UgqzOT6csj7lGJ0OBmJwY2XV36H93glMhMKDu3Pqj/UjX0u SHnnqADtNEYuulrBAqXefiBCpUIUa9mGQA== X-Google-Smtp-Source: ABdhPJzlWSZ0k2G4JvscNxLIjpYopEpPE2NCUURgT4pmsnO7+xv9pYHEX8PkkLIamp3cTVwnr3/NLA== X-Received: by 2002:a7b:cc13:0:b0:38e:67e3:db47 with SMTP id f19-20020a7bcc13000000b0038e67e3db47mr5255851wmh.133.1651761533571; Thu, 05 May 2022 07:38:53 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id n18-20020a5d67d2000000b0020c5253d8fdsm1311140wrw.73.2022.05.05.07.38.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 May 2022 07:38:52 -0700 (PDT) Message-ID: Date: Thu, 5 May 2022 15:38:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] gdb: make regcache's cooked_write_test selftest work with native-extended-gdbserver board Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org References: <20220505140930.1087179-1-simon.marchi@efficios.com> From: Pedro Alves In-Reply-To: <20220505140930.1087179-1-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-05-05 15:09, Simon Marchi via Gdb-patches wrote: > Running > > $ make check TESTS="gdb.gdb/unittest.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver" > > I get some failures: > > Running selftest regcache::cooked_write_test::i386.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i386:intel.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i386:x64-32.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i386:x64-32:intel.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i386:x86-64.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i386:x86-64:intel.^M > Self test failed: target already pushed^M > Running selftest regcache::cooked_write_test::i8086.^M > Self test failed: target already pushed^M > > This is because the native-extended-gdbserver automatically connects GDB > to a GDBserver on startup, and therefore pushes a remote target on the > initial inferior. cooked_write_test is currently written in a way that > errors out if the current inferior has a process_stratum_target pushed. > > Rewrite it to use scoped_mock_context, so it doesn't depend on the > current inferior (the current one upon entering the function). > > Change-Id: I0357f989eacbdecc4bf88b043754451b476052ad OK.