* xcoffread.c (scan_xcoff_symtab): Ignore symbols beginning with
[deliverable/binutils-gdb.git] / gprof / sparc.c
index b78ef43a7e8ce5cc637c89f56af6243ce45559b9..0365827639347390c24eea5c762fa1bedf307b5e 100644 (file)
  */
 #include "gprof.h"
 #include "cg_arcs.h"
-#include "core.h"
+#include "corefile.h"
 #include "hist.h"
 #include "symtab.h"
 
+    /*
+     *        opcode of the `callf' instruction
+     */
+#define        CALL    (0xc0000000)
 
 void
-find_call (parent, p_lowpc, p_highpc)
+sparc_find_call (parent, p_lowpc, p_highpc)
      Sym *parent;
      bfd_vma p_lowpc;
      bfd_vma p_highpc;
@@ -38,25 +42,27 @@ find_call (parent, p_lowpc, p_highpc)
   if (core_text_space == 0)
     {
       return;
-    }                          /* if */
+    }
   if (p_lowpc < s_lowpc)
     {
       p_lowpc = s_lowpc;
-    }                          /* if */
+    }
   if (p_highpc > s_highpc)
     {
       p_highpc = s_highpc;
-    }                          /* if */
+    }
   DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
-                         parent->name, p_lowpc, p_highpc));
-  for (instr = (unsigned int *) (p_lowpc + delta);
+                         parent->name, (unsigned long) p_lowpc,
+                         (unsigned long) p_highpc));
+  for (instr = (unsigned int *) (((p_lowpc + delta) + 3) &~ 3);
        instr < (unsigned int *) (p_highpc + delta);
        ++instr)
     {
       if ((*instr & CALL))
        {
          DBG (CALLDEBUG,
-              printf ("[find_call] 0x%lx: callf", (bfd_vma) instr - delta));
+              printf ("[find_call] 0x%lx: callf",
+                      (unsigned long) instr - delta));
          /*
           * Regular pc relative addressing check that this is the
           * address of a function.
@@ -67,19 +73,19 @@ find_call (parent, p_lowpc, p_highpc)
              child = sym_lookup (&symtab, dest_pc);
              DBG (CALLDEBUG,
                   printf ("\tdest_pc=0x%lx, (name=%s, addr=0x%lx)\n",
-                          dest_pc, child->name, child->addr));
+                          (unsigned long) dest_pc, child->name,
+                          (unsigned long) child->addr));
              if (child->addr == dest_pc)
                {
                  /* a hit:  */
-                 arc_add (parent, child, 0);
+                 arc_add (parent, child, (unsigned long) 0);
                  continue;
-               }               /* if */
-           }                   /* if */
+               }
+           }
          /*
           * Something funny going on.
           */
          DBG (CALLDEBUG, printf ("\tbut it's a botch\n"));
-       }                       /* if */
-    }                          /* for */
-}                              /* find_call */
-/*** end of sparc.c ***/
+       }
+    }
+}
This page took 0.024051 seconds and 4 git commands to generate.