From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by sourceware.org (Postfix) with ESMTPS id 8430C3858C83 for ; Wed, 11 Jan 2023 19:05:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8430C3858C83 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-f54.google.com with SMTP id h16so16027132wrz.12 for ; Wed, 11 Jan 2023 11:05:21 -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=O82WgxtKCt2By4tw+Tfc1nzXrfxd2eytgshpyyriUD4=; b=dTMUS5ameEVnIuW0e7+v3RaFDOmHqMkufgEOAQ+ZTARoUPKPRvW2H8HtQ4FBqtQ7Vr cWAM1vD4K7ndBxYF3m/DEzAo+P23bb2OlzsFSUYAz9JHAwq7dsUdsKd9dc6Z6UJstL2u n25Ouxwv9gPbdWOrvJxZw7sFzGQ4KKUnEuWm3v/OP0T/Lno+mPpA/LMuSi02NKA3RCSe cH4HD0K9hN/3FnIf6bzRGClAYOP02eK9bfEwFzPCyW/KNpJgYOxG2q82phaEV/TQHYZu O2mHcK5f/AYykStPUNXjq6+Nn4m+F3xQm3z4v33K/OeJRnnxR8PyynT677htVYwCNr5D s0xg== X-Gm-Message-State: AFqh2kp+FIl5kD+51thNXBMYY1Wvdxe+LntcbS4T4MDvsyY6sOBoWayf qh1XLQ0bT0v7oyeizNyRn1tZXsjNmH/52w== X-Google-Smtp-Source: AMrXdXsfzujzdown9ewaItCvnh+iLRWXx0n2fznzcQ78VE/U21DbBVY0CttowaHf5BGRydoegucMrA== X-Received: by 2002:adf:dd4c:0:b0:25e:2dae:260e with SMTP id u12-20020adfdd4c000000b0025e2dae260emr45030533wrm.24.1673463920116; Wed, 11 Jan 2023 11:05:20 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id i10-20020adff30a000000b0024228b0b932sm17484911wro.27.2023.01.11.11.05.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 11:05:19 -0800 (PST) Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint To: Simon Marchi , Tom de Vries , gdb-patches@sourceware.org References: <20230103192216.108444-1-simon.marchi@polymtl.ca> <315f1d7a-a948-5512-fd89-a40d7a25e937@polymtl.ca> From: Pedro Alves Message-ID: Date: Wed, 11 Jan 2023 19:05:18 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 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=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: On 2023-01-10 8:42 p.m., Simon Marchi wrote: > On 1/10/23 14:56, Pedro Alves wrote: >> >> I think the intention of not issuing PASS by default, was that you can >> use gdb_breakpoint to implement other procedures inside lib/gdb.exp. >> If gdb_breakpoint starts issuing a PASS, then an implementation detail >> of such procedures starts being visible, by ending up with two PASSes for >> each call of the procedure that happens to use gdb_breakpoint, one for >> gdb_breakpoint, and one for the caller procedure proper. > > And do you think this is important? Personally, I don't think the > multiple PASSes is a problem. As mentioned, this is more of a generic concern of all procedures exposed by lib/gdb.exp. gdb_breakpoint was just one among many. Seems better to look at the overall design/direction rather than just one case in isolation. Let's take runto. It calls gdb_breakpoint (which used to use gdb_expect before your change), and then gdb_run_cmd, and then gdb_expect directly. gdb_run_cmd itself uses gdb_expect. gdb_run_cmd may use gdb_reload, which calls gdb_load, which uses gdb_load_cmd, which uses gdb_expect. So changing any of these gdb_expect to gdb_test_multiple would result in intermediate PASSes starting to be emitted. Depending on refactoring, etc, you'd get different internal PASSes. Depending on different target, you'd get wildly different internal PASSes, etc. You'd get a lot more mismatching PASS/FAIL cases when one of the internal gdb_test_multiple's failed. Etc. That doesn't seem like the ideal approach to me.