From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by sourceware.org (Postfix) with ESMTPS id 78BAF3858D28 for ; Thu, 26 Jan 2023 17:34:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78BAF3858D28 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-wr1-f47.google.com with SMTP id m7so2522561wru.8 for ; Thu, 26 Jan 2023 09:34:54 -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:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ENx4xLwFvfsioE8U8JjZG3poDIyFiFgIwkz0j0W1DhM=; b=njZT76YqSsCO9BKyFyt353OesdAU6HBD2dKRVseS0SFgDoggfkwQk7EyRkpPAHQ6cZ GG83SOzZ0G62MWsybXiRrJhjVST9dEOZYbSMXYke2r0k371WaVWtS6s+Eq40hvxu5n6S 3RaPsDyhiyH37JpEeeGumM8hT21k+3WsWnTHP9W68AqV2P/i8HTndaZvs56oumrP2C0D NlsY4gOKqp+HIs/k+wygqTv90UILUz5VgobhM1ZTIqkpkkDtHRR5na2a1mXRCTAOnYxK laGHKdploHKzydy/JByTDI/TbixqiBpfGhi2VrRe22KfgDAnVKUOLm78lL0NN2ifaZmX 6aiA== X-Gm-Message-State: AFqh2kojVqTeyZcqEa1kRTZX9df1IDQmQ+yGt/+xIQk5ZuEXag7q82wV e7Fgy+zJY54pL7ZcPGYcUGb9FoIQgtWQIA== X-Google-Smtp-Source: AMrXdXu1A4YzLK7PHIoWyYEouPyOjIXIs9qqLAEKmhJZ+994SuznuSC3xbz45YvhyZF8OLS0hBxHlg== X-Received: by 2002:adf:c614:0:b0:248:ab8a:5144 with SMTP id n20-20020adfc614000000b00248ab8a5144mr25599209wrg.63.1674754493012; Thu, 26 Jan 2023 09:34:53 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id j2-20020a5d4482000000b002be063f6820sm2240892wrq.81.2023.01.26.09.34.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Jan 2023 09:34:52 -0800 (PST) Subject: Re: [PATCH 12/27] Use clean_restart in gdb.trace To: Tom Tromey , gdb-patches@sourceware.org References: <20230125224614.1006886-1-tom@tromey.com> <20230125224614.1006886-13-tom@tromey.com> From: Pedro Alves Message-ID: <2912783e-3846-cc5a-9225-3ed08a96f18f@palves.net> Date: Thu, 26 Jan 2023 17:34:48 +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: <20230125224614.1006886-13-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 2023-01-25 10:45 p.m., Tom Tromey wrote: > --- a/gdb/testsuite/gdb.trace/unavailable.exp > +++ b/gdb/testsuite/gdb.trace/unavailable.exp > @@ -202,10 +202,7 @@ proc gdb_collect_args_test {} { > > foreach target_name ${trace_file_targets} { > # Restart GDB and read the trace data in ${TARGET_NAME} target. > - gdb_exit > - gdb_start > - gdb_reinitialize_dir $srcdir/$subdir > - gdb_file_cmd $binfile > + clean_restart $binfile Note this one is not 100% equivalent, because this was using gdb_file_cmd instead of gdb_load for a reason -- I think because afterwards we're explicitly connecting to a target, while gdb_load may connect to the target. I recall patches from Daniel switching from gdb_load to gdb_file_cmd in tests that don't really need execution for that reason years ago. ISTR a number of them, but I'm not finding all that much. I did find this one, though: https://sourceware.org/pipermail/gdb-patches/2010-March/072735.html So IIRC, what Daniel described back then is I think the reason several tests in for example gdb.base/ use gdb_file_cmd. So I grepped for gdb_file_cmd in gdb.base/ and randomly picked gdb.base/list.exp, used git blame and that led me to this patch: https://sourceware.org/pipermail/gdb-patches/2012-June/093697.html which again is exactly about avoiding gdb_load. So maybe for the cases we are using gdb_file_cmd today, we should use: clean_restart gdb_file_cmd $binfile instead of: clean_restart $binfile ? Pedro Alves > gdb_test "target ${target_name} ${tracefile}.args.${target_name}" ".*" \ > "change to ${target_name} target"