Changeset 609 for branches/GNU/src/binutils/gprof/sparc.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/gprof/sparc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 2 * Copyright (c) 1983 Regents of the University of California.3 * All rights reserved.2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that: (1) source distributions retain this entire copyright 7 * notice and comment, and (2) distributions including binaries display 8 * the following acknowledgement: ``This product includes software 9 * developed by the University of California, Berkeley and its contributors'' 10 * in the documentation or other materials provided with the distribution 11 * and in all advertising materials mentioning features or use of this 12 * software. Neither the name of the University nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the University nor the names of its contributors 14 * may be used to endorse or promote products derived from this software 15 * without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 18 28 */ 19 29 #include "gprof.h" 30 #include "search_list.h" 31 #include "source.h" 32 #include "symtab.h" 20 33 #include "cg_arcs.h" 21 34 #include "corefile.h" 22 35 #include "hist.h" 23 #include "symtab.h"24 36 25 37 /* … … 27 39 */ 28 40 #define CALL (0xc0000000) 41 42 void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); 29 43 30 44 void … … 34 48 bfd_vma p_highpc; 35 49 { 36 bfd_vma dest_pc, delta;37 unsigned int *instr;50 bfd_vma pc, dest_pc; 51 unsigned int insn; 38 52 Sym *child; 39 40 delta = (bfd_vma) core_text_space - core_text_sect->vma;41 53 42 54 if (core_text_space == 0) … … 55 67 parent->name, (unsigned long) p_lowpc, 56 68 (unsigned long) p_highpc)); 57 for (instr = (unsigned int *) (((p_lowpc + delta) + 3) &~ 3); 58 instr < (unsigned int *) (p_highpc + delta); 59 ++instr) 69 for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4) 60 70 { 61 if ((*instr & CALL)) 71 insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space 72 + pc - core_text_sect->vma)); 73 if (insn & CALL) 62 74 { 63 75 DBG (CALLDEBUG, 64 printf ("[find_call] 0x%lx: callf", 65 (unsigned long) instr - delta)); 76 printf ("[find_call] 0x%lx: callf", (unsigned long) pc)); 66 77 /* 67 78 * Regular pc relative addressing check that this is the 68 79 * address of a function. 69 80 */ 70 dest_pc = ((bfd_vma) (instr + (*instr & ~CALL))) - delta; 81 dest_pc = pc + (((bfd_signed_vma) (insn & 0x3fffffff) 82 ^ 0x20000000) - 0x20000000); 71 83 if (dest_pc >= s_lowpc && dest_pc <= s_highpc) 72 84 { -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.