/* Copyright (c) 1982 Regents of the University of California */
static char sccsid
[] = "@(#)resume.c 1.2 %G%";
* resume execution, first setting appropriate registers
#include "runtime/frame.rep"
# include "machine/pxerrors.h"
* If we hit a breakpoint, px's pc points at a halt instruction,
* this must be avoided when restarting.
printf("execution resumes at pc 0x%x, lc %d\n", process
->pc
, pc
);
if (p
->status
== STOPPED
) {
dread(&pcframe
, PCADDRP
, sizeof(pcframe
));
pc
-= (sizeof(char) + ENDOFF
);
printf("execution stops at pc 0x%x, lc %d on sig %d\n",
process
->pc
, pc
, p
->signo
);
if (p
->status
== STOPPED
) {
} while (p
->signo
== SIGCONT
);
if (option('r') && oldsigno
!= 0) {
* Find the location in the Pascal object where execution was suspended.
unsigned int fr_psw
: 16; /* saved psw */
unsigned int fr_mask
: 12; /* register save mask */
unsigned int fr_unused
: 1;
unsigned int fr_s
: 1; /* call was a calls, not callg */
unsigned int fr_spa
: 2; /* stack pointer alignment */
unsigned int fr_savap
; /* saved arg pointer */
unsigned int fr_savfp
; /* saved frame pointer */
int fr_savpc
; /* saved program counter */
LOCAL ADDRESS
fetchpc(framep
)
if (p
->fp
== (ADDRESS
) framep
) {
savfp
= (ADDRESS
*) p
->fp
;
dread(&vframe
, savfp
, sizeof(vframe
));
while (vframe
.fr_savfp
!= (int) framep
&& vframe
.fr_savfp
!= 0) {
savfp
= (ADDRESS
*) vframe
.fr_savfp
;
dread(&vframe
, savfp
, sizeof(vframe
));
if (vframe
.fr_savfp
== 0) {
panic("resume: can't find interpreter frame 0x%x", framep
);
if (vframe
.fr_mask
== 0) {
dread(&r
, savfp
+ 5, sizeof(r
));
* Under the -r option, we offer the opportunity to just get
* the px traceback and not actually enter the debugger.
fprintf(stderr
, "\nProgram error");
fprintf(stderr
, " -- %s", pxerrmsg
[errnum
]);
fprintf(stderr
, "\nDo you wish to enter the debugger? ");
fprintf(stderr
, "\nEntering debugger, type 'help' for help\n");