From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 252F1385702F for ; Mon, 10 Aug 2020 14:25:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 252F1385702F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-oOL1-HX0MZW1lmzCm6SS_Q-1; Mon, 10 Aug 2020 10:25:21 -0400 X-MC-Unique: oOL1-HX0MZW1lmzCm6SS_Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48D4959; Mon, 10 Aug 2020 14:25:18 +0000 (UTC) Received: from blade.nx (ovpn-112-170.ams2.redhat.com [10.36.112.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BBCD5C662; Mon, 10 Aug 2020 14:25:18 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id 3F1D8816CCA9; Mon, 10 Aug 2020 15:25:17 +0100 (BST) Date: Mon, 10 Aug 2020 15:25:17 +0100 From: Gary Benson To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Style more output of "disassemble" command Message-ID: <20200810142517.GG12133@blade.nx> References: <20200804215507.23152-1-tom@tromey.com> MIME-Version: 1.0 In-Reply-To: <20200804215507.23152-1-tom@tromey.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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-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: Mon, 10 Aug 2020 14:25:26 -0000 Tom Tromey wrote: > I noticed a couple of spots where the "disassemble" could style its > output, but currently does not. This patch adds styling to the > function name at the start of the disassembly, and any addresses > printed there. ... > diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c > index e3965fea076..b70da4a0145 100644 > --- a/gdb/cli/cli-cmds.c > +++ b/gdb/cli/cli-cmds.c > @@ -1397,12 +1397,16 @@ print_disassembly (struct gdbarch *gdbarch, const char *name, > { > printf_filtered ("Dump of assembler code "); > if (name != NULL) > - printf_filtered ("for function %s:\n", name); > + printf_filtered ("for function %ps:\n", > + styled_string (function_name_style.style (), name)); > if (block == nullptr || BLOCK_CONTIGUOUS_P (block)) > { > if (name == NULL) > - printf_filtered ("from %s to %s:\n", > - paddress (gdbarch, low), paddress (gdbarch, high)); > + printf_filtered ("from %ps to %ps:\n", > + styled_string (address_style.style (), > + paddress (gdbarch, low)), > + styled_string (address_style.style (), > + paddress (gdbarch, high))); > > /* Dump the specified range. */ > gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high); > @@ -1413,9 +1417,11 @@ print_disassembly (struct gdbarch *gdbarch, const char *name, > { > CORE_ADDR range_low = BLOCK_RANGE_START (block, i); > CORE_ADDR range_high = BLOCK_RANGE_END (block, i); > - printf_filtered (_("Address range %s to %s:\n"), > - paddress (gdbarch, range_low), > - paddress (gdbarch, range_high)); > + printf_filtered (_("Address range %ps to %ps:\n"), > + styled_string (address_style.style (), > + paddress (gdbarch, range_low)), > + styled_string (address_style.style (), > + paddress (gdbarch, range_high))); > gdb_disassembly (gdbarch, current_uiout, flags, -1, > range_low, range_high); > } Your patch looks good, but, as a consistency thing, does GDB have a position w.r.t. gettext macros? Both these hunks are in the same function, but only the second hunk's printf_filtered calls have _(). Thanks, Gary -- Gary Benson - he / him / his Principal Software Engineer, Red Hat