dbg_cmd.c

来自「Linux下的tcl语言调试器」· C语言 代码 · 共 74 行

C
74
字号
/* Dbg_cmd.c - Tcl Debugger default command, used if app writer wants a			   quick and reasonable default.Written by: Don Libes, NIST, 3/23/93Design and implementation of this program was paid for by U.S. taxdollars.  Therefore it is public domain.  However, the author and NISTwould appreciate credit if this program or parts of it are used.*/#include "tclInt.h"#include "tcldbg.h"char *Dbg_DefaultCmdName = "debug";/*ARGSUSED*/static intApp_DebugCmd(clientData, interp, argc, argv)ClientData clientData;Tcl_Interp *interp;int argc;char **argv;{	int now = 0;	/* soon if 0, now if 1 */	if (argc > 3) goto usage;	argv++;	while (*argv) {		if (0 == strcmp(*argv,"-now")) {			now = 1;			argv++;		}		else break;	}	if (!*argv) {		if (now) {			Dbg_On(interp,1);		} else {			goto usage;		}	} else if (0 == strcmp(*argv,"0")) {		Dbg_Off(interp);	} else {		Dbg_On(interp,now);	}	return(TCL_OK); usage:	interp->result = "usage: [[-now] 1|0]";	return TCL_ERROR;}/* Tcl's load command looks for this by default due to the name of   the library.*/intTcldbg_Init(interp)Tcl_Interp *interp;{	if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {		return TCL_ERROR;	}	if (Tcl_PkgProvide(interp, "Dbg", DBG_VERSION) != TCL_OK) {		return TCL_ERROR;	}	Tcl_CreateCommand(interp,Dbg_DefaultCmdName,App_DebugCmd,			(ClientData)0,(void (*)())0);	return TCL_OK;	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?