use remote-utils facilities for baud_rate
[deliverable/binutils-gdb.git] / gdb / i960-pinsn.c
index 68ea9f0bad92a54b8dd60e480388cc40792bd405..81fd8b27b8eb8ed71efa867022c71332be75301b 100644 (file)
@@ -38,6 +38,12 @@ print_insn (memaddr, stream)
 /****************************************/
 /* MEM format                          */
 /****************************************/
+
+struct tabent {
+       char    *name;
+       char    numops;
+};
+
 static int                             /* returns instruction length: 4 or 8 */
 mem( memaddr, word1, word2, noprint )
     unsigned long memaddr;
@@ -93,7 +99,7 @@ mem( memaddr, word1, word2, noprint )
 
        if ( mem_tab == NULL ){
                mem_tab = (struct tabent *) xmalloc( MEM_SIZ );
-               bzero( mem_tab, MEM_SIZ );
+               memset( mem_tab, '\0', MEM_SIZ );
                for ( i = 0; mem_init[i].opcode != 0; i++ ){
                        j = mem_init[i].opcode - MEM_MIN;
                        mem_tab[j].name = mem_init[i].name;
@@ -129,17 +135,16 @@ next_insn (memaddr, pword1, pword2)
      CORE_ADDR memaddr;
 {
   int len;
-  unsigned long buf[2];
+  char buf[8];
 
   /* Read the two (potential) words of the instruction at once,
      to eliminate the overhead of two calls to read_memory ().
-     TODO: read more instructions at once and cache them.  */
+     FIXME: Loses if the first one is readable but the second is not
+     (e.g. last word of the segment).  */
 
-  read_memory (memaddr, buf, sizeof (buf));
-  *pword1 = buf[0];
-  SWAP_TARGET_AND_HOST (pword1, sizeof (long));
-  *pword2 = buf[1];
-  SWAP_TARGET_AND_HOST (pword2, sizeof (long));
+  read_memory (memaddr, buf, 8);
+  *pword1 = extract_unsigned_integer (buf, 4);
+  *pword2 = extract_unsigned_integer (buf + 4, 4);
 
   /* Divide instruction set into classes based on high 4 bits of opcode*/
 
This page took 0.023657 seconds and 4 git commands to generate.