This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 1/4] epiphany/disassembler: Improve alignment of output.
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: binutils at sourceware dot org
- Cc: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Mon, 1 Feb 2016 20:31:37 +0000
- Subject: [PATCH 1/4] epiphany/disassembler: Improve alignment of output.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1454358506 dot git dot andrew dot burgess at embecosm dot com>
- References: <cover dot 1454358506 dot git dot andrew dot burgess at embecosm dot com>
Always set the bytes_per_line field (of struct disassemble_info) to the
same constant value, this is inline with the advice contained within
include/dis-asm.h.
Setting this field to a constant value will cause the disassembler
output to be better aligned.
cpu/ChangeLog:
* epiphany.opc (epiphany_print_insn): Set info->bytes_per_line to
a constant to better align disassembler output.
opcodes/ChangeLog:
* epiphany-dis.c: Regenerated from latest cpu files.
gas/ChangeLog:
* testsuite/gas/epiphany/sample.d: Update expected output.
---
cpu/ChangeLog | 5 +++++
cpu/epiphany.opc | 5 +++--
gas/ChangeLog | 4 ++++
gas/testsuite/gas/epiphany/sample.d | 2 +-
opcodes/ChangeLog | 4 ++++
opcodes/epiphany-dis.c | 5 +++--
6 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index 3e01aea..cbfdb14 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * epiphany.opc (epiphany_print_insn): Set info->bytes_per_line to
+ a constant to better align disassembler output.
+
2014-07-20 Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
* or1korbis.cpu (l-msync, l-psync, l-csync): New instructions.
diff --git a/cpu/epiphany.opc b/cpu/epiphany.opc
index fefb396..903eccf 100644
--- a/cpu/epiphany.opc
+++ b/cpu/epiphany.opc
@@ -349,15 +349,16 @@ epiphany_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
int status;
info->bytes_per_chunk = 2;
+ info->bytes_per_line = 4;
/* Attempt to read the base part of the insn. */
- info->bytes_per_line = buflen = cd->base_insn_bitsize / 8;
+ buflen = cd->base_insn_bitsize / 8;
status = (*info->read_memory_func) (pc, buf, buflen, info);
/* Try again with the minimum part, if min < base. */
if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize))
{
- info->bytes_per_line = buflen = cd->min_insn_bitsize / 8;
+ buflen = cd->min_insn_bitsize / 8;
status = (*info->read_memory_func) (pc, buf, buflen, info);
}
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d219d42..dd38fa0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * testsuite/gas/epiphany/sample.d: Update expected output.
+
2016-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (md_apply_fix): Allow addendum.
diff --git a/gas/testsuite/gas/epiphany/sample.d b/gas/testsuite/gas/epiphany/sample.d
index 17b5163..d360363 100644
--- a/gas/testsuite/gas/epiphany/sample.d
+++ b/gas/testsuite/gas/epiphany/sample.d
@@ -218,4 +218,4 @@ Disassembly of section \.text:
0000019e \<trap\>:
19e: 03e2 trap 0x0
- 1a0: 01d2 rti
+ 1a0: 01d2 rti
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 505b5e7..10ad0cf 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * epiphany-dis.c: Regenerated from latest cpu files.
+
2016-02-01 Michael McConville <mmcco@mykolab.com>
* cgen-dis.c (count_decodable_bits): Use unsigned value for mask
diff --git a/opcodes/epiphany-dis.c b/opcodes/epiphany-dis.c
index 1c424df..2838b06 100644
--- a/opcodes/epiphany-dis.c
+++ b/opcodes/epiphany-dis.c
@@ -69,15 +69,16 @@ epiphany_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
int status;
info->bytes_per_chunk = 2;
+ info->bytes_per_line = 4;
/* Attempt to read the base part of the insn. */
- info->bytes_per_line = buflen = cd->base_insn_bitsize / 8;
+ buflen = cd->base_insn_bitsize / 8;
status = (*info->read_memory_func) (pc, buf, buflen, info);
/* Try again with the minimum part, if min < base. */
if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize))
{
- info->bytes_per_line = buflen = cd->min_insn_bitsize / 8;
+ buflen = cd->min_insn_bitsize / 8;
status = (*info->read_memory_func) (pc, buf, buflen, info);
}
--
2.6.4