From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by sourceware.org (Postfix) with ESMTPS id BC81E393BC39 for ; Fri, 17 Jul 2020 16:06:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BC81E393BC39 Received: by mail-il1-x144.google.com with SMTP id p15so7733909ilh.13 for ; Fri, 17 Jul 2020 09:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R4lcAaihaEQVgoMAldB4n4mP0IfWJUh7BrgulTYVRPE=; b=bOK3dLdM3xK2mqiXvtwLBHSjb2rZl6aXP4gqpgEF6GMwA697l7wCEyaNSm4rd7DSFu lmnCcdfieD3Ig99p2I6Oga9FTfOB6T7opmplG0cYI+IXYL/U+Z2JlPK9m1OaBNrGitTB yc8CxirpDy8lwMJcVaF/e3DxOHRt7YIzQPxWhAqIPkc09Q5iuP7wy/WBozXYEKmqN1W1 1JESll97OLL1AHHPcfT+OiRoNAHDO0c1e35+qkkG5o58MeLxHcKTI0vg3g8BZ7gsJ5/4 1IlPZ7ATWKcOHFc/fIy9A3Wkuw9fHqdd9fGrxAhJ5sajq/Z22x4yMGqcdk3bR+Q3DbM9 znPw== X-Gm-Message-State: AOAM530f7H4QEQsoS3ZE4aoC2R9Ju2w4EHC+w7ftzEmnrWJ49kMfBM8x uI3Zgfn5sBs8gtp3H6STEEccqgMvMPq6utQBhYlyxQ== X-Google-Smtp-Source: ABdhPJzk2hxN9bejmNKAzm9vifXdvczbTihZ27ErhGB3UqUdp3zxAvLvI8Uumu5rxubMYUUzCbvb9+7arL8SVgarZDY= X-Received: by 2002:a92:d807:: with SMTP id y7mr10207297ilm.187.1595001971977; Fri, 17 Jul 2020 09:06:11 -0700 (PDT) MIME-Version: 1.0 References: <87ft9rmd7c.fsf@tromey.com> <20200717094855.GL2737@embecosm.com> In-Reply-To: <20200717094855.GL2737@embecosm.com> From: Caroline Tice Date: Fri, 17 Jul 2020 09:05:59 -0700 Message-ID: Subject: Re: [PATCH] Update testsuite mechanism to allow object files as source files. To: Andrew Burgess Cc: Eric Christopher , Eric Christopher , Simon Marchi , Tom Tromey , Joseph Myers , Caroline Tice via Gdb-patches X-Spam-Status: No, score=-18.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Fri, 17 Jul 2020 16:06:14 -0000 I've been able to generate/hand-edit a .S file for this test (thanks to various people for help/suggestions). I will drop this object-file approach and submit a new patch (on a new thread) with the .S file update. Thanks everyone! -- Caroline cmtice@google.com On Fri, Jul 17, 2020 at 2:48 AM Andrew Burgess wrote: > * Eric Christopher via Gdb-patches > [2020-07-16 14:16:46 -0700]: > > > Should be just gas in the binutils-gdb checkout? > > GDB's DWARF assembler is written in TCL, and generates a .S file > containing the debug sections and their contents. > > A test will usually consist of some DWARF written in TCL and a C file. > The C file is compiled without debug information and the TCL code then > places references to symbols in the C file into the generated DWARF. > > The DWARF assembler then creates a .S file, which is assembled and > linked with the C file. > > We then start up GDB and debug as normal. > > Thanks, > Andrew > > > > > > > > -eric > > > > On Thu, Jul 16, 2020 at 2:10 PM Caroline Tice via Gdb-patches < > > gdb-patches@sourceware.org> wrote: > > > > > Has the DWARF assembler in the GDB testsuite been updated to handle > > > DWARF v5? Or can it handle that automatically? Is there a good > > > example I can look at to see how to use it? > > > > > > -- Caroline > > > cmtice@google.com > > > > > > On Thu, Jul 16, 2020 at 1:12 PM Tom Tromey wrote: > > > > > > > > Joseph> On general free software and reproducible builds principles: > > > > Joseph> * The source for any checked-in object file should be > checked in. > > > > Joseph> * That source should include comments giving all information > > > required to > > > > Joseph> be able to reproduce the object file byte-for-byte > > > > > > > > In the past we tried this kind of thing, by taking the assembly > > > > generated by the compiler, then editing it and checking it in. > > > > > > > > However, IMO, this turned out to be a pain. The hand editing was > often > > > > not sufficiently documented, and the tests were still > > > > architecture-dependent. Once or twice I think someone has had to > edit > > > > the .S file later, which is error-prone. Also, the earliest test > suite > > > > additions like this didn't include the original source, making this > > > > harder to handle. > > > > > > > > The "DWARF assembler" in the test suite avoids all this, at least for > > > > tests that require particular debuginfo. The main drawbacks of this > > > > approach are (again IMO) that sometimes it's a pain to write the > DWARF > > > > by hand, and that sometimes the assembler framework itself needs > > > > upgrades before one can even begin. However, the tests are much more > > > > robust. > > > > > > > > I'd encourage the extension of the latter approach as much as > possible. > > > > It isn't perfect but IME has been better on the whole. > > > > > > > > Tom > > > >