tools.c (256281) | tools.c (271135) |
---|---|
1/******************************************************************* 2** t o o l s . c 3** Forth Inspired Command Language - programming tools 4** Author: John Sadler (john_sadler@alum.mit.edu) 5** Created: 20 June 2000 6** $Id: tools.c,v 1.11 2001/12/05 07:21:34 jsadler Exp $ 7*******************************************************************/ 8/* --- 40 unchanged lines hidden (view full) --- 49** colonParen doDoes createParen variableParen userParen constantParen 50** 51** Step and break debugger for Ficl 52** debug ( xt -- ) Start debugging an xt 53** Set a breakpoint 54** Specify breakpoint default action 55*/ 56 | 1/******************************************************************* 2** t o o l s . c 3** Forth Inspired Command Language - programming tools 4** Author: John Sadler (john_sadler@alum.mit.edu) 5** Created: 20 June 2000 6** $Id: tools.c,v 1.11 2001/12/05 07:21:34 jsadler Exp $ 7*******************************************************************/ 8/* --- 40 unchanged lines hidden (view full) --- 49** colonParen doDoes createParen variableParen userParen constantParen 50** 51** Step and break debugger for Ficl 52** debug ( xt -- ) Start debugging an xt 53** Set a breakpoint 54** Specify breakpoint default action 55*/ 56 |
57/* $FreeBSD: stable/10/sys/boot/ficl/tools.c 249223 2013-04-07 05:53:42Z kientzle $ */ | 57/* $FreeBSD: stable/10/sys/boot/ficl/tools.c 271135 2014-09-04 21:01:10Z emaste $ */ |
58 59#ifdef TESTMAIN 60#include <stdlib.h> 61#include <stdio.h> /* sprintf */ 62#include <ctype.h> 63#else 64#include <stand.h> 65#endif --- 130 unchanged lines hidden (view full) --- 196 { 197 FICL_WORD *pFW = (FICL_WORD *)(pc->p); 198 199 cp = pVM->pad; 200 if ((void *)pc == (void *)pVM->ip) 201 *cp++ = '>'; 202 else 203 *cp++ = ' '; | 58 59#ifdef TESTMAIN 60#include <stdlib.h> 61#include <stdio.h> /* sprintf */ 62#include <ctype.h> 63#else 64#include <stand.h> 65#endif --- 130 unchanged lines hidden (view full) --- 196 { 197 FICL_WORD *pFW = (FICL_WORD *)(pc->p); 198 199 cp = pVM->pad; 200 if ((void *)pc == (void *)pVM->ip) 201 *cp++ = '>'; 202 else 203 *cp++ = ' '; |
204 cp += sprintf(cp, "%3d ", pc-param0); | 204 cp += sprintf(cp, "%3d ", (int)(pc-param0)); |
205 206 if (isAFiclWord(pd, pFW)) 207 { 208 WORDKIND kind = ficlWordClassify(pFW); 209 CELL c; 210 211 switch (kind) 212 { --- 21 unchanged lines hidden (view full) --- 234 FICL_STRING *sp = (FICL_STRING *)(void *)++pc; 235 pc = (CELL *)alignPtr(sp->text + sp->count + 1) - 1; 236 sprintf(cp, "c\" %.*s\"", sp->count, sp->text); 237 } 238 break; 239 case IF: 240 c = *++pc; 241 if (c.i > 0) | 205 206 if (isAFiclWord(pd, pFW)) 207 { 208 WORDKIND kind = ficlWordClassify(pFW); 209 CELL c; 210 211 switch (kind) 212 { --- 21 unchanged lines hidden (view full) --- 234 FICL_STRING *sp = (FICL_STRING *)(void *)++pc; 235 pc = (CELL *)alignPtr(sp->text + sp->count + 1) - 1; 236 sprintf(cp, "c\" %.*s\"", sp->count, sp->text); 237 } 238 break; 239 case IF: 240 c = *++pc; 241 if (c.i > 0) |
242 sprintf(cp, "if / while (branch %d)", pc+c.i-param0); | 242 sprintf(cp, "if / while (branch %d)", (int)(pc+c.i-param0)); |
243 else | 243 else |
244 sprintf(cp, "until (branch %d)", pc+c.i-param0); | 244 sprintf(cp, "until (branch %d)", (int)(pc+c.i-param0)); |
245 break; 246 case BRANCH: 247 c = *++pc; 248 if (c.i == 0) | 245 break; 246 case BRANCH: 247 c = *++pc; 248 if (c.i == 0) |
249 sprintf(cp, "repeat (branch %d)", pc+c.i-param0); | 249 sprintf(cp, "repeat (branch %d)", (int)(pc+c.i-param0)); |
250 else if (c.i == 1) | 250 else if (c.i == 1) |
251 sprintf(cp, "else (branch %d)", pc+c.i-param0); | 251 sprintf(cp, "else (branch %d)", (int)(pc+c.i-param0)); |
252 else | 252 else |
253 sprintf(cp, "endof (branch %d)", pc+c.i-param0); | 253 sprintf(cp, "endof (branch %d)", (int)(pc+c.i-param0)); |
254 break; 255 256 case OF: 257 c = *++pc; | 254 break; 255 256 case OF: 257 c = *++pc; |
258 sprintf(cp, "of (branch %d)", pc+c.i-param0); | 258 sprintf(cp, "of (branch %d)", (int)(pc+c.i-param0)); |
259 break; 260 261 case QDO: 262 c = *++pc; | 259 break; 260 261 case QDO: 262 c = *++pc; |
263 sprintf(cp, "?do (leave %d)", (CELL *)c.p-param0); | 263 sprintf(cp, "?do (leave %d)", (int)((CELL *)c.p-param0)); |
264 break; 265 case DO: 266 c = *++pc; | 264 break; 265 case DO: 266 c = *++pc; |
267 sprintf(cp, "do (leave %d)", (CELL *)c.p-param0); | 267 sprintf(cp, "do (leave %d)", (int)((CELL *)c.p-param0)); |
268 break; 269 case LOOP: 270 c = *++pc; | 268 break; 269 case LOOP: 270 c = *++pc; |
271 sprintf(cp, "loop (branch %d)", pc+c.i-param0); | 271 sprintf(cp, "loop (branch %d)", (int)(pc+c.i-param0)); |
272 break; 273 case PLOOP: 274 c = *++pc; | 272 break; 273 case PLOOP: 274 c = *++pc; |
275 sprintf(cp, "+loop (branch %d)", pc+c.i-param0); | 275 sprintf(cp, "+loop (branch %d)", (int)(pc+c.i-param0)); |
276 break; 277 default: 278 sprintf(cp, "%.*s", pFW->nName, pFW->name); 279 break; 280 } 281 282 } 283 else /* probably not a word - punt and print value */ --- 635 unchanged lines hidden --- | 276 break; 277 default: 278 sprintf(cp, "%.*s", pFW->nName, pFW->name); 279 break; 280 } 281 282 } 283 else /* probably not a word - punt and print value */ --- 635 unchanged lines hidden --- |