From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WS7DGMi3m2DpWAAAWB0awg (envelope-from ) for ; Wed, 12 May 2021 07:11:04 -0400 Received: by simark.ca (Postfix, from userid 112) id 5ACF91F11C; Wed, 12 May 2021 07:11:04 -0400 (EDT) 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 176AC1E54D for ; Wed, 12 May 2021 07:11:02 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6ED7A3835436; Wed, 12 May 2021 11:11:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6ED7A3835436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620817861; bh=bmXiGt6L10Qn4BSqu0TM8vU3ki5OPtnrHSSQuPB9TfI=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jHft78MmOU12E4Rqt9Af+w6eCkiJ1p2whmIzO5hTpTQJz9ErDeW6sau2yyj2WUUGE ncwME4OBuHydPJMDD+kuwHaIk1DP+xQsHLtlHmyIUvy359OrlXzYVOkDCaktt3Ulmh c0yUre4K1r2QL4CPvvzcOYosYet/OtYi8+D1Z450= Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id 04EC43835434 for ; Wed, 12 May 2021 11:10:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04EC43835434 Received: by mail-oi1-x22c.google.com with SMTP id u16so21909040oiu.7 for ; Wed, 12 May 2021 04:10:58 -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=bmXiGt6L10Qn4BSqu0TM8vU3ki5OPtnrHSSQuPB9TfI=; b=tvxEfHNZAFou5B4sskFSrPK3S4MXDJdhEl7Kg3QmGV/+dopx7+alzJm5qXmGyX1+MX kndx8xvhxK5OczVeNUQ1VJGqrm3fqxrcGMNSj3JrS/luq02C0vLBzkknf4v4btSou1zi 9S68oY+NTEGX5JKxKUg+5K0OP0pBi5annXixqTPr07hQGBsTpEGcHhCZs0xS6UjIgAQW R2vUSv4sfJ5pjhILyY+zJz+zVpaWoO/HMz6bsP1y64HDZd4bUbQtYWS5vzzXggwBDpW7 7bqK+4W33bk2nv5kHqYvHPftGu49KYBJa2qQS4YFWyQOnifFjyUoqz+10vfIGSBEsSFi hadg== X-Gm-Message-State: AOAM531ruddGbYckRqisnt3UDHp/QJVy5VgMt8CkmJwMs/+qwOWIyAjV +MBO6tIzJAw8ixvOnDalUnqMnKv9JRR+aV0fZ7jY3A== X-Google-Smtp-Source: ABdhPJwSBPHjdafMZ1U0Y9gehpng+sEvkVvox5udbGE6bH4XYxNXOBHFgGI5vdNztBrF7aJs6jyE3TgLvvmPZT+VDbs= X-Received: by 2002:aca:4acf:: with SMTP id x198mr25626523oia.111.1620817858354; Wed, 12 May 2021 04:10:58 -0700 (PDT) MIME-Version: 1.0 References: <20210108100706.96190-1-mbarisione@undo.io> <20210125112649.56362-1-mbarisione@undo.io> <20210125112649.56362-5-mbarisione@undo.io> <1b0b042b-f8f4-c350-dcbf-1f617670f24f@polymtl.ca> In-Reply-To: <1b0b042b-f8f4-c350-dcbf-1f617670f24f@polymtl.ca> Date: Wed, 12 May 2021 12:10:22 +0100 Message-ID: Subject: Re: [PATCH v2 4/5] gdb: generate the prefix name for prefix commands on demand To: Simon Marchi Content-Type: text/plain; charset="UTF-8" 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 Mon, 8 Mar 2021 at 23:25, Simon Marchi wrote: > On 2021-01-25 6:26 a.m., Marco Barisione via Gdb-patches wrote: > > Previously, the prefixname field of struct cmd_list_element was manually > > set for prefix commands. This seems verbose and error prone as it > > required every single call to functions adding prefix commands to > > specify the prefix name while the same information can be easily > > generated. > > > > Historically, this was not possible as the prefix field was null for > > many commands, but this was fixed in commit > > 3f4d92ebdf7f848b5ccc9e8d8e8514c64fde1183 by Philippe Waroquiers, so > > we can rely on the prefix field being set when generating the prefix > > name. > > Sounds like a good idea to me. The patch is ok to push with these nits > fixed. I fixed the nits, fixed the two commands I previously forgot to update (maintenance print arc and memory-tag), and manually double checked all the calls to add_prefix and friends. This is now pushed (2f822da535ba9b159174d02d7114b4fc4f7c8818). > > gdb/ChangeLog: > > > > [...] > > * arm-tdep.c (_initialize_arm_tdep): Ditto. > > * auto-load.c: Ditto. > > * breakpoint.c: Ditto. > > * bsd-kvm.c: Ditto. > > * btrace.c: Ditto. > > * cli/cli-cmds.c: Ditto. > > * cli/cli-dump.c (_initialize_cli_dump): Ditto. > > [...] > > IMO it's not really useful to list all the spots that were just > trivially adjusted. It's ok to write things like: > > * command.h (add_prefix_cmd): Remove prefixname parameter. Update all > callers. > > ... and then skip listing all callers. That will also help preserve > your sanity. I thought I had to list everything but glad to know I don't! -- Marco Barisione