From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by sourceware.org (Postfix) with ESMTPS id B09133858D34 for ; Sat, 20 Jun 2020 00:00:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B09133858D34 Received: by mail-ot1-x342.google.com with SMTP id k15so8619628otp.8 for ; Fri, 19 Jun 2020 17:00:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=uOUGEjTtPtJFSmNeajGMK/YVorZpjJxpkCjOtNwA6Nk=; b=C5Vj9L3q7ifbSqnwuVNJEpMkfaIptSSR4w35y6qZwGunxW01MGiLrPh0UHkRsyxTvh OspVpvdZYHshK8CVOD19BP5qmMLup5PwBWuXSIcu7GhaJnYpfxef3C35Mh8T9mNMeFSM wfavRrbgSGb+Qp8emWtyvIKkMqZX4B+tcqZegijYR1t2pa1OVBn6XQn8Z23MBeUnfktb pXyM4AgkkWjdMTfFB9Or4cx4EwaQjS2uX/kooooOWWup0niZIqD1li6unrlw4sCYpn5y 5b64puAPq2TJyGtNlcn98dMFroGd0UYf4JZacxxO6dTm41rCpAT08xTlsJYMYyX0ij+6 Uofg== X-Gm-Message-State: AOAM531HjE5EidnkpKxAGZ7f19bpSaTdTPdX5Yp4ntStFcVZrbmq5QYY NwWkarl6sENdZYPW8HZ4r0PUyaAx X-Google-Smtp-Source: ABdhPJxyxY8vLN4yuVEx0XJP9vZ3PMPmSas4a6GRkaaqB+HdihsoL4t9Eph2iDk4TauAIJ6e2iUPAg== X-Received: by 2002:a9d:5604:: with SMTP id e4mr5047610oti.166.1592611234073; Fri, 19 Jun 2020 17:00:34 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-145-204.dsl.ablntx.sbcglobal.net. [70.133.145.204]) by smtp.gmail.com with ESMTPSA id q85sm1607974oic.23.2020.06.19.17.00.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jun 2020 17:00:33 -0700 (PDT) Message-ID: <5EED519E.6050209@gmail.com> Date: Fri, 19 Jun 2020 19:00:30 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Tom Tromey CC: gdb@sourceware.org, "dejagnu@gnu.org" Subject: Re: GDB testsuite overrides default_target_compile and breaks References: <87zhac871g.fsf@euler.schwinge.homeip.net> <274e2a71-ddb0-18cc-70c1-4ca9ccf8bd29@welcomehome.org> <9a017568-911d-9352-859a-8721b2f47c53@welcomehome.org> <29b3fe32-b3c9-653e-2ef3-6e89083188f6@welcomehome.org> <3e294014-8205-c99c-ecc7-3e9d383e5587@welcomehome.org> <5EE04696.8090209@gmail.com> <5EE05F15.4070408@gmail.com> <5EE19A64.9010307@gmail.com> <875zbnz00s.fsf@tromey.com> In-Reply-To: <875zbnz00s.fsf@tromey.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, FREEMAIL_REPLYTO_END_DIGIT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 00:00:38 -0000 Tom Tromey wrote: > Jacob> What is needed in brief: > Jacob> (1) Merge the features of default_target_compile that the GDB > Jacob> testsuite depends on upstream for 1.6.3. > Jacob> (2) Find the actual extensibility that GDB needs here and add that > Jacob> support to the default_target_compile rewrite slated for 1.6.4. > > Sounds reasonable to me. > > Jacob> The changes were to an internal component and broke an out-of-tree > Jacob> copy of same. I have to draw a line somewhere, and "monkeypatching > Jacob> the core is not supported and can break" is necessary for DejaGnu to > Jacob> develop at all. > > FWIW this makes sense to me. I think it's never been a great idea to > have this override in gdb. Dejagnu wasn't very actively maintained for > a long time, and had low engagement from gdb developers, so it was more > like a convenient way to move forward. > From how it was explained to me, that may have been the only way forward at the time. > Jacob> Monkeypatching the DejaGnu core is not supported and cannot be > Jacob> supported long-term. > > gdb does it other spots as well. For example, check-test-names.exp > overrides log_summary and reset_vars that gdb can show duplicated test > names, and gdb.exp renames "cd" to avoid problems with relative log file > names. > I will look into these and see what we can do to move generally useful functionality upstream. (There are many features in the GDB testsuite that I eventually want in DejaGnu, like parallel testing, although the core implementation of that might be somewhat different as I want it to be as close to transparent as possible.) Quick checks on those examples suggest that they will not cause problems (until the overridden procedures disappear into an internal namespace) because check-test-names.exp wraps log_summary and reset_vars instead of replacing them with out-of-tree copies. Wrapping "cd" avoids problems for similar reasons (technically that one is monkeypatching Tcl itself rather than DejaGnu) but DejaGnu's own initialization procedures should probably ensure that the log file is active with an absolute file name. I might have to add a "monkeypatch the monkeypatches" module, loaded after the init files, to maintain backwards compatibility with the recent GDB releases, but that is a last resort. > Jacob> GDB seems to have also extended default_target_compile, so a > Jacob> discussion on this is needed because there seems to be a need for some > Jacob> kind of language extensibility feature to allow new > Jacob> language-default-selector options to be defined without overriding the > Jacob> entire default_target_compile procedure > > Yes, that would be good to have. I think this has been patched when a > new language is added to gdb; changing this function to work in some > extensible way would be a nice improvement... while there are no > concrete plans I know of to add new languages to gdb, one never knows > when someone may show up with patches. > The rewritten default_target_compile will be less of an "if forest" and more table-driven. Language defaults then become entries in an internal table, so all we need is an API call for init files to add entries to that table. > Jacob> If I understand correctly, merging the features currently carried in > Jacob> gdb/testsuite/lib/future.exp upstream will cause all existing GDB > Jacob> releases to correctly use the upstream version of > Jacob> default_target_compile, making the partial reversion patch > Jacob> unnecessary. > > Yes, assuming that gdb's detection code continues to work. It does > this: > > if {[info procs find_gnatmake] == ""} { > rename gdb_find_gnatmake find_gnatmake > set use_gdb_compile 1 > } > # ... sequence of such checks ... > if {$use_gdb_compile} { > catch {rename default_target_compile {}} > rename gdb_default_target_compile default_target_compile > } > That code is testing the existence of API procedures to decide if it wants to override an internal procedure. There are no plans to remove find_* prior to 2.0; even if a better API ("testsuite tool"?) is introduced, compatibility shims will remain. (Now that I think about it, even 2.0 may still carry a "compatibility mode" for the 1.x API.) > Anyway, I compared gdb_default_target_compile with > default_target_compile. I think there are two kinds of changes. > > [...] > > I can write some patches to merge this stuff in. > Many thanks for the patch set. I will merge them and add documentation and tests over the weekend or so. -- Jacob