From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id 0A7CC3858CDA for ; Tue, 8 Nov 2022 14:01:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0A7CC3858CDA 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-f45.google.com with SMTP id i5-20020a1c3b05000000b003cfa97c05cdso1137231wma.4 for ; Tue, 08 Nov 2022 06:01:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nPZiEszkYRQZIcgCAwWtX3LjwMfHyEIVBQ6RptW3F8g=; b=ndN71ky40OOae0y/9+i3zvvxBYaQKmekZfoaxt1+E4JvLFae3JvDDFBtBRk2wnErnm GNX53uNuKsEesc5+5TmNyumzCPUjZJDKc1x5gew9wBgCt1F+h7EU84wqvTvF18SnAWkr ZacbYec5aHVVM3BSOOvNbk2jdnqNnFCWZqv0tjPo/Hp1IdVPb1rv6KxySNV5NWAuW/rH okxWLQlYsAUbduMsEebRkLSHCIODBNP7U/9EybKPrc6JMJ3pPRDbC9E6JZOGW+8Njg2L QiFXR5dl7z5S39H6QoWQk01lMrojXzZwHoiYiiSJYB3jC8ED09f3TX9b7T1CxfXI4DlF Smqg== X-Gm-Message-State: ANoB5pkgr8CJRna5pGecThT56DZ2XOg/+xwwyuunuTFI7s3Ns1X5s3b4 W+p7xgRAGCpB8bgFWRBk2YM= X-Google-Smtp-Source: AA0mqf6PGhdkqMgmXs7F2Y69D7rxkiBsgpn2/c0vwk3PmqQTUbyj9M+fy7FzscNcnWRsClvvYiviHQ== X-Received: by 2002:a05:600c:ad9:b0:3cf:a932:d480 with SMTP id c25-20020a05600c0ad900b003cfa932d480mr8554775wmr.83.1667916083649; Tue, 08 Nov 2022 06:01:23 -0800 (PST) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id p25-20020a05600c1d9900b003cf77e6091bsm14930264wms.11.2022.11.08.06.01.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Nov 2022 06:01:22 -0800 (PST) Subject: Re: [PATCH v2] gdb/gcore: interrupt all threads before generating the corefile To: Lancelot SIX , gdb-patches@sourceware.org Cc: lsix@lancelotsix.com References: <20221017134335.385594-1-lancelot.six@amd.com> From: Pedro Alves Message-ID: <91a96187-48fd-4823-6b82-dbf8e8f70bce@palves.net> Date: Tue, 8 Nov 2022 14:01:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20221017134335.385594-1-lancelot.six@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Lancelot, On 2022-10-17 2:43 p.m., Lancelot SIX via Gdb-patches wrote: > --- /dev/null > +++ b/gdb/testsuite/gdb.base/gcore-nonstop.exp > @@ -0,0 +1,73 @@ > +# Copyright 2022 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# This testcase checks that when in non-stop mode with some threads running > +# the gcore command can interrupt all threads, generate a core dump and > +# restart threads as required. > + > +standard_testfile > + > +if { [prepare_for_testing "failed to prepare" \ > + ${testfile} ${srcfile} {threads debug}] } { > + return > +} > + > +gdb_test_no_output "set non-stop on" Let's please make this testcase work with --target_board=native-extended-gdbserver. As is, it will most certainly fail because this is too late to enable non-stop mode. Most tests address this by appending the set command to GDBFLAGS, like this from gdb.threads/interrupt-while-step-over.exp: save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop on\"" clean_restart $binfile } Otherwise LGTM. Pedro Alves