* Copyright (c) 1980 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)functab.c 5.3 (Berkeley) %G%";
* This file contains the implementation of a table for going
* from object addresses to the functions in which they belong.
#define MAXNFUNCS 1001 /* maximum number of functions allowed */
LOCAL SYM
*functab
[MAXNFUNCS
];
* Insert a new function into the table.
* The table is ordered by object address.
if (nfuncs
>= MAXNFUNCS
) {
panic("too many procedures/functions");
while (i
< nfuncs
&& codeloc(functab
[i
]) < a
) {
for (j
= nfuncs
; j
> i
; j
--) {
functab
[j
] = functab
[j
- 1];
* Return the function that begins at the given address.
if (addr
< codeloc(functab
[i
])) {
} else if (addr
== codeloc(functab
[i
])) {
} else if (addr
>= codeloc(functab
[j
])) {
if (addr
> codeloc(functab
[i
])) {
* Clear out the functab, used when re-reading the object information.