1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1990-08-31 18:22:53 +00:00
|
|
|
|
1990-10-29 11:38:35 +00:00
|
|
|
/* scope structure */
|
|
|
|
|
1990-08-31 18:22:53 +00:00
|
|
|
typedef struct scope {
|
|
|
|
struct scope *sc_static_encl; /* linked list of enclosing scopes */
|
|
|
|
struct symbol *sc_symbs; /* symbols defined in this scope */
|
|
|
|
struct symbol *sc_definedby; /* symbol defining this scope */
|
|
|
|
long sc_start; /* start address of code of this scope */
|
|
|
|
long sc_bp_opp; /* first breakpoint opportunity */
|
1993-06-09 14:18:43 +00:00
|
|
|
int sc_bp_lineno; /* linenumber belonging to this bp. */
|
1990-08-31 18:22:53 +00:00
|
|
|
short sc_proclevel; /* proc level of this scope */
|
|
|
|
char sc_has_activation_record;
|
|
|
|
} t_scope, *p_scope;
|
|
|
|
|
|
|
|
extern p_scope PervasiveScope, CurrentScope, FileScope;
|
|
|
|
|
|
|
|
/* extern init_scope();
|
|
|
|
Initializes the scope routines.
|
|
|
|
*/
|
|
|
|
extern init_scope();
|
|
|
|
|
|
|
|
/* extern open_scope(struct symbol *name, int has_activation);
|
|
|
|
Opens a new scope and assigns it to CurrentScope; The new scope is defined
|
|
|
|
by 'name' and if 'has_activation' is set, it has an activation record.
|
|
|
|
*/
|
|
|
|
extern open_scope();
|
|
|
|
|
|
|
|
/* extern close_scope();
|
|
|
|
Closes the current scope; CurrentScope becomes the statically enclosing
|
|
|
|
scope.
|
|
|
|
*/
|
|
|
|
extern close_scope();
|
|
|
|
|
|
|
|
/* extern add_scope_addr(p_scope sc);
|
|
|
|
Adds scope 'sc' to the list of scopes that have an address at runtime.
|
|
|
|
*/
|
|
|
|
extern add_scope_addr();
|
|
|
|
|
|
|
|
/* extern p_scope get_scope_from_addr(t_addr a);
|
|
|
|
Returns the scope of the code at address 'a', or 0 if it could not be found.
|
|
|
|
*/
|
|
|
|
extern p_scope get_scope_from_addr();
|
|
|
|
|
|
|
|
/* extern p_scope get_next_scope_from_addr(t_addr a);
|
|
|
|
Returns the scope following the one of the code at address 'a',
|
|
|
|
and that has an activation record,
|
|
|
|
or 0 if it could not be found.
|
|
|
|
*/
|
|
|
|
extern p_scope get_next_scope_from_addr();
|
|
|
|
|
|
|
|
/* extern p_scope base_scope(p_scope sc);
|
|
|
|
Returns the closest enclosing scope of 'sc' that has an activation record.
|
|
|
|
*/
|
|
|
|
extern p_scope base_scope();
|
1990-10-17 17:00:03 +00:00
|
|
|
|
|
|
|
/* extern int scope_encloses(p_scope scope, from_scope);
|
|
|
|
Returns 1 if scope encloses from from_scope, 0 otherwise.
|
|
|
|
*/
|
|
|
|
extern int scope_encloses();
|