aboutsummaryrefslogtreecommitdiff
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
commitfc7bc88384beca1d62919c19120cc0e70c0d1e4e (patch)
tree2b4a692ea199f3df001384947d93ed529700d5c7 /opcodes/m32r-dis.c
parentExtend unaligned test to check .uaword with mulitple arguments (diff)
downloadbinutils-gdb-fc7bc88384beca1d62919c19120cc0e70c0d1e4e.tar.gz
binutils-gdb-fc7bc88384beca1d62919c19120cc0e70c0d1e4e.tar.bz2
binutils-gdb-fc7bc88384beca1d62919c19120cc0e70c0d1e4e.zip
* 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 477a85b9dae..687eb51c4cd 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.