diff options
author | Lulu Cai <cailulu@loongson.cn> | 2024-01-03 19:57:10 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2024-01-11 14:08:24 +0800 |
commit | 21455a847de4301fd6afaffaa2e168b0f58242d9 (patch) | |
tree | 67843a29f41d0f1979a71948191c9186ea1edab1 /opcodes | |
parent | 20617191e4813ac5dec0ca46931253f46b1719a3 (diff) | |
download | fsf-binutils-gdb-21455a847de4301fd6afaffaa2e168b0f58242d9.zip fsf-binutils-gdb-21455a847de4301fd6afaffaa2e168b0f58242d9.tar.gz fsf-binutils-gdb-21455a847de4301fd6afaffaa2e168b0f58242d9.tar.bz2 |
LoongArch: Discard extra spaces in objdump output
Due to the formatted output of objdump, some instructions
that do not require output operands (such as nop/ret) will
have extra spaces added after them.
Determine whether to output operands through the format
of opcodes. When opc->format is an empty string, no extra
spaces are output.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/loongarch-dis.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 66a5596..c0f0642 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -267,7 +267,12 @@ disassemble_one (insn_t insn, struct disassemble_info *info) } info->insn_type = dis_nonbranch; - info->fprintf_styled_func (info->stream, dis_style_mnemonic, "%-12s", opc->name); + if (opc->format == NULL || opc->format[0] == '\0') + info->fprintf_styled_func (info->stream, dis_style_mnemonic, + "%s", opc->name); + else + info->fprintf_styled_func (info->stream, dis_style_mnemonic, + "%-12s", opc->name); { char *fake_args = xmalloc (strlen (opc->format) + 1); |