pretty print multi demension array keys
[nedit-bw.git] / InterpretDebug-mods.patch
blob8b26605a81c760de4da4fb1886834122a1583097
1 Subject: modifications to the InterpretDebug patch
3 ---
5 makefiles/Makefile.bertw | 3
6 source/interpret.c | 240 ++++++++++++++++++++++++++++++++---------------
7 source/interpret.h | 5
8 source/parse.y | 14 --
9 source/userCmds.c | 4
10 5 files changed, 181 insertions(+), 85 deletions(-)
12 diff --quilt old/source/interpret.c new/source/interpret.c
13 --- old/source/interpret.c
14 +++ new/source/interpret.c
15 @@ -112,23 +112,24 @@ static const char *tagToStr(enum typeTag
17 #if defined(DEBUG_ASSEMBLY) || defined(DEBUG_STACK)
18 #define DEBUG_DISASSEMBLER
19 -static const char *printd(const char *f, ...);
20 -static int outPrintd();
21 -static void disasm(Inst *inst, int nInstr);
22 +static const char *printd(const char *f, ...)
23 +__attribute__((__format__(printf,1,2)));
24 +static int outPrintd(void);
25 +static void disasm(const char *name, Inst *inst, int nInstr);
26 static void disasmInternal(Inst *inst, int nInstr);
27 #endif /* #if defined(DEBUG_ASSEMBLY) || defined(DEBUG_STACK) */
29 #ifdef DEBUG_ASSEMBLY /* for disassembly */
30 -#define DISASM(i, n) disasm(i, n)
31 +#define DISASM(name, i, n) disasm(name, i, n)
32 #else /* #ifndef DEBUG_ASSEMBLY */
33 -#define DISASM(i, n)
34 +#define DISASM(name, i, n)
35 #endif /* #ifndef DEBUG_ASSEMBLY */
37 #ifdef DEBUG_STACK /* for run-time instruction and stack trace */
38 static void stackdump(int n, int extra);
39 static void stackdumpInternal(int n, int extra);
40 #define STACKDUMP(n, x) stackdump(n, x)
41 -#define DISASM_RT(i, n) disasm(i, n)
42 +#define DISASM_RT(i, n) disasm(NULL, i, n)
43 #else /* #ifndef DEBUG_STACK */
44 #define STACKDUMP(n, x)
45 #define DISASM_RT(i, n)
46 @@ -161,6 +162,8 @@ static Inst *ProgP; /* next free spot
47 static Inst *LoopStack[LOOP_STACK_SIZE]; /* addresses of break, cont stmts */
48 static Inst **LoopStackPtr = LoopStack; /* to fill at the end of a loop */
50 +static const char *ProgramName = "";
52 /* Global data for the interpreter */
53 static DataValue *TheStack; /* the stack */
54 static DataValue *StackP; /* next free spot on stack */
55 @@ -253,7 +256,7 @@ void InitMacroGlobals(void)
56 ** Start collecting instructions for a program. Clears the program
57 ** and the symbol table.
59 -void BeginCreatingProgram(AccumulatorData *acc)
60 +void BeginCreatingProgram(const char *name, AccumulatorData *acc)
62 /* save state */
63 acc->localSymList = LocalSymList;
64 @@ -261,10 +264,12 @@ void BeginCreatingProgram(AccumulatorDat
65 acc->progP = ProgP;
66 memcpy(acc->loopStack, LoopStack, sizeof(*LoopStack) * LOOP_STACK_SIZE);
67 acc->loopStackPtr = LoopStackPtr;
68 + acc->name = ProgramName;
70 LocalSymList = NULL;
71 ProgP = Prog;
72 LoopStackPtr = LoopStack;
73 + ProgramName = name;
77 @@ -278,12 +283,13 @@ Program *FinishCreatingProgram(Accumulat
78 int progLen, fpOffset = 0;
79 Symbol *s;
81 - newProg = (Program *)XtMalloc(sizeof(Program));
82 + newProg = XtNew(Program);
83 + newProg->name = XtMalloc(strlen(ProgramName) + 1); /* +1 for '\0' */
84 progLen = ((char *)ProgP) - ((char *)Prog);
85 newProg->code = (Inst *)XtMalloc(progLen);
86 memcpy(newProg->code, Prog, progLen);
87 newProg->localSymList = LocalSymList;
88 - newProg->name = NULL;
89 + strcpy(newProg->name, ProgramName);
90 newProg->refcount = 1;
92 /* Local variables' values are stored on the stack. Here we assign
93 @@ -291,7 +297,7 @@ Program *FinishCreatingProgram(Accumulat
94 for (s = newProg->localSymList; s != NULL; s = s->next)
95 s->value.val.n = fpOffset++;
97 - DISASM(newProg->code, ProgP - Prog);
98 + DISASM(newProg->name, newProg->code, ProgP - Prog);
100 /* restore state */
101 LocalSymList = acc->localSymList;
102 @@ -299,6 +305,7 @@ Program *FinishCreatingProgram(Accumulat
103 ProgP = acc->progP;
104 memcpy(LoopStack, acc->loopStack, sizeof(*LoopStack) * LOOP_STACK_SIZE);
105 LoopStackPtr = acc->loopStackPtr;
106 + ProgramName = acc->name;
108 return newProg;
110 @@ -3588,7 +3595,9 @@ static int errCheck(const char *s)
112 static char *stackDumpStr(DataValue *fp, const char *msg, char **s, int *pLen)
114 - int len;
115 + static const char backtraceMsg[] = "\n\nBacktrace:";
116 + char frameBuf[TYPE_INT_STR_SIZE(int) + 2];
117 + int len, nFrames, frameWidth, thisFrameWidth;
118 const char *op;
119 char *np;
120 DataValue *nfp = fp;
121 @@ -3596,26 +3605,30 @@ static char *stackDumpStr(DataValue *fp,
123 #ifdef DEBUG_STACK
124 const char *dump;
125 - printd("\n\n");
126 + static const char stackdumpMsg[] = "\n\nStack:\n";
127 disasmInternal(PC - 1, 1);
128 stackdumpInternal(0, 50);
129 dump = printd(NULL);
130 #endif
132 /* first measure the lengths */
133 - len = strlen(msg) + 1;
134 + len = strlen(msg) + strlen(backtraceMsg) + 1;
135 nfp = fp;
136 + nFrames = 0;
137 do {
138 + nFrames++;
139 len = len + FP_GET_ITEM(nfp, FP_FUNCTION_NAME).val.str.len + 1;
140 pc = FP_GET_RET_PC(nfp);
141 nfp = FP_GET_OLD_FP(nfp);
142 } while (pc);
143 + frameWidth = lenLongAsStr(nFrames);
144 + len += nFrames * (2 + frameWidth);
145 #ifdef DEBUG_STACK
146 - len += strlen(dump);
147 + len += strlen(stackdumpMsg) + strlen(dump);
148 #endif
149 if (*pLen < len)
151 - *s = *s ? XtRealloc(*s, len) : XtMalloc(len);
152 + *s = XtRealloc(*s, len);
153 *pLen = len;
155 /* now copy */
156 @@ -3623,10 +3636,25 @@ static char *stackDumpStr(DataValue *fp,
157 op = msg;
158 while (*op)
159 *np++ = *op++;
160 + op = backtraceMsg;
161 + while (*op)
162 + *np++ = *op++;
164 nfp = fp;
165 + nFrames = 0;
166 do {
167 + nFrames++;
168 *np++ = '\n';
169 + *np++ = '#';
170 + thisFrameWidth = 0;
171 + op = longAsStr(nFrames);
172 + while (*op) {
173 + thisFrameWidth++;
174 + *np++ = *op++;
176 + while (thisFrameWidth++ < frameWidth)
177 + *np++ = ' ';
178 + *np++ = ' ';
179 op = FP_GET_ITEM(nfp, FP_FUNCTION_NAME).val.str.rep;
180 while (*op)
181 *np++ = *op++;
182 @@ -3634,12 +3662,15 @@ static char *stackDumpStr(DataValue *fp,
183 nfp = FP_GET_OLD_FP(nfp);
184 } while (pc);
185 #ifdef DEBUG_STACK
186 + op = stackdumpMsg;
187 + while (*op)
188 + *np++ = *op++;
189 op = dump;
190 while (*op)
191 *np++ = *op++;
192 #endif
194 - *np = 0;
195 + *np = '\0';
196 return *s;
199 @@ -3754,27 +3785,27 @@ static const char *printd(const char *f,
200 return printdBuffer;
203 -int outPrintd()
204 +int outPrintd(void)
206 const char *s = printd(NULL);
207 const char *cp;
209 static int outIsTTY = -1;
210 if (outIsTTY == -1)
211 - outIsTTY = isatty(fileno(stdout));
212 + outIsTTY = isatty(fileno(stderr));
214 if (outIsTTY)
216 for (cp = s; *cp; cp++)
217 if (*cp == '\n')
218 - printf("\033[K\n");
219 + fprintf(stderr, "\033[K\n");
220 else
221 - putchar(*cp);
222 + fputc(*cp, stderr);
224 else
226 for (cp = s; *cp; cp++)
227 - putchar(*cp);
228 + fputc(*cp, stderr);
230 return cp - s;
232 @@ -3785,40 +3816,59 @@ static void dumpVal(DataValue dv)
234 switch (dv.tag) {
235 case INT_TAG:
236 - printd("i=%d", dv.val.n);
237 + printd(" <%s %d>", tagToStr(INT_TAG), dv.val.n);
238 break;
239 case STRING_TAG:
241 - int k;
242 - char s[21];
243 - char *src = dv.val.str.rep;
244 + int k, l;
245 + char s[64];
246 + const char *src = dv.val.str.rep;
247 + unsigned len = dv.val.str.len;
248 if (!src) {
249 - printd("s=<NULL>");
250 + printd(" <%s NULL>", tagToStr(STRING_TAG));
252 else {
253 - for (k = 0; src[k] && k < sizeof s - 1; k++) {
254 - s[k] = isprint(src[k]) ? src[k] : '?';
255 + for (k = 0, l = 0; src[k] && l < sizeof s - 1; k++, l++) {
256 + char *e;
257 + const char to[] = "\\\"ntbrfave";
258 +#ifdef EBCDIC_CHARSET
259 + const char from[] = "\\\"\n\t\b\r\f\a\v\x27"; /* EBCDIC escape */
260 +#else
261 + const char from[] = "\\\"\n\t\b\r\f\a\v\x1B"; /* ASCII escape */
262 +#endif
263 + if ((e = strchr(from, src[k]))) {
264 + if (l < sizeof s - 2) {
265 + s[l++] = '\\';
266 + s[l] = to[e - from];
269 + else if (isprint(src[k])) {
270 + s[l] = src[k];
272 + else {
273 + s[l] = '?';
276 - s[k] = 0;
277 - printd("s=\"%s\"%s[%d]", s,
278 - src[k] ? "..." : "", strlen(src));
279 + s[l] = 0;
280 + printd(" <%s %u:\"%s\"%s>", tagToStr(STRING_TAG),
281 + len, s, src[k] ? "..." : "");
284 break;
285 case ARRAY_TAG:
286 - printd("%08p <%s>[%d]", dv.val.arrayPtr, tagToStr(ARRAY_TAG),
287 - ArraySize(&dv));
288 + printd(" <%s %u:%p>", tagToStr(ARRAY_TAG), ArraySize(&dv),
289 + dv.val.arrayPtr);
290 break;
291 case NO_TAG:
292 - if (!dv.val.inst) {
293 - printd("<%s>", tagToStr(NO_TAG));
294 + if (!*(void **)&dv.val) {
295 + printd(" <%s>", tagToStr(NO_TAG));
297 else {
298 - printd("?%8p", dv.val.inst);
299 + printd(" ?%p", *(void **)&dv.val);
301 break;
302 default:
303 - printd("UNKNOWN DATA TAG %d ?%8p", dv.tag, dv.val.inst);
304 + printd(" <unknown value %d:%p>", dv.tag, *(void **)&dv.val);
305 break;
308 @@ -3833,57 +3883,65 @@ static void disasmInternal(Inst *inst, i
309 #undef OP
311 int i, j;
312 + static size_t opLen;
314 - printd("\n");
315 + if (!opLen) {
316 + for (j = 0; j < N_OPS; ++j) {
317 + if (opLen < strlen(opNames[j])) {
318 + opLen = strlen(opNames[j]);
323 for (i = 0; i < nInstr; ++i) {
324 - printd("Prog %8p ", &inst[i]);
325 + printd("Prog %10p", &inst[i]);
326 for (j = 0; j < N_OPS; ++j) {
327 if (inst[i].func == OpFns[j]) {
328 - printd("%22s ", opNames[j]);
329 + printd(" %*s", (int)opLen, opNames[j]);
330 if (j == OP_PUSH_SYM || j == OP_ASSIGN) {
331 Symbol *sym = inst[i+1].sym;
332 - printd("%s", sym->name);
333 - if (sym->value.tag == STRING_TAG &&
334 - strncmp(sym->name, "string #", 8) == 0) {
335 + printd(" %s", sym->name);
336 + if (sym->type == CONST_SYM
337 + && sym->value.tag == STRING_TAG) {
338 dumpVal(sym->value);
340 ++i;
342 else if (j == OP_PUSH_IMMED) {
343 - printd("i=%d", inst[i+1].value);
344 + printd(" <immediate %d>", inst[i+1].value);
345 ++i;
347 else if (j == OP_BRANCH || j == OP_BRANCH_FALSE ||
348 j == OP_BRANCH_NEVER || j == OP_BRANCH_TRUE) {
349 - printd("to=(%d) %p", inst[i+1].value,
350 + printd(" to=(%+d) %p", inst[i+1].value,
351 &inst[i+1] + inst[i+1].value);
352 ++i;
354 else if (j == OP_CONCAT) {
355 - printd("nExpr=%d", inst[i+1].value);
356 + printd(" nExpr=%d", inst[i+1].value);
357 ++i;
359 else if (j == OP_SUBR_CALL) {
360 int args = inst[i+2].value;
361 - printd("%s ", inst[i+1].sym->name);
362 + printd(" %s", inst[i+1].sym->name);
363 if (args < 0) {
364 - printd("%d+args[] (%d)", -args - 1, args);
365 + printd(" %d+args[] (%d)", -args - 1, args);
367 else {
368 - printd("%d args", args);
369 + printd(" %d args", args);
371 i += 2;
373 else if (j == OP_SUBR_CALL_STACKED_N) {
374 - printd("%s args[] (?)", inst[i+1].sym->name);
375 + printd(" %s args[] (?)", inst[i+1].sym->name);
376 ++i;
378 else if (j == OP_BEGIN_ARRAY_ITER) {
379 - printd("%s in", inst[i+1].sym->name);
380 + printd(" %s in", inst[i+1].sym->name);
381 ++i;
383 else if (j == OP_ARRAY_ITER) {
384 - printd("%s = %s++ end-loop=(%d) %p",
385 + printd(" %s = %s++ end-loop=(%+d) %p",
386 inst[i+1].sym->name,
387 inst[i+2].sym->name,
388 inst[i+3].value, &inst[i+3] + inst[i+3].value);
389 @@ -3895,18 +3953,20 @@ static void disasmInternal(Inst *inst, i
390 j == OP_ANONARRAY_INDEX_VAL ||
391 j == OP_NAMED_ARG1 ||
392 j == OP_NAMED_ARGN) {
393 - printd("nDim=%d", inst[i+1].value);
394 + printd(" nDim=%d", inst[i+1].value);
395 ++i;
397 else if (j == OP_ARRAY_REF_ASSIGN_SETUP) {
398 - printd("binOp=%s ", inst[i+1].value ? "true" : "false");
399 - printd("nDim=%d", inst[i+2].value);
400 + printd(" binOp=%s nDim=%d",
401 + inst[i+1].value ? "true" : "false",
402 + inst[i+2].value);
403 i += 2;
405 else if (j == OP_PUSH_ARRAY_SYM) {
406 - printd("%s", inst[++i].sym->name);
407 - printd(" %s", inst[i+1].value ? "createAndRef" : "refOnly");
408 - ++i;
409 + printd(" %s %s",
410 + inst[i+1].sym->name,
411 + inst[i+2].value ? "createAndRef" : "refOnly");
412 + i += 2;
415 printd("\n");
416 @@ -3914,18 +3974,20 @@ static void disasmInternal(Inst *inst, i
419 if (j == N_OPS) {
420 - printd("%x\n", inst[i].value);
421 + printd(" %x\n", inst[i].value);
426 -static void disasm(Inst *inst, int nInstr)
427 +static void disasm(const char *name, Inst *inst, int nInstr)
429 static int outIsTTY = -1;
430 - if (outIsTTY == -1) outIsTTY = isatty(fileno(stdout));
431 + if (outIsTTY == -1) outIsTTY = isatty(fileno(stderr));
432 if (outIsTTY) { printd("\033[H"); }
433 + if (name) printd(">> %s\n", name);
434 disasmInternal(inst, nInstr);
435 if (outIsTTY) { printd("\033[J\n"); }
436 + if (name) printd("\n");
437 outPrintd();
439 #endif /* #ifdef DEBUG_DISASSEMBLER */
440 @@ -3939,6 +4001,9 @@ static void stackdumpframe(DataValue *ar
441 DataValue *oldFP = retPC ? FP_GET_OLD_FP(fp) : NULL;
442 DataValue *arg1 = &FP_GET_ARG_N(fp, 0);
443 DataValue *fnNm = &FP_GET_ITEM(fp, FP_FUNCTION_NAME);
444 + DataValue *prFP = &FP_GET_ITEM(fp, FP_PROG_INDEX);
445 + DataValue *ofFP = &FP_GET_ITEM(fp, FP_OLD_FP_INDEX);
446 + DataValue *rpFP = &FP_GET_ITEM(fp, FP_RET_PC_INDEX);
447 DataValue *dv;
448 DataValue *endDv = (arg1 > outpt) ? arg1 : outpt;
449 int nArgs = FP_GET_ARG_COUNT(fp);
450 @@ -3976,7 +4041,7 @@ static void stackdumpframe(DataValue *ar
451 for (dv = endDv; dv < sp; dv++)
452 #endif /* #ifdef DEBUG_STACK_HEADFIRST */
454 - const char *posFmt = "%-6s ";
455 + const char *posFmt = "%-6s";
456 const char *symName = "";
458 char *pos = "";
459 @@ -3985,8 +4050,7 @@ static void stackdumpframe(DataValue *ar
460 const char *leadIn = (dv >= arrow) ? ">>>>" :
461 (dv == arg1) ? "----" :
462 (dv == fnNm) ? "====" : "";
463 - printd("%4.4s", leadIn);
464 - printd("%8p%c", dv, topMark);
465 + printd("%-5.4s%10p%c", leadIn, dv, topMark);
466 switch (offset) {
467 case FP_ARG_COUNT_INDEX: pos = "NArgs"; break; /* num. arguments */
468 case FP_FUNCTION_NAME: pos = "FnName"; break;
469 @@ -4004,7 +4068,7 @@ static void stackdumpframe(DataValue *ar
471 else if (0 <= offset && offset < nSyms) {
472 sprintf(pos = buffer, offset ? "[%d]" : "FP[%d]", offset);
473 - posFmt = "%6s ";
474 + posFmt = "%6s";
476 else if (offset == 0) {
477 pos = "FrameP";
478 @@ -4022,12 +4086,40 @@ static void stackdumpframe(DataValue *ar
482 - printd("%-*.*s ", symLen, symLen, symName);
483 + printd(" %-*.*s", symLen, symLen, symName);
485 - if (dv == fnNm && dv->tag == STRING_TAG && dv->val.str.rep)
486 - printd("%s", dv->val.str.rep);
487 + if (dv == fnNm && dv->tag == STRING_TAG && dv->val.str.rep) {
488 + printd(" %s", dv->val.str.rep);
490 else
491 + if (dv == ofFP) {
492 + if (dv->val.dataval) {
493 + printd(" %p", dv->val.dataval);
495 + else {
496 + printd(" <end>");
499 + else
500 + if (dv == rpFP) {
501 + if (dv->val.inst) {
502 + printd(" %p", dv->val.inst);
504 + else {
505 + printd(" <end>");
508 + else
509 + if (dv == prFP) {
510 + Program *prog = dv->val.prog;
511 + printd(" %10p refcount:%u %s",
512 + prog,
513 + prog->refcount,
514 + prog->name);
516 + else {
517 dumpVal(*dv);
520 printd("\n");
522 @@ -4054,7 +4146,7 @@ static void stackdumpInternal(int n, int
523 if (outpt < TheStack)
524 printd("--------------Stack base--------------\n");
525 stackdumpframe(arrow, outpt, FrameP, StackP, '*');
526 - printd("Stack ----->\n");
527 + printd("Stack ----->\n\n");
528 #endif /* #ifdef DEBUG_STACK_HEADFIRST */
531 @@ -4062,15 +4154,19 @@ static void stackdump(int n, int extra)
533 static int outIsTTY = -1;
534 if (outIsTTY == -1)
535 - outIsTTY = isatty(fileno(stdout));
536 + outIsTTY = isatty(fileno(stderr));
538 - stackdumpInternal(n, extra);
539 +#ifndef DEBUG_STACKDUMP_EXTRA
540 +#define DEBUG_STACKDUMP_EXTRA 0
541 +#endif
542 + stackdumpInternal(n, extra + DEBUG_STACKDUMP_EXTRA);
543 +#undef DEBUG_STACKDUMP_EXTRA
545 if (outIsTTY)
546 printd("\033[J\n");
548 outPrintd();
549 - fflush(stdout);
550 + fflush(stderr);
553 #endif /* ifdef DEBUG_STACK */
554 diff --quilt old/source/interpret.h new/source/interpret.h
555 --- old/source/interpret.h
556 +++ new/source/interpret.h
557 @@ -105,10 +105,10 @@ typedef struct SymbolRec {
558 } Symbol;
560 typedef struct ProgramTag {
561 + char *name;
562 Symbol *localSymList;
563 Inst *code;
564 unsigned refcount;
565 - char *name;
566 } Program;
568 /* Information needed to re-start a preempted macro */
569 @@ -128,6 +128,7 @@ typedef struct AccumulatorDataTag {
570 Inst *progP;
571 Inst *loopStack[LOOP_STACK_SIZE];
572 Inst **loopStackPtr;
573 + const char *name;
574 } AccumulatorData;
576 void InitMacroGlobals(void);
577 @@ -144,7 +145,7 @@ int ArrayCopy(DataValue *dstArray, DataV
579 /* Routines for creating a program, (accumulated beginning with
580 BeginCreatingProgram and returned via FinishCreatingProgram) */
581 -void BeginCreatingProgram(AccumulatorData *acc);
582 +void BeginCreatingProgram(const char *name, AccumulatorData *acc);
583 int AddOp(int op, char **msg);
584 int AddSym(Symbol *sym, char **msg);
585 int AddImmediate(int value, char **msg);
586 diff --quilt old/source/parse.y new/source/parse.y
587 --- old/source/parse.y
588 +++ new/source/parse.y
589 @@ -196,7 +196,7 @@ definesym: SYMBOL {
590 yyerror("try to override built-in subroutine"); YYERROR;
592 $$.sym = PromoteToGlobal($1);
593 - BeginCreatingProgram($$.acc);
594 + BeginCreatingProgram($$.sym->name, $$.acc);
597 define: definekw blank definesym blank blockwb {
598 @@ -745,14 +745,16 @@ Program *ParseMacro(char *expr, char **m
600 Program *prog;
601 AccumulatorData *acc = XtNew(AccumulatorData);
602 - static const char *prefix = ">> ";
604 #if YYDEBUG
605 int oldyydebug = yydebug;
606 yydebug = 1;
607 #endif
609 - BeginCreatingProgram(acc);
610 + if (!name)
611 + name = "--unknown--";
613 + BeginCreatingProgram(name, acc);
615 /* whether we allow the "define" keyword */
616 AllowDefine = allowDefine;
617 @@ -780,12 +782,6 @@ Program *ParseMacro(char *expr, char **m
618 prog = FinishCreatingProgram(acc);
619 XtFree((char *)acc);
621 - if (!name)
622 - name = "--unknown--";
624 - prog->name = XtMalloc(strlen(name) + strlen(prefix) + 1);
625 - strcat(strcpy(prog->name, prefix), name);
627 /* parse succeeded */
628 *msg = "";
629 *stoppedAt = InPtr;
630 diff --quilt old/source/userCmds.c new/source/userCmds.c
631 --- old/source/userCmds.c
632 +++ new/source/userCmds.c
633 @@ -1286,13 +1286,13 @@ static int doMacroMenuCmd(WindowInfo *wi
634 int DoNamedMacroMenuCmd(WindowInfo *window, const char *itemName)
636 return doMacroMenuCmd(window, itemName, MacroMenuItems, NMacroMenuItems,
637 - "macro-menu>");
638 + "Macro Menu>");
641 int DoNamedBGMenuCmd(WindowInfo *window, const char *itemName)
643 return doMacroMenuCmd(window, itemName, BGMenuItems, NBGMenuItems,
644 - "background-menu>");
645 + "Background Menu>");
649 diff --quilt old/makefiles/Makefile.bertw new/makefiles/Makefile.bertw
650 --- old/makefiles/Makefile.bertw
651 +++ new/makefiles/Makefile.bertw
652 @@ -23,6 +23,9 @@ ifdef DEBUG
653 ifdef DEBUG_MACRO
654 ifndef DEBUG_NO_STACKDUMP
655 CFLAGS += -DDEBUG_STACK
656 + ifdef DEBUG_STACKDUMP_EXTRA
657 + CFLAGS += -DDEBUG_STACKDUMP_EXTRA=$(DEBUG_STACKDUMP_EXTRA)
658 + endif
659 endif
660 ifndef DEBUG_NO_DISASM
661 CFLAGS += -DDEBUG_ASSEMBLY