* cgen asm/disasm
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 7 May 2001 17:55:21 +0000 (17:55 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 7 May 2001 17:55:21 +0000 (17:55 +0000)
[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.

opcodes/ChangeLog
opcodes/cgen-dis.in
opcodes/cgen-ibld.in

index f4247e96c66f758bf3d66197761bb515542cdc65..d39051533a03ac2d866c8d63058c75fa725194f9 100644 (file)
@@ -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.
index b2865f8cba43a9fbcb51ba0ad1f2c9fd6be3980a..91fed7b0a72d746aea5234b532cbfc873cfccb00 100644 (file)
@@ -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.
index 528e60979cb2d3b28e6572f51117c1a78a877dd1..ca2f1e5fcc19d8d461b2361795f03a90ba9b35e7 100644 (file)
@@ -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);
This page took 0.042924 seconds and 4 git commands to generate.