/* Copyright (c) 1982 Regents of the University of California */
static char sccsid
[] = "@(#)entry.c 1.1 1/18/82";
* routines to deal with the entry addresses of blocks
#include "process/pxinfo.h"
#include "process/process.rep"
* Return the address of the beginning of the procedure/function
* associated with the given frame.
return(frp
->blockp
- 2 - ENDOFF
);
* Find the entry address of the caller of the current block.
* This is only called in connection with breakpoints.
* This routine assumes it is at the very beginning of the block.
if ((frp
= curframe()) == NIL
) {
panic("caller_addr(main program)");
return(codeloc(program
));
* Find the return address of the current procedure/function.
* There are two special cases:
* we're right at the beginning of the main program
* we're right at the beginning of some procedure or function
* The first one is handled by returning the last instruction in
* the object code. In the second case, we get the return address
* directly from the process' stack.
if (pc
== codeloc(program
)) {
dread(&frame
, (ADDRESS
) process
->sp
, sizeof(FRAME
));
addr
= frame
.save_pc
- ENDOFF
;
* Calculate the entry address for a procedure or function parameter,
* given the address of the descriptor.