Beispiel #1
0
void debugsub_status(void) {

static int		filenum = 0;
	TEXTFILEH	tfh;
	OEMCHAR		work[512];
const OEMCHAR	*p;

	OEMSPRINTF(work, file_i286reg, filenum);
	tfh = textfile_create(file_getcd(work), 0);
	if (tfh != NULL) {
		p = debugsub_regs();
		textfile_write(tfh, p);
		OEMSPRINTF(work, str_picstat,
								pic.pi[0].imr, pic.pi[0].irr, pic.pi[0].isr,
								pic.pi[1].imr, pic.pi[1].irr, pic.pi[1].isr,
								mouseif.upd8255.portc, sysport.c);
		textfile_write(tfh, work);
		textfile_close(tfh);
	}

	OEMSPRINTF(work, file_i286cs, filenum);
	writeseg(work, CS_BASE, 0xffff);
	OEMSPRINTF(work, file_i286ds, filenum);
	writeseg(work, DS_BASE, 0xffff);
	OEMSPRINTF(work, file_i286es, filenum);
	writeseg(work, ES_BASE, 0xffff);
	OEMSPRINTF(work, file_i286ss, filenum);
	writeseg(work, SS_BASE, 0xffff);
	filenum++;
}
Beispiel #2
0
void
writesnap(Biobuf *b, Proc *p)
{
	int i, n;
	Data *d;

	for(i=0; i<Npfile; i++)
		if(d = p->d[i]) {
			Bprint(b, "%-11ld %s\n%-11lud ", p->pid, pfile[i], d->len);
			Bwrite(b, d->data, d->len);
		}

	if(p->text) {
		Bprint(b, "%-11ld text\n", p->pid);
		writeseg(b, p, p->text);
	}

	if(n = p->nseg) {
		Bprint(b, "%-11ld mem\n%-11d ", p->pid, n);
		for(i=0; i<n; i++)
			writeseg(b, p, p->seg[i]);
	}
}