From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 545183858C53 for ; Wed, 20 Apr 2022 10:33:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 545183858C53 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-f45.google.com with SMTP id u3so1646112wrg.3 for ; Wed, 20 Apr 2022 03:33:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=PVs4MjEpt14j4R4NfG8vgohrOYVtIsnEpAhUCGDxG44=; b=Ounw4+TqwoJ3E3cgMCVI9xTIuUx4aIqgfHpiEEm2i4pSWwR0BrzJ1ELICwfzOlyi6m VjSM7urqOnEBPPHRvRhTFx1qD1hIGcpqO17Pwkbk7NH1d8g61/SYfJ43WmGltqjCTCeH rMRTRGb1EOweYolVFjxscA9OHocZim/nH/o/JijzTRH8l5whwNeocc3mB50Si3IapYbJ PlON5LMCzicK4wa5wnG7oSrQn9od+Tlqf9Oa2ASP35wbIive5IbGrv67BuSNIZJCnwJj jQDdnQ5ySgFytEfEG+XUfbYmmy4eeuZ41UTfRcRSPEQNgfeQwM3al5I5sMut34e2W3y4 Q4Fg== X-Gm-Message-State: AOAM533zkTdKLa7eGoAMwcrHM+4CuSNcmZSY5x429PsmPNFIAeWgf5Jw 1Cug8/sIg3mi1VC7mo+IqfM= X-Google-Smtp-Source: ABdhPJz4dnW9DQnj1wRuWPj3q+C6QvwOkLQGMob0BvZEw5KoyIMducu/xYFzohusvbCaCMNcU0SVeA== X-Received: by 2002:adf:e3c8:0:b0:207:a128:6205 with SMTP id k8-20020adfe3c8000000b00207a1286205mr14749068wrm.370.1650450832030; Wed, 20 Apr 2022 03:33:52 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id i27-20020a1c541b000000b003928e866d32sm11457087wmb.37.2022.04.20.03.33.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Apr 2022 03:33:50 -0700 (PDT) Message-ID: <498102ba-9a88-5ca7-ebe7-7120b655ee9c@palves.net> Date: Wed, 20 Apr 2022 11:33:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] Debug support for global alias variable Content-Language: en-US To: "Natarajan, Kavitha" , Tom Tromey , "Natarajan, Kavitha via Gdb-patches" Cc: "George, Jini Susan" , "Parasuraman, Hariharan" References: <66ca57f9-c3b8-4aeb-f07c-c3c254dfdea6@redhat.com> <87ilra1gcx.fsf@tromey.com> <87sfqawi0v.fsf@tromey.com> <871qxsisr7.fsf@tromey.com> From: Pedro Alves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 10:33:55 -0000 On 2022-04-20 07:00, Natarajan, Kavitha via Gdb-patches wrote: > + gdb_test_multiple "p $v" "p $v" { The second argument here is the test's name used if gdb_test_multiple hits a FAIL pattern internally, like an internal error or a timeout. It should be the same text used in the pass/fail messages below. The easy way to do that is to use $gdb_test_name in the pass/fail calls below. See example below. > + -re " = {field1 = 1, field2 = 2}.*$gdb_prompt $" { You can use -re -wrap instead of explicitly matching $gdb_prompt. > + pass "print alias of variable $v" > + } > + -re ".*has unknown type; cast it to its declared type.*$gdb_prompt $" { The leading .* is unnecessary. > + if { $old_clang } { > + xfail "print alias variable $v" > + } else { > + fail "print alias variable $v" > + } > + } > + } I believe something like this should work: gdb_test_multiple "p $v" "print alias of variable $v" { -re -wrap " = {field1 = 1, field2 = 2}" { pass $gdb_test_name } -re -wrap "has unknown type; cast it to its declared type" { if { $old_clang } { xfail $gdb_test_name } else { fail $gdb_test_name } } } Note I also removed some ".*" from the right side of the patterns, I believe they should be unnecessary. Could you please go over the patch tweaking the new gdb_test_multiple calls to follow the same pattern, please? Thanks for the patch!