Changeset 609 for branches/GNU/src/binutils/opcodes/pj-dis.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/opcodes/pj-dis.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* pj-dis.c -- Disassemble picoJava instructions. 2 Copyright 1999, 2000 Free Software Foundation, Inc.2 Copyright 1999, 2000, 2001 Free Software Foundation, Inc. 3 3 Contributed by Steve Chamberlain, of Transmeta (sac@pobox.com). 4 4 … … 17 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 18 18 19 20 19 #include <stdio.h> 21 20 #include "sysdep.h" … … 25 24 extern const pj_opc_info_t pj_opc_info[512]; 26 25 27 static int get_int (memaddr, iptr, info) 26 static int get_int PARAMS ((bfd_vma, int *, struct disassemble_info *)); 27 28 29 static int 30 get_int (memaddr, iptr, info) 28 31 bfd_vma memaddr; 29 32 int *iptr; … … 34 37 int status = info->read_memory_func (memaddr, ival, 4, info); 35 38 36 *iptr = (ival[0] << 24) 37 | (ival[1] << 16) 38 | (ival[2] << 8) 39 | (ival[3] << 0) 39 *iptr = (ival[0] << 24) 40 | (ival[1] << 16) 41 | (ival[2] << 8) 42 | (ival[3] << 0); 40 43 41 44 return status; … … 60 63 if ((status = info->read_memory_func (addr + 1, &byte_2, 1, info))) 61 64 goto fail; 62 fprintf_fn (stream, "%s\t", pj_opc_info[opcode + byte_2]. name);65 fprintf_fn (stream, "%s\t", pj_opc_info[opcode + byte_2].u.name); 63 66 return 2; 64 67 } … … 70 73 int a; 71 74 addr++; 72 fprintf_fn (stream, "%s", op-> name);75 fprintf_fn (stream, "%s", op->u.name); 73 76 74 77 /* The tableswitch instruction is followed by the default 75 address, low value, high value and the destinations. */78 address, low value, high value and the destinations. */ 76 79 77 if (strcmp (op-> name, "tableswitch") == 0)80 if (strcmp (op->u.name, "tableswitch") == 0) 78 81 { 79 82 int lowval; … … 85 88 goto fail; 86 89 87 fprintf_fn (stream, " default: ");90 fprintf_fn (stream, " default: "); 88 91 (*info->print_address_func) (val + insn_start, info); 89 92 addr += 4; … … 97 100 addr += 4; 98 101 99 while (lowval <= highval) { 100 if ((status = get_int (addr, &val, info))) 101 goto fail; 102 fprintf_fn (stream," %d:[", lowval); 103 (*info->print_address_func) (val + insn_start, info); 104 fprintf_fn (stream," ]"); 105 addr += 4; 106 lowval++; 107 } 102 while (lowval <= highval) 103 { 104 if ((status = get_int (addr, &val, info))) 105 goto fail; 106 fprintf_fn (stream, " %d:[", lowval); 107 (*info->print_address_func) (val + insn_start, info); 108 fprintf_fn (stream, " ]"); 109 addr += 4; 110 lowval++; 111 } 108 112 return addr - insn_start; 109 113 } … … 111 115 /* The lookupswitch instruction is followed by the default 112 116 address, element count and pairs of values and 113 addresses. */114 115 if (strcmp (op-> name, "lookupswitch") == 0)117 addresses. */ 118 119 if (strcmp (op->u.name, "lookupswitch") == 0) 116 120 { 117 121 int count; … … 123 127 addr += 4; 124 128 125 fprintf_fn (stream, " default: ");129 fprintf_fn (stream, " default: "); 126 130 (*info->print_address_func) (val + insn_start, info); 127 131 … … 130 134 addr += 4; 131 135 132 while (count--) { 133 if ((status = get_int (addr, &val, info))) 134 goto fail; 135 addr += 4; 136 fprintf_fn (stream," %d:[", val); 136 while (count--) 137 { 138 if ((status = get_int (addr, &val, info))) 139 goto fail; 140 addr += 4; 141 fprintf_fn (stream, " %d:[", val); 137 142 138 if ((status = get_int (addr, &val, info)))139 140 addr += 4;143 if ((status = get_int (addr, &val, info))) 144 goto fail; 145 addr += 4; 141 146 142 (*info->print_address_func) (val + insn_start, info);143 fprintf_fn (stream," ]");144 }147 (*info->print_address_func) (val + insn_start, info); 148 fprintf_fn (stream, " ]"); 149 } 145 150 return addr - insn_start; 146 151 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.