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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1DC7138582AE for ; Mon, 25 Jul 2022 18:28:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1DC7138582AE Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-407-SxeQVuVcNW2zDog5kw9mRw-1; Mon, 25 Jul 2022 14:28:21 -0400 X-MC-Unique: SxeQVuVcNW2zDog5kw9mRw-1 Received: by mail-wm1-f69.google.com with SMTP id bg6-20020a05600c3c8600b003a03d5d19e4so4387719wmb.1 for ; Mon, 25 Jul 2022 11:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=dGJkizuxz8nTr/505BYL7C3ItfMAkqikWoz69J2jyWg=; b=jsRCTaDbBZL8ezyhQmxey/I52Swc3SmRnXMTeY19q0d12OvRYSaXNvvFUksKfatTlR vp2FRWp8Vv3Lb/idLi1tZ2wPyxWxC6bX7pB+k5pWqnVmTPHj1aNRCVjE5R4F6YFHwAtK sUDfrxc6gZKAo+A0zoZxNmoMSJm8Plk6zyc1FBWW/+Su/xbAtAej/Xe9o0udA6vmYHBN gL0FQJEnrc0Ys/DxwIjDFrY9v0LQrl9UICHT6m7vjZscO1P5SWDgPrW01HjTHEUj9vzs 21NbxYrQAqbu8TV7yeF1RizqT7GeJxZSYT5ZQX7ofsFauzrMcPNAssRhzHjergMXZym4 uoAg== X-Gm-Message-State: AJIora+C6T8vub/5F0zKcE2MYgmJBfyAXsgVWrMth7AVH5Tv///WP5C3 P1ONT+0GmR6HEU0RJXSwaMXWd1/NKO8zRtVSPr4BRpRcM1RYM8jY51+LlWXNaiGVIR6dVwtdG8p B8r5uQlTgWspjzkROe1mydZzcZBKxL3FQPoWN0oXslatvFUQgt40m/67GZX0iUssLvvYY2n8WFw == X-Received: by 2002:a05:600c:1f14:b0:3a3:1adf:af39 with SMTP id bd20-20020a05600c1f1400b003a31adfaf39mr21237520wmb.28.1658773700227; Mon, 25 Jul 2022 11:28:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqLtrLIzXm1nmAU6IT6SUaJzB6DgOnSpvdma8j2I2zFx3i7YfnoUevNpxR0fGHrzYNwHYoKw== X-Received: by 2002:a05:600c:1f14:b0:3a3:1adf:af39 with SMTP id bd20-20020a05600c1f1400b003a31adfaf39mr21237507wmb.28.1658773699833; Mon, 25 Jul 2022 11:28:19 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id m126-20020a1ca384000000b003a03e63e428sm21322401wme.36.2022.07.25.11.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 11:28:19 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCH 0/9] Disassembler opcode display and text alignment In-Reply-To: References: Date: Mon, 25 Jul 2022 19:28:18 +0100 Message-ID: <87v8rl82t9.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 25 Jul 2022 18:28:25 -0000 Ping! Thanks, Andrew Andrew Burgess writes: > This series makes two related changes to GDB's disassembler. Both > changes flow naturally from having GDB make use of libopcodes > bytes_per_line and bytes_per_chunk presentation hints that are set on > a per-architecure basis with each call into the disassembler. > > The end result of this change is that GDB will now display instruction > opcodes in the same way that objdump does. > > For x86-64 there's no change in the way that opcode bytes are > presented. Now due to some special case, it's just that how GDB lays > out instruction opcodes just happens to match how libopcodes requests > that the opcodes be laid out. > > For other architectures, risc-v, powerpc, arm, aarch64, etc, this is > not the case, and I (personally) think objdump does a better job of > presenting the information that GDB does; the instruction opcodes will > be grouped together based on the instruction size, and potentially > byte-swapped so they appear in the instruction's natural order. > > Making use of the display hints also allows for better alignment of > the disassembly text when opcodes are being printed. > > I have proposed that this new behaviour become the default for > 'disassemble /r', and I've added a new flag 'disassemble /b' which > allows the user to access the old behaviour. > > But, if people feel strongly that the old 'disassemble /r' should not > be changed, I can place the new behaviour under a new flag. > > Let me know your thoughts, > > Thanks, > Andrew > > --- > > Andrew Burgess (9): > gdb/doc: improve description of --data-disassemble opcodes output > gdb/testsuite: new test for -data-disassemble opcodes format > gdb/disasm: read opcodes bytes with a single read_code call > gdb: disassembler opcode display formatting > gdb: make gdb_disassembly_flag unsigned > gdb/doc: fix column widths in MI compatibility table > gdb/doc: update syntax of -data-disassemble command arguments > gdb/mi: some int to bool conversion > gdb/mi: new options for -data-disassemble command > > gdb/NEWS | 12 ++ > gdb/cli/cli-cmds.c | 6 + > gdb/disasm-flags.h | 3 +- > gdb/disasm.c | 55 +++++++-- > gdb/disasm.h | 3 + > gdb/doc/gdb.texinfo | 137 ++++++++++++++++----- > gdb/mi/mi-cmd-disas.c | 105 ++++++++++++---- > gdb/record.c | 3 + > gdb/testsuite/gdb.mi/mi-disassemble.exp | 153 ++++++++++++++++++++---- > gdb/testsuite/lib/mi-support.exp | 27 +++++ > 10 files changed, 417 insertions(+), 87 deletions(-) > > -- > 2.25.4