| 1 | /*
|
|---|
| 2 | * Copyright (c) 1983, 2001 Regents of the University of California.
|
|---|
| 3 | * All rights reserved.
|
|---|
| 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.
|
|---|
| 18 | */
|
|---|
| 19 | #include "gprof.h"
|
|---|
| 20 | #include "cg_arcs.h"
|
|---|
| 21 | #include "corefile.h"
|
|---|
| 22 | #include "hist.h"
|
|---|
| 23 | #include "symtab.h"
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | int
|
|---|
| 27 | DEFUN (i386_iscall, (ip), unsigned char *ip)
|
|---|
| 28 | {
|
|---|
| 29 | if (*ip == 0xe8)
|
|---|
| 30 | return 1;
|
|---|
| 31 | return 0;
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | void
|
|---|
| 36 | i386_find_call (parent, p_lowpc, p_highpc)
|
|---|
| 37 | Sym *parent;
|
|---|
| 38 | bfd_vma p_lowpc;
|
|---|
| 39 | bfd_vma p_highpc;
|
|---|
| 40 | {
|
|---|
| 41 | unsigned char *instructp;
|
|---|
| 42 | Sym *child;
|
|---|
| 43 | bfd_vma destpc, delta;
|
|---|
| 44 |
|
|---|
| 45 | if (core_text_space == 0)
|
|---|
| 46 | {
|
|---|
| 47 | return;
|
|---|
| 48 | }
|
|---|
| 49 | if (p_lowpc < s_lowpc)
|
|---|
| 50 | {
|
|---|
| 51 | p_lowpc = s_lowpc;
|
|---|
| 52 | }
|
|---|
| 53 | if (p_highpc > s_highpc)
|
|---|
| 54 | {
|
|---|
| 55 | p_highpc = s_highpc;
|
|---|
| 56 | }
|
|---|
| 57 | DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
|
|---|
| 58 | parent->name, (unsigned long) p_lowpc,
|
|---|
| 59 | (unsigned long) p_highpc));
|
|---|
| 60 |
|
|---|
|
|---|