1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-18 06:01:22 -08:00

Mps: (from branch unfixed-summary) 161973, 161977, 161978, 161982:

seg.c: SegDescribe: say "buffer: NULL" if it is (rather than saying nothing).
buffer.c: BufferDescribe: now interprets buffer->mode for you.
poolamc.c: amcSegCheck: check Nailboard present onlyif SegNailed for some trace;
 AMCSegDescribe: correct SEG_SUPERCLASS (so we see GCSeg fields); 
  say whether seg is Mobile, Boarded (there's a nailboard), or Stuck;
  clearer Map symbols, and print a key for them.

Copied from Perforce
 Change: 161983
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Kistruck 2007-03-22 15:23:20 +00:00
commit f1c19b5746
3 changed files with 47 additions and 14 deletions

View file

@ -147,10 +147,17 @@ Bool BufferCheck(Buffer buffer)
Res BufferDescribe(Buffer buffer, mps_lib_FILE *stream)
{
Res res;
char abzMode[5];
if (!CHECKT(Buffer, buffer)) return ResFAIL;
if (stream == NULL) return ResFAIL;
abzMode[0] = (buffer->mode & BufferModeTRANSITION) ? 't' : '_';
abzMode[1] = (buffer->mode & BufferModeLOGGED) ? 'l' : '_';
abzMode[2] = (buffer->mode & BufferModeFLIPPED) ? 'f' : '_';
abzMode[3] = (buffer->mode & BufferModeATTACHED) ? 'a' : '_';
abzMode[4] = '\0';
res = WriteF(stream,
"Buffer $P ($U) {\n",
(WriteFP)buffer, (WriteFU)buffer->serial,
@ -160,7 +167,8 @@ Res BufferDescribe(Buffer buffer, mps_lib_FILE *stream)
" Pool $P\n", (WriteFP)buffer->pool,
buffer->isMutator ?
" Mutator Buffer\n" : " Internal Buffer\n",
" Mode $B\n", (WriteFB)(buffer->mode),
" mode $S (TRANSITION, LOGGED, FLIPPED, ATTACHED)\n",
(WriteFS)abzMode,
" fillSize $UKb\n", (WriteFU)(buffer->fillSize / 1024),
" emptySize $UKb\n", (WriteFU)(buffer->emptySize / 1024),
" alignment $W\n", (WriteFW)buffer->alignment,

View file

@ -26,6 +26,7 @@ typedef struct amcGenStruct *amcGen;
/* forward declarations */
static Bool amcSegHasNailboard(Seg seg);
static Bool AMCCheck(AMC amc);
static Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO);
static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO);
@ -105,6 +106,9 @@ static Bool amcSegCheck(amcSeg amcseg)
CHECKD(GCSeg, &amcseg->gcSegStruct);
CHECKL(*amcseg->segTypeP == AMCPTypeNailboard
|| *amcseg->segTypeP == AMCPTypeGen);
if (*amcseg->segTypeP == AMCPTypeNailboard) {
CHECKL(SegNailed(amcSeg2Seg(amcseg)) != TraceSetEMPTY);
}
CHECKL(BoolCheck(amcseg->new));
return TRUE;
}
@ -160,7 +164,7 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
if (!CHECKT(amcSeg, amcseg)) return ResFAIL;
/* Describe the superclass fields first via next-method call */
super = SEG_SUPERCLASS(GCSegClass);
super = SEG_SUPERCLASS(amcSegClass);
res = super->describe(seg, stream);
if (res != ResOK) return res;
@ -171,18 +175,33 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
base = SegBase(seg);
p = AddrAdd(base, pool->format->headerSize);
limit = SegLimit(seg);
if (SegBuffer(seg) != NULL)
init = BufferGetInit(SegBuffer(seg));
else
init = limit;
res = WriteF(stream,
"AMC seg $P [$A,$A){\n",
(WriteFP)seg, (WriteFA)base, (WriteFA)limit,
" Map\n",
NULL);
if (res != ResOK) return res;
if (amcSegHasNailboard(seg)) {
res = WriteF(stream, " Boarded\n", NULL);
/* @@@@ should have AMCNailboardDescribe() */
} else {
if (SegNailed(seg) == TraceSetEMPTY) {
res = WriteF(stream, " Mobile\n", NULL);
} else {
res = WriteF(stream, " Stuck\n", NULL);
}
}
if (res != ResOK) return res;
res = WriteF(stream, " Map: *===:object bbbb:buffer\n", NULL);
if (res != ResOK) return res;
if (SegBuffer(seg) != NULL)
init = BufferGetInit(SegBuffer(seg));
else
init = limit;
for(i = base; i < limit; i = AddrAdd(i, row)) {
Addr j;
char c;
@ -194,9 +213,9 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
/* @@@@ This misses a header-sized pad at the end. */
for(j = i; j < AddrAdd(i, row); j = AddrAdd(j, step)) {
if (j >= limit)
c = ' ';
c = ' '; /* if seg is not a whole number of print rows */
else if (j >= init)
c = '.';
c = 'b';
else if (j == p) {
c = '*';
p = (pool->format->skip)(p);

View file

@ -1560,14 +1560,20 @@ static Res gcSegDescribe(Seg seg, mps_lib_FILE *stream)
res = super->describe(seg, stream);
if (res != ResOK) return res;
if (gcseg->buffer != NULL) {
res = BufferDescribe(gcseg->buffer, stream);
if (res != ResOK) return res;
}
res = WriteF(stream,
" summary $W\n", (WriteFW)gcseg->summary,
NULL);
return res;
if (res != ResOK) return res;
if (gcseg->buffer == NULL) {
res = WriteF(stream, " buffer: NULL\n", NULL);
}
else {
res = BufferDescribe(gcseg->buffer, stream);
}
if (res != ResOK) return res;
return ResOK;
}