aboutsummaryrefslogtreecommitdiff
path: root/opcodes/cgen-dis.in
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2001-01-03 15:10:26 +0000
committerFrank Ch. Eigler <fche@redhat.com>2001-01-03 15:10:26 +0000
commit7e30bc3635d961336a9db1c88d4e18bea5012038 (patch)
treefd954dcefe616f753174206d35f43d411e7804e6 /opcodes/cgen-dis.in
parentb96ed59a5719c80faca6dcfd1ec1d98cf6f8ca09 (diff)
downloadgdb-7e30bc3635d961336a9db1c88d4e18bea5012038.zip
gdb-7e30bc3635d961336a9db1c88d4e18bea5012038.tar.gz
gdb-7e30bc3635d961336a9db1c88d4e18bea5012038.tar.bz2
* generalization
2001-01-03 Richard Sandiford <r.sandiford@redhat.com> cgen-dis.in (read_insn): Use bfd_get_bits()
Diffstat (limited to 'opcodes/cgen-dis.in')
-rw-r--r--opcodes/cgen-dis.in16
1 files changed, 1 insertions, 15 deletions
diff --git a/opcodes/cgen-dis.in b/opcodes/cgen-dis.in
index 22cef1f..9d25c1a 100644
--- a/opcodes/cgen-dis.in
+++ b/opcodes/cgen-dis.in
@@ -211,21 +211,7 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
ex_info->valid = (1 << buflen) - 1;
ex_info->insn_bytes = buf;
- switch (buflen)
- {
- case 1:
- *insn_value = buf[0];
- break;
- case 2:
- *insn_value = info->endian == BFD_ENDIAN_BIG ? bfd_getb16 (buf) : bfd_getl16 (buf);
- break;
- case 4:
- *insn_value = info->endian == BFD_ENDIAN_BIG ? bfd_getb32 (buf) : bfd_getl32 (buf);
- break;
- default:
- abort ();
- }
-
+ *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG);
return 0;
}