From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id 6DA503857C4A for ; Thu, 16 Jul 2020 17:21:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6DA503857C4A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x444.google.com with SMTP id a6so7909589wrm.4 for ; Thu, 16 Jul 2020 10:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Eurc4Sw4vLeotRP1obdvmlpNa01T9KiHmzjod4DWHFk=; b=SoGOGfHQwcZ///UIWvMgSiOHn3spq5uWf5eiHjPiLtOOG4QKNCQQHUnwvcXPiW2uyo tGVe2CnUqzQPf1ydvypoGYHVxiMTRvQNbJkNeQID0pgGv+qHTflOw/b1u+wFMCirN7Mj iB01mYEEZqlLzneSAKlvsalFbHVRYyUmuwL0wwRWUM8YrgI9QtyIjHjD1aQAwFAO5sC7 5/qtria+DjUVRAujYEKrdCjlv9PMRBa2hRRrytcY0ZmwYVIIs2ufvSKlhfRMBFPpmMee +atHdwj79wE1VE01g5/Kdz3a8AcLAFjhYmYmmWQU8tVQ9L6N9YEiCOVyDrwkFFsW5Saf 53pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Eurc4Sw4vLeotRP1obdvmlpNa01T9KiHmzjod4DWHFk=; b=Y0Eev4G+ePW2bvTOLR0Oa5fAk0f9+A/LdaO65NrxFQbuOQhY802GCwctGX+4zyo0rj Zi0aMkjjz+TgbA3tL9nwc9poh4x+1Lir/EpNsfyTWP5Xl3nUYUMOTfZ7uyqx0NNkZaix FLv10D/ZhxYDWZu/kDJg6HzkF4OGbTSPyZ9pBO1t8DqWJhVZU/W9kdA0u8yvOC476k2R Pd0NrHtxxpjogehES8Y8h9D2I/bsVd67wq1hbXZOzPREafJvKcFtSVXuMnZWhpMvlf/D BKi+/PBbVJXcbI81vUdb/FJ9JwEhY8Gf47/e1PkoUTCJF+LSJc7GGTS/7IRpkCVcPXBv 5AcA== X-Gm-Message-State: AOAM530lNlxnQwg7Ix2c5NVslXdFkXutu78S9NrG77pdVcCsxB7yojMy CK6Lsnlf/cInUE/fddGTFeE1dg== X-Google-Smtp-Source: ABdhPJwR5P1LymJBWLd5tDzX0bU4c2h0iwL2PIwACCkf2E1r37EKtTmnxrghHcjhmZigyJ1bRwbNQA== X-Received: by 2002:adf:d084:: with SMTP id y4mr5847427wrh.161.1594920111449; Thu, 16 Jul 2020 10:21:51 -0700 (PDT) Received: from localhost (host86-128-12-23.range86-128.btcentralplus.com. [86.128.12.23]) by smtp.gmail.com with ESMTPSA id d10sm9770189wrx.66.2020.07.16.10.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:21:50 -0700 (PDT) Date: Thu, 16 Jul 2020 18:21:49 +0100 From: Andrew Burgess To: Caroline Tice Cc: Caroline Tice via Gdb-patches , Eric Christopher , Tom Tromey , Simon Marchi Subject: Re: [PATCH] Update testsuite mechanism to allow object files as source files. Message-ID: <20200716172149.GG2737@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.6.15-200.fc31.x86_64 (x86_64) X-Uptime: 18:20:33 up 38 days, 7:27, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 16 Jul 2020 17:21:53 -0000 * Caroline Tice via Gdb-patches [2020-07-16 09:50:36 -0700]: > Since this patch will be resulting in something of a policy change, I > expect there will be a fair > amount of discussion around it. > > High level summary: > In some (hopefully rare) cases, certain tests MUST be built with a > particular compiler to work. If that compiler is not GCC, then it > makes it very burdensome for developers to run the GDB testsuite and > test those tests. This change allows those tests to use object files > (generated by the required compiler) as the test source file, so that > when the test suite is run with GCC those tests will still > execute/test properly. > > Details: > This change is motivated by the fact that clang and GCC sometimes generate > different output, which affects whether or not a test works properly. The > particular motivating example is the gdb.dwarf2/dw5-rnglist-test.exp test, > which tests whether or not GDB is properly reading/handling DWARF v5 > DW_AT_ranges of the form DW_FORM_rnglistx in lexical block dies. GCC does > not generate that code, so compiling the test with GCC does not successfully > test anything. Clang does generate that code, so the only way to properly > test this is to compile the test case with clang. A further twist is that > the GNU assembler currently chokes on DWARF v5 .debug_line sections, because > they start their file index at 0 instead of 1, and the GNU assembler has not > been updated to handle this. This is not a problem for > assembly files generated by GCC, because GCC generates DWARF v3 > .debug_line sections, even when passed -gdwarf-5. Clang on the other hand, > when passed -gdwarf-5, generates DWARF v5 .debug_line tables. So using a > clang-generated .s file for the test is not an option, because the GNU > assembler chokes on it. > > This patch updates lib/gdb.exp to allow it to properly handle test > cases where the source file is in fact an object file, and it updates > the dw5-rnglist-test to use an object file rather than the .cc file. This > in turn makes the test itself compiler-agnostic. I haven't looked at this particular test, but I think any justification for this change, especially when the example you cite is about different DWARF, should include an explanation about why the existing DWARF assembler can't be used in this case. Thanks, Andrew > > > -- Caroline Tice > cmtice@google.com > > gdb/testsuite/ChangeLog > > 2020-07-16 Caroline Tice > > * lib/gdb.exp (build_executable_from_specs): Create output_dir > variable from call to standard_output_file; update code that > compiles source files to object files and copies them to output > directory, to check first and make sure they are not already > object file. If they are already object files, just copy them to > output directory. > * gdb.dwarf2/dw5-rnglist-test.o: New file (object file) > * gdb.dwarf2/dw5-rnglist-test.exp: Update to use .o file rather than > .cc file; this removes the dependency of this test on clang and > allows it to work with GCC as well.