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)
commit99143db529398b45e139029b3af9727927b1f7c6 (patch)
treef1ff3c4b364185f5be97cc91fbc37ed76cbf52ad /generic/tclProc.c
parent251dc3a322ad2fd4b39b11c5696ac34ddc9a15a5 (diff)
downloadtcl-99143db529398b45e139029b3af9727927b1f7c6.zip
tcl-99143db529398b45e139029b3af9727927b1f7c6.tar.gz
tcl-99143db529398b45e139029b3af9727927b1f7c6.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