diff options
author | das <das> | 2007-09-13 15:25:50 (GMT) |
---|---|---|
committer | das <das> | 2007-09-13 15:25:50 (GMT) |
commit | aa1f9091eb3bb99bc9e42cff663cb010f63e7d8c (patch) | |
tree | 08fbd5904ba00ee8d463fa93a72bd3a6da5091af /generic | |
parent | 45643ce0ed6dc112988a19d033043596b8ae16e1 (diff) | |
download | tcl-aa1f9091eb3bb99bc9e42cff663cb010f63e7d8c.zip tcl-aa1f9091eb3bb99bc9e42cff663cb010f63e7d8c.tar.gz tcl-aa1f9091eb3bb99bc9e42cff663cb010f63e7d8c.tar.bz2 |
* generic/tclCmdIL.c: factor our core of InfoFrameCmd() into internal
TclInfoFrame() for use by DTrace probes.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCmdIL.c | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index d3decd7..d3aee97 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.122 2007/07/31 17:03:36 msofer Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.123 2007/09/13 15:25:50 das Exp $ */ #include "tclInt.h" @@ -1060,18 +1060,8 @@ InfoFrameCmd( Tcl_Obj *CONST objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; - Tcl_Obj *lv[20]; /* Keep uptodate when more keys are added to - * the dict. */ - int level, lc = 0; + int level; CmdFrame *framePtr; - /* - * This array is indexed by the TCL_LOCATION_... values, except - * for _LAST. - */ - static CONST char *typeString[TCL_LOCATION_LAST] = { - "eval", "eval", "eval", "precompiled", "source", "proc" - }; - Tcl_Obj *tmpObj; if (objc == 1) { /* @@ -1125,7 +1115,45 @@ InfoFrameCmd( goto levelError; } + Tcl_SetObjResult(interp, TclInfoFrame(interp, framePtr)); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * TclInfoFrame -- + * + * Core of InfoFrameCmd, returns TIP280 dict for a given frame. + * + * Results: + * Returns TIP280 dict. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Tcl_Obj * +TclInfoFrame( + Tcl_Interp *interp, /* Current interpreter. */ + CmdFrame *framePtr) /* Frame to get info for. */ +{ + Interp *iPtr = (Interp *) interp; + Tcl_Obj *lv[20]; /* Keep uptodate when more keys are added to + * the dict. */ + int lc = 0; /* + * This array is indexed by the TCL_LOCATION_... values, except + * for _LAST. + */ + static CONST char *typeString[TCL_LOCATION_LAST] = { + "eval", "eval", "eval", "precompiled", "source", "proc" + }; + Tcl_Obj *tmpObj; + + /* * Pull the information and construct the dictionary to return, as list. * Regarding use of the CmdFrame fields see tclInt.h, and its definition. */ @@ -1301,8 +1329,7 @@ InfoFrameCmd( } } - Tcl_SetObjResult(interp, Tcl_NewListObj(lc, lv)); - return TCL_OK; + return Tcl_NewListObj(lc, lv); } /* |