From ad7d0b38e00014b222969f711509f325cecdd77b Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 27 Oct 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-10-27 --- gnot/trap.c | 21 +++++++++++++++------ port/sturp.c | 24 ++++++++++++++++++++---- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/gnot/trap.c b/gnot/trap.c index bf172c737fe2cc74ec877526db12e0b38e1737ea..e3a20fcbc86fe6c3932fd3ba516bc2daefd77aa3 100644 --- a/gnot/trap.c +++ b/gnot/trap.c @@ -131,15 +131,24 @@ trap(Ureg *ur) void dumpstack(void) { - ulong l, v; + ulong l, v, i; extern ulong etext; - if(u) - for(l=(ulong)&l; ltype){ case M_CTL: if(streamparse("break", bp)){ - sendctl(up, BREAK); - freeb(bp); + /* + * send a break as part of the data stream + */ + urpstat.output++; + bp->wptr = bp->lim; + bp->rptr = bp->wptr - 1; + *bp->rptr = BREAK; + putq(q, bp); + output(up); return; } if(streamparse("init", bp)){ @@ -831,11 +838,20 @@ sendblock(Urp *up, int bn) m->rptr = m->lim - 1; m->wptr = m->lim; *m->rptr = (bp->flags & S_DELIM) ? BOT : BOTM; - nbp = m->next = allocb(0); + nbp = allocb(0); nbp->rptr = bp->rptr; nbp->wptr = bp->wptr; + nbp->base = bp->base; + nbp->lim = bp->lim; nbp->flags |= S_DELIM; - PUTNEXT(q, m); + if(bp->type == M_CTL){ + PUTNEXT(q, nbp); + m->flags |= S_DELIM; + PUTNEXT(q, m); + } else { + m->next = nbp; + PUTNEXT(q, m); + } /* * message 2, the block length and the SEQ