From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id XAABEEriOGVUbTYAWB0awg (envelope-from ) for ; Wed, 25 Oct 2023 05:39:22 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZpzL+9dJ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3149E1E0C1; Wed, 25 Oct 2023 05:39:22 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1E9CE1E00F for ; Wed, 25 Oct 2023 05:39:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 816033858025 for ; Wed, 25 Oct 2023 09:39:19 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7C2B93857B9B for ; Wed, 25 Oct 2023 09:39:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C2B93857B9B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7C2B93857B9B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698226749; cv=none; b=hpcEVONFUQA/j3BM/fHhHz0OY969cnmDq6h46M3eEewmNrPY5C0MNBDk7BY47o+tw9PCj1d5ZfrwvXahDvEtgmXvFRSuKnYQJ/5/f1gZyNfCkE27bF2FJTP9/32za2CcUoC6vMw4wmq05YTJXELwgRU1c1mqInHJhBngswX4gVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698226749; c=relaxed/simple; bh=VaNTh4gqr501pRC3RovW6IKF/WgicxbSJ3WeHrqpZ2A=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=bNlEBBOKX/sqfWEB1CidSzQ7ZDYO+ALulnT5f806719dJaBWE43ZvdO5Cc/vmpBgtGcy4hH4uEfCPZOgPDnWUbsC8svgWkMYSvYQovi8oD2FxiuZ92F4ZKTdMaOo5PUBmNcS/nfeBhG5Dnz4rus5eAxW0c8YbZEPr5V4XNrf4hE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698226747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3b/KtITFeGo/1QJ24x0GXCJfNRsb1+SAeyGBd5X+n/A=; b=ZpzL+9dJg8aQlg8FUj37t291Rvw1p9ROOwnNfv9yot52UWeWXPUUdDZRnReRLQGwp/z/A5 MtFdyoaTCRoM6m1xbdpD+c2FfHo3C4TQ4RLcdJ/UbRVNzHI2ypD39ITyPAc29///EPaz8F 1w0fdJOm72lWJhzMA1HOKcHX/at3ftk= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-503-owDFcy2BO7iRLM2R7zxIbw-1; Wed, 25 Oct 2023 05:39:03 -0400 X-MC-Unique: owDFcy2BO7iRLM2R7zxIbw-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-53e119e615aso776362a12.0 for ; Wed, 25 Oct 2023 02:39:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698226742; x=1698831542; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3b/KtITFeGo/1QJ24x0GXCJfNRsb1+SAeyGBd5X+n/A=; b=JzUZfgxkPd9Uhbm+DEF3lm1D/Mv2wnqO8nwbxua5BnCunZow38vYbXjsAc1iQcE37E xHBjJJPklZMHT71dxeZEVnbCkwjitwaKeqFWb9CrZK0GMe0lse/aJHIO/nRLRdxsylna RINJUW2uN1Q6QxF64NPhFI9MenQ4GFPR8sm851PiCcCzC0Azc7YuJ8xteqzQlpL7rBl9 ke1G2/VD04gUozNm0kQYdoc1mPQ45GEQkQWWHk0IdksYdegAnVBcpFkK+zcrctHQuGm9 keY7Jf8ztXnYMN0pI8wBHiwlhp39U5J9fNG6fFzPkneQMauGlRp+v8JKdjYJvUG91LW3 rH3A== X-Gm-Message-State: AOJu0Yw23FWs6G5poTMhD+cmqCNI35UH+VQ86r4ewAz7/ucwuwVBUh1o dFUWbp6P3+kjBu5KMaEZ8biYXmHdOPV2sn0HWH5lm7xqi3GGfTmmH8JziVdKHsTFGRX4lORioZ8 cYSYITe4ym+AAmcYp7QYDhxqa1M/9fA== X-Received: by 2002:a05:6402:5111:b0:533:c3d9:767a with SMTP id m17-20020a056402511100b00533c3d9767amr13495785edd.3.1698226742469; Wed, 25 Oct 2023 02:39:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHOkj/Lz+vbL8U7FiSitllCTmd/6LyBQ7kiFehkTCdX9J8revwT90eJkIhxZeXruBcCIEQSQ== X-Received: by 2002:a05:6402:5111:b0:533:c3d9:767a with SMTP id m17-20020a056402511100b00533c3d9767amr13495763edd.3.1698226742088; Wed, 25 Oct 2023 02:39:02 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id q8-20020a50c348000000b005407ac82f4csm3636052edb.97.2023.10.25.02.39.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 02:39:01 -0700 (PDT) Message-ID: <9c602a66-a314-7581-293a-fe9a020a979f@redhat.com> Date: Wed, 25 Oct 2023 11:39:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2] gdb/testsuite: add test for backtracing for threaded inferiors from a corefile To: Lancelot SIX Cc: gdb-patches@sourceware.org, Andrew Burgess References: <20231024122751.134888-2-blarsen@redhat.com> <20231024204015.reo2rccae4uxdntf@octopus> From: Guinevere Larsen In-Reply-To: <20231024204015.reo2rccae4uxdntf@octopus> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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 On 24/10/2023 22:40, Lancelot SIX wrote: > Hi Guinevere, > > I only have a couple of small remarks below. Hi Lancelot! Thanks for the review. I'll fix them for v3. > > On Tue, Oct 24, 2023 at 02:27:52PM +0200, Guinevere Larsen wrote: < snip > >> diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp >> new file mode 100644 >> index 00000000000..9dd135b9167 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.threads/threadcrash.exp >> @@ -0,0 +1,231 @@ >> +# This testcase is part of GDB, the GNU debugger. >> + >> +# Copyright 2023 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 test case looks at GDB's ability to get correct backtraces for a >> +# crashed inferior, recreating it from a live inferior, a corefile and >> +# a gcore. >> + >> + >> +# First check that we have 7 threads. >> + >> +proc test_thread_count {} { >> + set thread_count 0 >> + >> + gdb_test_multiple "info threads" "getting thread count" -lbl { >> + -re "Thread" { >> + incr thread_count >> + exp_continue >> + } >> + -re "$::gdb_prompt " { >> + gdb_assert {$thread_count == 7} >> + } >> + } >> + >> + return $thread_count >> +} >> + >> +# Apply all to quickly check if all expected states are >> +# present. Then, save the full desired backtrace in a list >> +# so we can check full backtraces later. >> + >> +proc thread_apply_all {} { >> + global test_list >> + >> + set unwind_fail false >> + >> + gdb_test_multiple "thread apply all backtrace 100" \ > Is the 100 there to ensure that the backtrace is not truncated (there is > no way that this test gives a backtrace of more than 100 frames)? If so, > why not use something like this? > > with backtrace limit unlimited -- thread apply all bt > > This avoid the arbitrary 100 value. Huh, I didn't know you could do  this. I'll set the limit at the start of the test, so we don't need such long lines everywhere. -- Cheers, Guinevere Larsen She/Her/Hers