summaryrefslogtreecommitdiff
path: root/opcodes/m32r-dis.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-08-12 20:16:29 +0000
committerRichard Henderson <rth@redhat.com>2001-08-12 20:16:29 +0000
commit3d17abda9f318cd8bba4735badc745acfccac411 (patch)
tree653736321de17e1a1f59b0f8e6157d77a2454bd9 /opcodes/m32r-dis.c
parent5705874961302aff1a880d688fbdc38981902e56 (diff)
downloadbinutils-redhat-3d17abda9f318cd8bba4735badc745acfccac411.tar.gz
* cgen-ibld.in (extract_normal): Match type of VALUE and MASK
to *VALUEP. Regenerate all cgen files.
Diffstat (limited to 'opcodes/m32r-dis.c')
-rw-r--r--opcodes/m32r-dis.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/opcodes/m32r-dis.c b/opcodes/m32r-dis.c
index 477a85b9da..687eb51c4c 100644
--- a/opcodes/m32r-dis.c
+++ b/opcodes/m32r-dis.c
@@ -434,12 +434,12 @@ print_insn (cd, pc, info, buf, buflen)
char *buf;
int buflen;
{
- unsigned long insn_value;
+ CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
CGEN_EXTRACT_INFO ex_info;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
- insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG);
+ insn_value = cgen_get_insn_value (cd, buf, buflen * 8);
/* Fill in ex_info fields like read_insn would. Don't actually call
read_insn, since the incoming buffer is already read (and possibly
@@ -505,7 +505,7 @@ print_insn (cd, pc, info, buf, buflen)
}
else
length = CGEN_EXTRACT_FN (cd, insn)
- (cd, insn, &ex_info, insn_value, &fields, pc);
+ (cd, insn, &ex_info, insn_value_cropped, &fields, pc);
/* length < 0 -> error */
if (length < 0)
@@ -539,18 +539,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.