summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-04-22 14:57:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-04-22 14:57:17 (GMT)
commit2507a22c1331a14e20f89bc665f8f8f0810d8da8 (patch)
treef1ff3c4b364185f5be97cc91fbc37ed76cbf52ad /generic/tclProc.c
parent0c9c64f76498585487efd90abb910d7f1e23072c (diff)
downloadtcl-2507a22c1331a14e20f89bc665f8f8f0810d8da8.zip
tcl-2507a22c1331a14e20f89bc665f8f8f0810d8da8.tar.gz
tcl-2507a22c1331a14e20f89bc665f8f8f0810d8da8.tar.bz2
A better way of getting source file location information when disassembling.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index ae9e7cd..5c68e17 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -2774,6 +2774,41 @@ MakeLambdaError(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * TclGetCmdFrameForProcedure --
+ *
+ * How to get the CmdFrame information for a procedure.
+ *
+ * Results:
+ * A pointer to the CmdFrame (only guaranteed to be valid until the next
+ * Tcl command is processed or the interpreter's state is otherwise
+ * modified) or a NULL if the information is not available.
+ *
+ * Side effects:
+ * none.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CmdFrame *
+TclGetCmdFrameForProcedure(
+ Proc *procPtr) /* The procedure whose cmd-frame is to be
+ * looked up. */
+{
+ Tcl_HashEntry *hePtr;
+
+ if (procPtr == NULL || procPtr->iPtr == NULL) {
+ return NULL;
+ }
+ hePtr = Tcl_FindHashEntry(procPtr->iPtr->linePBodyPtr, procPtr);
+ if (hePtr == NULL) {
+ return NULL;
+ }
+ return (CmdFrame *) Tcl_GetHashValue(hePtr);
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4