diff options
author | Frank Ch. Eigler <fche@redhat.com> | 2001-05-07 17:55:21 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@redhat.com> | 2001-05-07 17:55:21 +0000 |
commit | 7e0f4c43ba78d0a40f0bd6ed9916f9400374937b (patch) | |
tree | 7c72a088538038ef5271d30f4cec923248275513 /opcodes/cgen-dis.in | |
parent | e4929a0d0a998d145d21ef7c4df40793338e52d7 (diff) | |
download | gdb-7e0f4c43ba78d0a40f0bd6ed9916f9400374937b.tar.gz |
* 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/cgen-dis.in')
-rw-r--r-- | opcodes/cgen-dis.in | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/opcodes/cgen-dis.in b/opcodes/cgen-dis.in index b2865f8cba4..91fed7b0a72 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. |