From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6PcRJw9DR2DUfgAAWB0awg (envelope-from ) for ; Tue, 09 Mar 2021 04:42:39 -0500 Received: by simark.ca (Postfix, from userid 112) id 9CD571EF78; Tue, 9 Mar 2021 04:42:39 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 4D1531E54D for ; Tue, 9 Mar 2021 04:42:39 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E996F383F879; Tue, 9 Mar 2021 09:42:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E996F383F879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615282959; bh=sLwRDmGuZEWhVwVyIasjOqQpJL5H22vdoDgvFMfRrOo=; h=Subject:In-Reply-To:Date:References:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WANC0p/EgPoW4nZ/Exs9B/b9BqsQt5BNP1IeeZ8kZGVQ6lD1OyyxHpofO2eJciYqN sbvlQG7+Sh9ULw4EziYAyPItQVvt0SuLonj3iRcL7WpPvp703isItcJRWp7bmwjwrc U53gJGmgGRcQPIwKNu8BT/+3iH+aTOOLE0nd1cic= Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id C55C13870867 for ; Tue, 9 Mar 2021 09:42:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C55C13870867 Received: by mail-wr1-x436.google.com with SMTP id j2so14448796wrx.9 for ; Tue, 09 Mar 2021 01:42:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sLwRDmGuZEWhVwVyIasjOqQpJL5H22vdoDgvFMfRrOo=; b=fVsrwRcplvXbP304I/oUPtWvRavRMmuBrkvLGYjL5Im1dNa5MLkvoCWkHeAPYKC7X9 QlbZLD8SwIKWlLDK0EumeRSk3o5tHx9T/bPd56+obkIPx4btg9qOuui+NkM+LPioeSsD PRGd3/HYgz6iKeOpH3J3T0ArPuVqC1SW3Q51KPKEXPMZ63tFYsd8xmclmGS9B822uo22 HZixlHzm53ZaD41LNV98xwKCzWEeQigycftMOIFIHUXL9q4b7sDzSnPYOUIOqKUFzCpK d3oY/8AvMqcslYiOoxRyNXk5ZuZptdkHB9tqbW6OKk2l6rI6D181Z7joe62E6fjdE7m6 Pl6w== X-Gm-Message-State: AOAM5300idWmD5L8jABLjh5BTA0LxjKQuBmMC2TaHhInXVPWIZ1SIXxm VA3PAYFrD1bsB7IOy4z41cpUBmSQSKqmgg== X-Google-Smtp-Source: ABdhPJwa7DogsDIermpQH7z63SwdbEAsAmK/L18HsM4boQM3Kj5l6UL8WeFAYpgRLeV/mgEr/m66Hg== X-Received: by 2002:adf:e4c7:: with SMTP id v7mr27173893wrm.245.1615282955942; Tue, 09 Mar 2021 01:42:35 -0800 (PST) Received: from [192.168.0.100] (cpc159317-cmbg20-2-0-cust151.5-4.cable.virginm.net. [81.111.29.152]) by smtp.gmail.com with ESMTPSA id a124sm2789795wmh.39.2021.03.09.01.42.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Mar 2021 01:42:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [PATCH v2 2/5] gdb: prevent prefix commands from being hooks In-Reply-To: <1f3b725d-4b0a-d9ab-7553-24b52b3ff256@polymtl.ca> Date: Tue, 9 Mar 2021 09:42:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20210108100706.96190-1-mbarisione@undo.io> <20210125112649.56362-1-mbarisione@undo.io> <20210125112649.56362-3-mbarisione@undo.io> <1f3b725d-4b0a-d9ab-7553-24b52b3ff256@polymtl.ca> To: Simon Marchi X-Mailer: Apple Mail (2.3654.60.0.2.21) 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: , From: Marco Barisione via Gdb-patches Reply-To: Marco Barisione Cc: GDB patches mailing list Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 8 Mar 2021, at 21:32, Simon Marchi wrote: > Ahhh, changes that touch command handling are always scary stuff, we > need to be really careful not to break existing use cases or paint > ourselves in corners for future use cases. Probably why nobody dares = to > review it. I'll give it a try, but know that it still scares me :). It did scare me and took a while because of the many corner cases, difficult combinations of features. My reasoning behind this is that the behaviour is currently confusing (that is, what the user would expect doesn=E2=80=99t happen) and = forbidding this should allow changes in the future quite easily. > One question that pops up is, what if someone ever wants to make a = hook > for a prefixed command. For example, let's say I want to hook "info > inferiors". I don't think that's possible today, but let's say we = want > to make it possible. How would that work? >=20 > This doesn't work: >=20 > (gdb) define hook-info inferiors > Undefined command: "hook-info". Try "help". >=20 > So... maybe defining "hook-info" as a prefix command would allow it? > Not sure, I didn't really think this through, but I wonder if you > thought about that case. You can do it with =E2=80=9Cdefine info hook-inferiors=E2=80=9D which I = found a bit surprising when I discovered it. I think that hooks are incredibly useful but limited. My hope is that my patch series will make them less needed as you can get a better and more powerful behaviour with command renaming. --=20 Marco Barisione