From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by sourceware.org (Postfix) with ESMTPS id 263793857825 for ; Thu, 9 Jun 2022 14:30:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 263793857825 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-f48.google.com with SMTP id o8so4829087wro.3 for ; Thu, 09 Jun 2022 07:30:22 -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=gKRcjqsPlgxCdrxGW1BAFufj7Ftl8aU1Ql64szX3SvM=; b=UR4pjqsF3uABVPNCBn3e9ahg52PU5Cvsh80FfuTvIq4xIJvl+mAnGLlROW2fVbXd4v wC83fN9zEv0YlcFYLmkqjws2x9P/yqkg4Dby+sJrI5df5JnYA6tmiapiaAOoMIKQM7E1 /oKBs3UTkONkaX15fFJi4KjMBvB8E18/cibgfue6U2yE5snpnDorNEloOSuxSrNybKCu 8grKPK0IFPqo+fl2eV970CckjojG+CM/UKb6e8Svpp3DmQgVLY0X184JbSiqlDxnqf0s 7pnosJAlnrcep9Fq/H/neqfozppJlo00eGx86PcC/l831ne11X9eB2T8ky3K9GZ4vhCc 1pBA== X-Gm-Message-State: AOAM530iMJqFU7/srquvW2Z4ImYsNbzIxMLWdJimxGDyINIvm3QXOk2o 6eCNTUV/55wEW+TV9U1DV+Dn/dX/xB4= X-Google-Smtp-Source: ABdhPJyaG2uoKUH1mQzz6atMmr0ca2PnQXtxdgh+GgpxDeA0SJOq9ED586zyGIIxWUTAE7FILElrhg== X-Received: by 2002:a5d:4242:0:b0:213:b50d:879f with SMTP id s2-20020a5d4242000000b00213b50d879fmr35197159wrr.222.1654785021039; Thu, 09 Jun 2022 07:30:21 -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 bg16-20020a05600c3c9000b0039763d41a48sm29704322wmb.25.2022.06.09.07.30.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jun 2022 07:30:19 -0700 (PDT) Message-ID: <94ce4a6d-e491-df16-d6aa-f202c4c9c3e0@palves.net> Date: Thu, 9 Jun 2022 15:30:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] [aarch64, testsuite] Document the ARM_CC_FOR_TARGET testsuite variable Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org References: <20220609130645.246513-1-luis.machado@arm.com> From: Pedro Alves In-Reply-To: <20220609130645.246513-1-luis.machado@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 09 Jun 2022 14:30:24 -0000 On 2022-06-09 14:06, Luis Machado wrote: > This variable is useful when exercising AArch64 multi-arch support (debugging > 32-bit AArch32 executables). > > Unfortunately it isn't well documented. This patch adds information about it > and explains how to use it. > --- > gdb/testsuite/README | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/gdb/testsuite/README b/gdb/testsuite/README > index 3a34dcdd154..5b3fde75ece 100644 > --- a/gdb/testsuite/README > +++ b/gdb/testsuite/README > @@ -736,3 +736,31 @@ Use [is_remote target] to check whether the DejaGnu target board is > remote. When what you really want to know is whether GDB is using the > remote protocol, because feature X is only available when GDB debugs > natively, check gdb_protocol instead. > + > +Architecture-specific settings > +****************************** The non-architecture-specific settings are actually called "parameters", as in: Testsuite Parameters ******************** I think your new section should come right after that one, and be called "Architecture-specific Parameters" > + > +This section documents architecture-specific settings and flags that can be s/settings and flags/parameters/ > +used with the GDB testsuite. > + > +- AArch64 (Linux) > + There should be a line with the parameter name before describing it, like in the generic section. Just: ARM_CC_FOR_TARGET followed by an empty line. > +The AArch64 ports of GDB and GDBserver support debugging AArch32 32-bit > +programs running on 64-bit state. There are some tests under gdb.multi/ > +that exercise this particular feature. > + ... > +The tests will attempt to find a compiler capable of generating 32-bit "attempt to find" here sound a bit odd here, since with the variable set, the testsuite doesn't try to find anything, it assumes what we specify works. See below. > +executables through the ARM_CC_FOR_TARGET variable. This variable should > +contain the command line for the compiler, including the full path to it, if > +the compiler is not in $PATH. > + > +If ARM_CC_FOR_TARGET is not set, the testsuite will guess some compiler > +commands. If none is found, or if the 32-bit executable generated by > +compiler can't be executed correctly, the tests will be marked UNSUPPORTED. > + > +The list of 32-bit Arm compiler names the testsuite will try can be found > +in gdb/testsuite/lib/gdb.exp:arm_cc_for_target. > + I suggest swapping around the description to first say what happens by default, and then talk about overriding the default. Like this: ARM_CC_FOR_TARGET The AArch64 ports of GDB and GDBserver support debugging AArch32 32-bit programs running on 64-bit state. There are some tests under gdb.multi/ that exercise this particular feature. By default, the testsuite tries to find a compiler capable of generating 32-bit executables. If no compiler is found, or if the 32-bit executable generated by the found compiler can't be executed correctly, the tests will be marked UNSUPPORTED. The list of 32-bit Arm compiler names the testsuite will try can be found in gdb/testsuite/lib/gdb.exp:arm_cc_for_target. You can set ARM_CC_FOR_TARGET to override the search and explicitly specify the compiler to use. This variable should contain the command line for the compiler, including the full path to it, if the compiler is not in $PATH. > +Example invocation: > + > +make check-gdb TESTS="gdb.multi/multi-arch.exp" RUNTESTFLAGS="ARM_CC_FOR_TARGET=arm-linux-gnueabihf-gcc" The command line should be indended, like all the other example invocations in the file. Otherwise LGTM. And ... I notice I actually broke setting ARM_CC_FOR_TARGET... I'll fix it in a second.