/* service routines for sub process control */
* single step until loc with descriptor format d is modified
} while (oldval
== getval(loc
, d
));
/* single step count source stmts */
register int thisline
, curline
;
register struct proct
*thisproc
;
dot
= *(ADDR
*) (((ADDR
) &u
) + PC
);
thisproc
= adrtoprocp(dot
);
thisline
= adrtolineno(dot
);
if (count
== 0) count
= 1;
dot
= *(ADDR
*) (((ADDR
) &u
) + PC
);
curline
= adrtolineno(dot
);
((thisproc
== adrtoprocp(dot
) && thisline
== curline
) ||
int subargs
[NUMARGS
]; /* subargs[0] = address,
subargs[1] = number of arguments
subargs[2:NUMARGS] = actual arguments */
register int i
, numchars
, *subargp
;
ADDR straddr
, adr
, praddr
;
printf("Cannot find %s\n", proc
);
straddr
= extaddr("_dbargs");
error("Program not loaded with -lg");
for (i
=0; i
<NUMARGS
- 2; i
++) { /* process an argument */
*subargp
++ = straddr
+ sizeof subargs
+ numchars
;
substr
.c
[numchars
++] = ch
= *argsp
++;
substr
.c
[numchars
-1] = '\0';
error("Unterminated string constant");
if (numchars
> sizeof substr
.c
) {
error("Too many string constants");
} else if ((ch
>= '0' && ch
<= '9') || ch
== '-') {
*subargp
++ = readint(&argsp
);
} else if ((ch
>= 'a' && ch
<= 'z') || (ch
>= 'A' && ch
<= 'Z') ||
j
= varaddr(curproc()->pname
, var
);
printf("Unknown variable: %s\n", argsp
);
*subargp
++ = getval(j
, typetodesc(sl_type
, 0)[0]);
} while (varchar(*argsp
) || number(*argsp
));
printf("Unexpected character %c\n", ch
);
dot
= *(ADDR
*)(((ADDR
)&u
)+PC
) = extaddr("_dbsubc");
error("Internal error - cannot find _dbsubc");
if (pid
== 0 || signo
) subpcs('r');
subargs
[1] = (subargp
- subargs
) - 2;
for (j
=0; j
<=(subargp
-subargs
); j
++) {
put(adr
, DSP
, subargs
[j
]);
adr
= straddr
+ sizeof subargs
;
for (j
=0; j
<(numchars
+WORDSIZE
-1)/WORDSIZE
; j
++) {
put(adr
, DSP
, substr
.w
[j
]);
dot
= *(ADDR
*)(((ADDR
)&u
)+PC
);
if (dot
!= extaddr("_dbsubn")) {
if (!signo
) printf("Breakpoint\n");
dispf((ADDR
) 0, *argsp
? *argsp
: 'd', N_RSYM
, 0, 0);
printf("Procedure returned normally\n");
while (*argsp
== ' ' || *argsp
== ',')
error ("Too many arguments");