XCOFF booke tests. Fix tlbre, tlbwe ppc WS field.
[deliverable/binutils-gdb.git] / opcodes / cris-dis.c
index 169b4c2bf409a1502201103b84bdaa34f82ef8eb..33806ee88acb8f28cb93851bc096bf3d9744654c 100644 (file)
@@ -1,5 +1,5 @@
 /* Disassembler code for CRIS.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright 2000, 2001 Free Software Foundation, Inc.
    Contributed by Axis Communications AB, Lund, Sweden.
    Written by Hans-Peter Nilsson.
 
@@ -7,7 +7,7 @@ This file is part of the GNU binutils and GDB, the GNU debugger.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
+Software Foundation; either version 2, or (at your option)
 any later version.
 
 This program is distributed in the hope that it will be useful, but WITHOUT
@@ -97,6 +97,8 @@ static int print_insn_cris_with_register_prefix
   PARAMS ((bfd_vma, disassemble_info *));
 static int print_insn_cris_without_register_prefix
   PARAMS ((bfd_vma, disassemble_info *));
+static const struct cris_opcode *get_opcode_entry
+  PARAMS ((unsigned int, unsigned int));
 
 /* Return the descriptor of a special register.
    FIXME: Depend on a CPU-version specific argument when all machinery
@@ -124,7 +126,7 @@ number_of_bits (val)
 {
   int bits;
 
-  for (bits = 0; val != 0; val &= val-1)
+  for (bits = 0; val != 0; val &= val - 1)
     bits++;
 
   return bits;
@@ -372,7 +374,7 @@ cris_constraint (cs, insn, prefix_insn)
   int prefix_ok = 0;
 
   const char *s;
-  for (s  = cs; *s; s++)
+  for (s = cs; *s; s++)
     switch (*s)
       {
       case '!':
@@ -1195,7 +1197,7 @@ print_insn_cris_generic (memaddr, info, with_reg_prefix)
      bytes; stacked prefixes will not be expanded.  */
   unsigned char buffer[MAX_BYTES_PER_CRIS_INSN];
   unsigned char *bufp;
-  int status;
+  int status = 0;
   bfd_vma addr;
 
   /* There will be an "out of range" error after the last instruction.
@@ -1387,7 +1389,10 @@ disassembler_ftype
 cris_get_disassembler (abfd)
      bfd *abfd;
 {
-  if (bfd_get_symbol_leading_char (abfd) == 0)
+  /* If there's no bfd in sight, we return what is valid as input in all
+     contexts if fed back to the assembler: disassembly *with* register
+     prefix.  */
+  if (abfd == NULL || bfd_get_symbol_leading_char (abfd) == 0)
     return print_insn_cris_with_register_prefix;
 
   return print_insn_cris_without_register_prefix;
This page took 0.025369 seconds and 4 git commands to generate.