From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 43EB53858439 for ; Tue, 16 May 2023 10:38:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43EB53858439 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684233515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=57pS2Et4lQjoqc4OgcOBWzYVCGeuAl/RLRve7/zGT8g=; b=DlrhaGCQ7SJyF7xFFnRPsldWzJ3akN3LXKFlUGGhu8yNIMhW1E5xni032ViHpiE8C4ycRF ZvRI66CIFg1LzRlsZ/9/V8K5dtVGERZmnB2B9YhU0Zwx3+RB4i8unPf9A8pQqEhja75eLB 1P67pe6ry+TQjkQYf4vpG+jpiUu7Rlw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-_P85E_MIOv218qpbtSilQg-1; Tue, 16 May 2023 06:38:34 -0400 X-MC-Unique: _P85E_MIOv218qpbtSilQg-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-30643d4a430so4984095f8f.0 for ; Tue, 16 May 2023 03:38:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684233513; x=1686825513; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=57pS2Et4lQjoqc4OgcOBWzYVCGeuAl/RLRve7/zGT8g=; b=jj7HkRmSajE48H1bk62PFCxnt5TgdGGY6UHE9ZaLI2YMYahK0lLZ77j4HFpkBMYRwQ a9ch70/jpEo9HxF2aGYZx9fEbr6x9ApoA9q6hhPGc/0JCLuueOoyY5OKzyP3r/OPslOR lH1QnUI/GrPwSOboxe9PUNL3EdYSDDUVtUeETuyXpr8CblZnX/BE6JsaZ2yMCffPQNUa KOCYTSoiJ119wjW+syVHygvc257CZqx6ktkiV5M5HWtopYk6/EhVnyjve8ZU3c4Spaqg xleUnTLdsVdVnPO50wo1GTP6511iFL/Z/i1rH7hNSw1qXka+2LLRpoztQ9fVeogI0m2O u5AA== X-Gm-Message-State: AC+VfDy3v7lWbDWBWfn5Ga+E/c5MRSwqfedzkkhDXyL0XC6zUW+dz90U rrFAdpQ3NVOXIKnmxH6scmjxorqNbBJHWC6KFqHXFyBA4EK8ebPPgk52YK0bDn5tgBLV4KOq4Kh 3QBCI2yfJWPKCt4FqmxDApVgzjS1wHg== X-Received: by 2002:adf:de8d:0:b0:2f5:3fa1:6226 with SMTP id w13-20020adfde8d000000b002f53fa16226mr27536206wrl.14.1684233513401; Tue, 16 May 2023 03:38:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MgwlMaAh/g1Nvkfsk25+FhE9Nz9I14ioMmzYRPSkXWiDVhvffoWhJsheMWSqWDOS0XVkA9w== X-Received: by 2002:adf:de8d:0:b0:2f5:3fa1:6226 with SMTP id w13-20020adfde8d000000b002f53fa16226mr27536187wrl.14.1684233513039; Tue, 16 May 2023 03:38:33 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id u9-20020adfed49000000b0030647449730sm2145375wro.74.2023.05.16.03.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 03:38:32 -0700 (PDT) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/testsuite: make gdb_supported_languages a caching proc In-Reply-To: References: Date: Tue, 16 May 2023 11:38:31 +0100 Message-ID: <87353wbly0.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Simon Marchi writes: > On 5/12/23 06:00, Andrew Burgess via Gdb-patches wrote: >> Rewrite gdb_supported_languages as a caching proc that actually >> queries GDB for the list of supported languages, rather than just >> containing a hard-coded list of languages. >> >> There's only one test that uses this proc right now, >> gdb.python/py-function.exp, and that still passes after this change, >> with no changes in the test names. >> --- >> gdb/testsuite/lib/gdb.exp | 27 ++++++++++++++++++++++----- >> 1 file changed, 22 insertions(+), 5 deletions(-) >> >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index 010da097766..52af0c7358f 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -8591,11 +8591,28 @@ proc cd { dir } { >> } >> >> # Return a list of all languages supported by GDB, suitable for use in >> -# 'set language NAME'. This doesn't include either the 'local' or >> -# 'auto' keywords. >> -proc gdb_supported_languages {} { >> - return [list c objective-c c++ d go fortran modula-2 asm pascal \ >> - opencl rust minimal ada] >> +# 'set language NAME'. This doesn't include the languages auto, >> +# local, or unknown. >> +gdb_caching_proc gdb_supported_languages {} { >> + # The extra space after 'complete set language ' in the command below is >> + # critical. Only with that space will GDB complete the next level of >> + # the command, i.e. fill in the actual language names. >> + set output [remote_exec host $::GDB "$::INTERNAL_GDBFLAGS -batch -ex \"complete set language \""] >> + >> + set langs {} >> + if {[lindex $output 0] == 0} { > > Maybe error out if the exit status is not 0? Done. > > Otherwise: > > Approved-By: Simon Marchi Pushed. Thanks, Andrew > > Simon