* breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
[deliverable/binutils-gdb.git] / gdb / i960-pinsn.c
index 65446afbd9861043e9a134b0c7dd538501a2bd7c..81fd8b27b8eb8ed71efa867022c71332be75301b 100644 (file)
@@ -99,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;
@@ -135,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.02346 seconds and 4 git commands to generate.