From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 00WUA/BINmhtDjcAWB0awg (envelope-from ) for ; Tue, 27 May 2025 19:21:20 -0400 Received: by simark.ca (Postfix, from userid 112) id F359C1E11C; Tue, 27 May 2025 19:21:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 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 817A21E089 for ; Tue, 27 May 2025 19:21:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ED6C1385C6DC for ; Tue, 27 May 2025 23:21:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED6C1385C6DC Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 5C2F93857839 for ; Tue, 27 May 2025 23:20:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C2F93857839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C2F93857839 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1748388049; cv=none; b=g9pijx211P/gz7bWefs0UU8S1jo82wtd7OuEb7QlhrDm6YmQ33Wy0GeD1kxWCSfDD10sSBdSC68n1UzE2Nzaj4K57ePtjEI/i8AChsinTbF+zZeg5tPZhDphQq0Ah1ZjCplHFGiJtgkfZqar8cSY+d3N3x8hSWORbMi7eYnWS1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1748388049; c=relaxed/simple; bh=MnciBu4QW4A5wzebXaZiMiGdTsmMkPGpChEUbdK7GLE=; h=Message-ID:Date:MIME-Version:Subject:From:To; b=GmsxRLe6RZ8xShMKM3wMBhk6vd2B2DlzQpt1+71qrEiEWeG2RJE29wjvX4JhGXfI1TZhb3Q4ZI2Y65r3edLSjwcf9DHYYsENnVD+ycicTmkDIPL6vBPco4xoSRp4+UjLq4ceMLgTn6B/9XN25EHuuq1VLNBiVFKLpUoIqtomAQY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C2F93857839 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43edecbfb46so35317675e9.0 for ; Tue, 27 May 2025 16:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748388048; x=1748992848; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NbEIKbg/XMD8Uixlt7Hw/u/DbAMUPBLJ+IRARllI96I=; b=l2rETAaFCbT4oHQoBRka7w3tEX2Y40F18a9AQLiimJlfTcEglT5CIRn42dxxnqAF5M IMoaH8Q1qgSERkSLhkDVy2AjPKKVCH1QJrpgx5qXNMe40JnAklSCh5cLmBoC4+DrXDAA T/q4fYI9sn2ro6g6LAf7NbXC4qGQIQMGhDMfOVkMFRe+WKI/1iH70oTxjk3xYEEv5y7L KVLrzkc0KHZcMmgMQAmuFDQDrtbo/aDSf3UE8ufqvNz2WFz69GCsBycv6bzMME2/r/GX 3l3HlrugH1hJJLzk1m7RDipYXZ14JXO9W9eaJk0JnPdI705lqSDnL818OgT+nFwFHo2K 81bg== X-Forwarded-Encrypted: i=1; AJvYcCUYmvI7xJ6OS+PtgJsMq14jmHyT2Lgdwgjr44vpV3rddncaw+Yo+Af3poeqLW/mmCz/ZERE2v9UTE18zg==@sourceware.org X-Gm-Message-State: AOJu0YywGDzo964tBDRCkw/iJkbQyCyvRh/64x87JumXGPmiHiTPOzU6 r5kbbrom1QmZisT8kXQeDSGr4xNa5y5jm6iiYSoQej+6lRwoDMkXqVohuDatLoHF X-Gm-Gg: ASbGnct72/fpGg+t7eK62H0xgVG4lqyPfaUGEbF2w4cj8X7ZiYvKcja1Bf5X5gAfbAq bjFtniOQ+yfCm9TV5Avzbv+tPPYNoH3vsKvKNFceXzTCCykLAD13gbzkxbRHbmveuDJ5nCmxd52 A659stpX0E6bNL7yyv+dAZ5zSGVVpY+REoOJfmVgU500VJLVKMMNp+fbeV+hFPaIU6TJg8hvmgs evckZ5EIQfqaKI5ItAiXv7hlFBxvJ2jas1uU7gBq+kHFupju5+Jm2IcLFHZQGjoUivkIo83sENb HF5GqV2PVEIWON6UBP9uFLomyHMaoaYqBBR17xr2wcKFJqXkYgrBxSxNe08643Go1CyqhLN5rph AI396ML15rq05Ialq5Sw= X-Google-Smtp-Source: AGHT+IFg+JpYnWfinVJCBQsbGP7stsvb57mAOecXr0PctCnNr4PdCgWJzvBUEXzoNvj/VmcLB6J6EQ== X-Received: by 2002:a05:600c:3b02:b0:43d:abd:ad0e with SMTP id 5b1f17b1804b1-44c939c1144mr136554765e9.18.1748388047990; Tue, 27 May 2025 16:20:47 -0700 (PDT) Received: from ?IPV6:2001:8a0:facf:2b00:78e7:5062:b792:6764? ([2001:8a0:facf:2b00:78e7:5062:b792:6764]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4e8b8e18fsm339176f8f.20.2025.05.27.16.20.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 May 2025 16:20:47 -0700 (PDT) Message-ID: Date: Wed, 28 May 2025 00:20:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 42/47] gdb_test_multiple: Anchor prompt match if -lbl From: Pedro Alves To: Tom de Vries , gdb-patches@sourceware.org References: <20250519132308.3553663-1-pedro@palves.net> <20250519132308.3553663-43-pedro@palves.net> <9c94d111-a9a6-4c89-9e8e-4d5386f1562f@suse.de> <401356fc-d91b-4c70-89e2-9d9971b6b094@palves.net> Content-Language: en-US In-Reply-To: <401356fc-d91b-4c70-89e2-9d9971b6b094@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 Ever stepped away from the computer for a few minutes, and had a D'oh! moment? Just happened here. On 2025-05-27 23:41, Pedro Alves wrote: > This idea of replacing GDB with a script is super interesting. Did you consider writing that script > in tcl/expect, though? Seems like it would be a perfect fit. Read input, match against pattern, print > output. :-P Another alternative would be to write a bit of GDB python to register a new command, and > run the real GDB with that. But a script like you came up with mocking GDB completely is nice, it's > very light and more decoupled. Somehow I didn't recall that we can define commands in the CLI with "define foo". :-) I think the best & simplest in this case is to do just that. Like, put this in a gdb script (*): define command echo prefix \n echo prefix foo\n echo prefix bar\n echo prefix \n end then run the testcase with GDB as normal, load the script, and use gdb_test_multiple, all as usual. I can take care of that. * - or invoke "define" manually with gdb_test/gdb_test_multiple like some testcases do. Pedro Alves