* display(i,f) - display local variables of i most recent
* procedure activations, plus global variables.
* Output to file f (default &errout).
Xdisplay(nargs
, arg2
, arg1
, arg0
)
struct descrip arg2
, arg1
, arg0
;
register int *ap
, *r5
; /* Note that position is important, we assume
that ap is in r11, and r5 is in r10 */
register struct descrip
*dp
;
register struct descrip
*np
;
extern struct descrip
*globals
, *eglobals
;
extern struct descrip
*gnames
;
extern struct descrip
*statics
;
extern struct descrip globals
[], eglobals
[];
extern struct descrip gnames
[];
extern struct descrip statics
[];
defint(&arg1
, &l
, k_level
);
f
= BLKLOC(arg2
)->file
.fd
;
if ((BLKLOC(arg2
)->file
.status
& FS_WRITE
) == 0)
r5
= boundary
; /* start r5 at most recent procedure frame */
n
= ap
[1]; /* get number of arguments */
dp
= ap
+ 2 + 2*n
; /* calculate address of procedure descriptor*/
bp
= BLKLOC(*dp
); /* get address of procedure block */
/* print procedure name */
putstr(f
, STRLOC(bp
->pname
), STRLEN(bp
->pname
));
fprintf(f
, " local identifiers:\n");
for (n
= bp
->nparam
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
/* print local dynamics */
for (n
= bp
->ndynam
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
/* print local statics */
dp
= &statics
[bp
->fstatic
];
for (n
= bp
->nstatic
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
fprintf(f
, "global identifiers:\n");
putstr(f
, STRLOC(*np
), STRLEN(*np
));
arg0
= nulldesc
; /* return &null */
struct b_iproc Bdisplay
= {
* display(i,f) - display local variables of i most recent
* procedure activations, plus global variables.
* Output to file f (default &errout).
Xdisplay(nargs
, arg2
, arg1
, arg0
)
struct descrip arg2
, arg1
, arg0
;
register struct descrip
*dp
;
register struct descrip
*np
;
static struct descrip errout
= {D_FILE
, &k_errout
};
extern struct descrip
*globals
, *eglobals
;
extern struct descrip
*gnames
;
extern struct descrip
*statics
;
extern struct descrip globals
[], eglobals
[];
extern struct descrip gnames
[];
extern struct descrip statics
[];
defint(&arg1
, &l
, k_level
);
f
= BLKLOC(arg2
)->file
.fd
;
if ((BLKLOC(arg2
)->file
.status
& FS_WRITE
) == 0)
r5
= *boundary
; /* start r5 at most recent procedure frame */
n
= r5
[2]; /* get number of arguments */
dp
= r5
+ 3 + 2*n
; /* calculate address of procedure descriptor */
bp
= BLKLOC(*dp
); /* get address of procedure block */
/* print procedure name */
putstr(f
, STRLOC(bp
->pname
), STRLEN(bp
->pname
));
fprintf(f
, " local identifiers:\n");
for (n
= bp
->nparam
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
/* print local dynamics */
for (n
= bp
->ndynam
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
/* print local statics */
dp
= &statics
[bp
->fstatic
];
for (n
= bp
->nstatic
; n
> 0; n
--) {
putstr(f
, STRLOC(*np
), STRLEN(*np
));
fprintf(f
, "global identifiers:\n");
putstr(f
, STRLOC(*np
), STRLEN(*np
));
arg0
= nulldesc
; /* return &null */
struct b_iproc Bdisplay
= {