From decf42952c4c12b522302e2c227bd106d73d1d10 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 28 Aug 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-08-28 --- port/devproc.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/port/devproc.c b/port/devproc.c index 959060a5e88fda1c0adbec9306878f332749a42c..e3943899bf7b62e7068d9a16c8ce34942dce5d4b 100644 --- a/port/devproc.c +++ b/port/devproc.c @@ -18,6 +18,7 @@ enum Qnote, Qnotepg, Qns, + Qproc, Qregs, Qsegment, Qstatus, @@ -35,6 +36,7 @@ Dirtab procdir[] = "note", {Qnote}, 0, 0000, "notepg", {Qnotepg}, 0, 0000, "ns", {Qns}, 0, 0400, + "proc", {Qproc}, 0, 0400, "regs", {Qregs}, sizeof(Ureg), 0000, "segment", {Qsegment}, 0, 0444, "status", {Qstatus}, STATSIZE, 0444, @@ -177,6 +179,39 @@ procopen(Chan *c, int omode) tc->offset = 0; return tc; + case Qproc: +{ +Segment *sg; +int i, j; +Page **src; +Pte *old; + for(i = 0; i < MAXMACH; i++) + print("%d ", p->pidonmach[i]); + print("\n"); + for(i = 0; i < NSEG; i++) { + sg = p->seg[i]; + if(sg == 0) + continue; + print("%-6s %c %.8lux %.8lux %4d\n", + sname[sg->type&SG_TYPE], + sg->type&SG_RONLY ? 'R' : ' ', + sg->base, sg->top, sg->ref); + + for(j = 0; j < SEGMAPSIZE; j++) { + old = sg->map[j]; + if(old == 0) + continue; + print("\t%d: %lux\n", j, old); + for(src = old->first; src <= old->last; src++) { + if(*src == 0) + continue; + + print("\t\t%lux %lux\n", (*src)->va, (*src)->pa); + } + prflush(); + } + } +} case Qkregs: case Qsegment: if(omode != OREAD) @@ -333,6 +368,10 @@ procread(Chan *c, void *va, long n, ulong offset) qunlock(&p->debug); return n; + case Qproc: + + return readnum(offset, va, n, (ulong)p, NUMSIZE); + case Qregs: rptr = (uchar*)p->dbgreg; rsize = sizeof(Ureg);