aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2001-05-07 17:55:21 +0000
committerFrank Ch. Eigler <fche@redhat.com>2001-05-07 17:55:21 +0000
commita00ad97d613fec56fab39a83da4205bffc9dc4cc (patch)
tree40e4412555df4f12563ca4f4056f7f7091a3d124 /opcodes
parente00bc6a7ba6342b27c657c0f59b27e06bd870346 (diff)
downloadgdb-a00ad97d613fec56fab39a83da4205bffc9dc4cc.zip
gdb-a00ad97d613fec56fab39a83da4205bffc9dc4cc.tar.gz
gdb-a00ad97d613fec56fab39a83da4205bffc9dc4cc.tar.bz2
* cgen asm/disasm
[opcodes/ChangeLog] 2001-05-07 Frank Ch. Eigler <fche@redhat.com> * cgen-dis.in (default_print_insn): Tolerate min<base instructions even at end of a section. * cgen-ibld.in (extract_normal): Tolerate min!=base!=max instructions by ignoring precariously-unpacked insn_value in favor of raw buffer. [cgen/ChangeLog] 2001-05-07 Frank Ch. Eigler <fche@redhat.com> * iformat.scm (compute-insn-base-mask-length): Rewrite to tolerate various-base-length instruction sets.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/cgen-dis.in15
-rw-r--r--opcodes/cgen-ibld.in4
3 files changed, 21 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index f4247e9..d390515 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-07 Frank Ch. Eigler <fche@redhat.com>
+
+ * cgen-dis.in (default_print_insn): Tolerate min<base instructions
+ even at end of a section.
+ * cgen-ibld.in (extract_normal): Tolerate min!=base!=max instructions
+ by ignoring precariously-unpacked insn_value in favor of raw buffer.
+
2001-05-03 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* disassemble.c (disassembler_usage): Remove unused attribute.
diff --git a/opcodes/cgen-dis.in b/opcodes/cgen-dis.in
index b2865f8..91fed7b 100644
--- a/opcodes/cgen-dis.in
+++ b/opcodes/cgen-dis.in
@@ -334,18 +334,27 @@ default_print_insn (cd, pc, info)
disassemble_info *info;
{
char buf[CGEN_MAX_INSN_SIZE];
+ int buflen;
int status;
- /* Read the base part of the insn. */
+ /* Attempt to read the base part of the insn. */
+ 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))
+ {
+ buflen = cd->min_insn_bitsize / 8;
+ status = (*info->read_memory_func) (pc, buf, buflen, info);
+ }
- status = (*info->read_memory_func) (pc, buf, cd->base_insn_bitsize / 8, info);
if (status != 0)
{
(*info->memory_error_func) (status, pc, info);
return -1;
}
- return print_insn (cd, pc, info, buf, cd->base_insn_bitsize / 8);
+ return print_insn (cd, pc, info, buf, buflen);
}
/* Main entry point.
diff --git a/opcodes/cgen-ibld.in b/opcodes/cgen-ibld.in
index 528e609..ca2f1e5 100644
--- a/opcodes/cgen-ibld.in
+++ b/opcodes/cgen-ibld.in
@@ -428,9 +428,9 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
word_length = total_length;
}
- /* Does the value reside in INSN_VALUE? */
+ /* Does the value reside in INSN_VALUE, and at the right alignment? */
- if (CGEN_INT_INSN_P || word_offset == 0)
+ if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length))
{
if (CGEN_INSN_LSB0_P)
value = insn_value >> ((word_offset + start + 1) - length);