From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MsHmMiYH819oGAAAWB0awg (envelope-from ) for ; Mon, 04 Jan 2021 07:16:38 -0500 Received: by simark.ca (Postfix, from userid 112) id C272B1F0AA; Mon, 4 Jan 2021 07:16:38 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 517581E99A for ; Mon, 4 Jan 2021 07:16:37 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7788038708F3; Mon, 4 Jan 2021 12:16:36 +0000 (GMT) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 911F638708C2 for ; Mon, 4 Jan 2021 12:16:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 911F638708C2 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-wm1-x32d.google.com with SMTP id q75so19117207wme.2 for ; Mon, 04 Jan 2021 04:16:33 -0800 (PST) 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=ZL03wdXW14E3ygQntfgHByLbZwAJGut9MUlvBdxVyTY=; b=J5Em5e+39R3w6+xapzxxkWirer9btyftV7zSWEWEhAEcZNO/33+5iVYDkXsA6vKjj7 gLc0Uy44GlRU3+KMBY6WG9lyeFi+FMP4WYRuAPL1L+ABEbq12QAJ9zYBiybesMnC1zVr oqQNmUNsXtlOE0Es0QqnblkSP3U8h70oUm1dlCopzaIMPJRsBBj594RlszI2kxBtXdWz 1EKK54mSS4j9a7nMCdkkXpMkaBfY/KMZSGUnf9TJZU10B7HWl0yNS6KbNR3P4zEFaO8C /NniguhjCx0Fwx8GOqehoJGJyhnV//TwXxLHcx+7apTdpoz6zRxsEFszWCsQgxRlsSPK 9WsA== 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=ZL03wdXW14E3ygQntfgHByLbZwAJGut9MUlvBdxVyTY=; b=NaBMRVc2kD4A/4hnWjNTC/E8A5BB7ei0YQenikJ7gDr2QZ2cM5wCwwZ4TC0MYwURWC od3CkUvE+sZXF4PID3Cja9XbG/43LNqDrmQIFyZOYi7qL85A9n3S8VPIDSchmkHoCV5i a3O30NycMNi9Q3/zU0+Ykn56fK0bvr0KN/Q/7hJW8S8uGy65YIi3NfAfDYt6eUSiCbjL ntJKC3Z6RMe4C8GQTcYk6UjBAig3Hg8LKhFpyb6/X52Pqmvs7JgjXufr/34O1rZP/zSM ceyqH+Y0ukYjL24CCX2HHnymoe+3h4/7NfAyaXRsXzIgLxpp/mGK+WYNtxzKwQsPPfg0 FUmw== X-Gm-Message-State: AOAM531MMiMxIF5zoMBAEsuglKIAN+fRU0oYKtGPu9cYjnVeYyRJOPnf BBH2+emLYMG3Nfo3/j2RfIWZew== X-Google-Smtp-Source: ABdhPJzRLbnxfm9ScG4A4cRA07mkSObDSyMTIRi+05oBLC9hrBLRTzPFkr0PblwZVjyM4jZb8xSDkw== X-Received: by 2002:a1c:6746:: with SMTP id b67mr26431685wmc.8.1609762592699; Mon, 04 Jan 2021 04:16:32 -0800 (PST) Received: from localhost (host86-188-49-102.range86-188.btcentralplus.com. [86.188.49.102]) by smtp.gmail.com with ESMTPSA id s205sm32352305wmf.46.2021.01.04.04.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 04:16:32 -0800 (PST) Date: Mon, 4 Jan 2021 12:16:31 +0000 From: Andrew Burgess To: Joel Brobecker Subject: Re: [PATCH 000/203] Refactor expressions Message-ID: <20210104121631.GY2945@embecosm.com> References: <20210101214723.1784144-1-tom@tromey.com> <20210103070250.GC285722@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210103070250.GC285722@adacore.com> X-Operating-System: Linux/5.8.13-100.fc31.x86_64 (x86_64) X-Uptime: 12:14:28 up 26 days, 16:58, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] 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: , Cc: Tom Tromey , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" * Joel Brobecker [2021-01-03 11:02:50 +0400]: > Hi Tom, > > On Fri, Jan 01, 2021 at 02:44:00PM -0700, Tom Tromey wrote: > > I have long thought that struct expression is the worst data structure > > in GDB. In fact, I've sometimes told people it is the worst data > > structure I've encountered in my career. I've wanted to rewrite it > > for many years, and this year I finally found a workable plan and the > > motivation to do so. This series is the result. > > Thanks for the (mega) series! > > Because of the length of the series, I think it's going to be potentially > more difficult for you to maintain it over time. I so I think it would > be nice if we could put a priority on its review. > > I've now started with part 1: > > > 1. Split functions out from the evaluators. > > > > Each evaluator function is fairly long, and mixes knowledge about > > the structure of the expression (how the exp_elements are laid out) > > with knowledge of the semantics of the operation. > > > > This part of the series, which is about 70 patches, splits out the > > semantics of most operations into their own functions. These > > functions can be then be reused -- which is helpful for ensuring > > that changes don't sneak in. > > > > In this part of the series, sometimes the newly-introduced > > functions have extraneous arguments. This was done partly so that > > some could be reused by generic code in part 2; but also partly > > because it was just simpler to write patches by rote. > > Aside from the commit "what is this code for", I think this part > of the series is a nice improvement on its own. independently > of redesigning struct expression, I've always found the evaluator > functions to be overly long and harder to navigate as a result. > So I think it could go in ahead of the rest if we agree that > this part is good. > > For me, I've gone through the patches, more or less carefully > based on a random sample, and they look good. I paused a bit > about the Ada ones, were you excluded the hanlding of noside == > EVAL_SKIP. I'm not entirely sure why that is, perhaps because > the block consists in a goto nosideret? Looking at what that > nosideret does, it's just... > > | nosideret: > | return eval_skip_value (exp); > > ... so we could inline this in the new functions. > > However, this is really a very minor detail that doesn't need to be > addressed here. > > So, to summarize, if others agree, I'm happy for this part of > the series to go in. I agree with this. I looked through all the patches 001 -> 072. There's a few missing comments that I think should be added, and I would suggest dropping the "what is this code for" patch (if this needs looking at it can be a separate branch), but otherwise this first set would be a good improvement on its own and worth merging sooner rather than later I think. Thanks, Andrew > > > > > 2. Introduce 'class operation' and its subclasses. > > > > This sub-series is around 100 patches. It introduces the new base > > class for an expression operation, and then proceeds to add > > operations for every necessary opcode. In some cases multiple such > > operations are needed -- for example when multiple languages > > implement an opcode in different ways. > > > > Some discussion of the design & tradeoffs appear in the "Introduce > > class operation" patch. > > > > 3. Convert existing code to use operations. > > > > This is a short sub-series of around 10 patches. Each parser is > > converted separately, as are DTrace and SystemTap probes > > > > 4. Delete obsolete code. > > > > The final 20 patches or so are concerned with removing all the code > > that is now obsolete, and with doing some minor tidying of the > > result. > > > > The overall approach here is to replace the current data structure -- > > but only the data structure. I didn't generally try to clean up > > things that seemed a bit weird. > > > > I also didn't try to add new features, like async evaluation. After > > starting the project, I felt that trying to combine this refactoring > > with another, different one would be too difficult. > > > > This is all on the branch t/expression-rewrite-incr in my github. > > > > Regression tested on x86-64 Fedora 32. I also built it on PPC Linux > > to ensure that the ppc-linux-nat.c changes would build. > > > > Tom > > > > -- > Joel