From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id ED38738376D5; Mon, 25 Jul 2022 13:14:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED38738376D5 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: bfd-cvs@sourceware.org Subject: [binutils-gdb] opcodes: add new sub-mnemonic disassembler style X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 2cb10f02b0e0d0d062c97c19defef1e5e334b13b X-Git-Newrev: 4f46c0bc36471b725de0253bfec1a42a36e2c5c5 Message-Id: <20220725131402.ED38738376D5@sourceware.org> Date: Mon, 25 Jul 2022 13:14:02 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 13:14:03 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4f46c0bc3647= 1b725de0253bfec1a42a36e2c5c5 commit 4f46c0bc36471b725de0253bfec1a42a36e2c5c5 Author: Andrew Burgess Date: Mon Jul 4 17:45:25 2022 +0100 opcodes: add new sub-mnemonic disassembler style =20 When adding libopcodes disassembler styling support for AArch64, it feels like the results would be improved by having a new sub-mnemonic style. This will be used in cases like: =20 add w16, w7, w1, uxtb #2 ^^^^----- Here =20 And: =20 cinc w0, w1, ne ^^----- Here =20 This commit just adds the new style, and prepares objdump to handle the style. A later commit will add AArch64 styling, and will actually make use of the style. =20 As this style is currently unused, there should be no user visible changes after this commit. Diff: --- binutils/objdump.c | 2 ++ include/dis-asm.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/binutils/objdump.c b/binutils/objdump.c index 67824053527..4076587151c 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -2167,6 +2167,7 @@ objdump_color_for_disassembler_style (enum disassembl= er_style style) { case dis_style_symbol: color =3D 32; break; case dis_style_assembler_directive: + case dis_style_sub_mnemonic: case dis_style_mnemonic: color =3D 33; break; case dis_style_register: color =3D 34; break; case dis_style_address: @@ -2185,6 +2186,7 @@ objdump_color_for_disassembler_style (enum disassembl= er_style style) { case dis_style_symbol: color =3D 40; break; case dis_style_assembler_directive: + case dis_style_sub_mnemonic: case dis_style_mnemonic: color =3D 142; break; case dis_style_register: color =3D 27; break; case dis_style_address: diff --git a/include/dis-asm.h b/include/dis-asm.h index 4f91df12498..f1a83dc84e5 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -62,6 +62,13 @@ enum disassembler_style instructions. */ dis_style_mnemonic, =20 + /* Some architectures include additional mnemonic like fields within the + instruction operands, e.g. on aarch64 'add w16, w7, w1, lsl #2' where + the 'lsl' is an additional piece of text that describes how the + instruction should behave. This sub-mnemonic style can be used for + these pieces of text. */ + dis_style_sub_mnemonic, + /* For things that aren't real machine instructions, but rather assembler directives, e.g. .byte, etc. */ dis_style_assembler_directive,