source: branches/libc-0.6/src/binutils/gprof/vax.c@ 3102

Last change on this file since 3102 was 610, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r609,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 9.3 KB
Line 
1/*
2 * Copyright (c) 1983, 1993, 2001
3 * The Regents of the University of California. All rights reserved.
4 *
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.
28 */
29#include "gprof.h"
30#include "search_list.h"
31#include "source.h"
32#include "symtab.h"
33#include "cg_arcs.h"
34#include "corefile.h"
35#include "hist.h"
36
37 /*
38 * opcode of the `calls' instruction
39 */
40#define CALLS 0xfb
41
42 /*
43 * register for pc relative addressing
44 */
45#define PC 0xf
46
47enum opermodes
48 {
49 literal, indexed, reg, regdef, autodec, autoinc, autoincdef,
50 bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef,
51 immediate, absolute, byterel, bytereldef, wordrel, wordreldef,
52 longrel, longreldef
53 };
54typedef enum opermodes operandenum;
55
56#if 0
57/* Here to document only. We can't use this when cross compiling as
58 the bitfield layout might not be the same as native. */
59struct modebyte
60 {
61 unsigned int regfield:4;
62 unsigned int modefield:4;
63 };
64#endif
65
66/*
67 * A symbol to be the child of indirect calls:
68 */
69static Sym indirectchild;
70
71static operandenum vax_operandmode PARAMS ((unsigned char *));
72static char *vax_operandname PARAMS ((operandenum));
73static long vax_operandlength PARAMS ((unsigned char *));
74static bfd_signed_vma vax_offset PARAMS ((unsigned char *));