aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Debugging.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /contrib/tools/cython/Cython/Debugging.py
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'contrib/tools/cython/Cython/Debugging.py')
-rw-r--r--contrib/tools/cython/Cython/Debugging.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/tools/cython/Cython/Debugging.py b/contrib/tools/cython/Cython/Debugging.py
new file mode 100644
index 0000000000..edb3f4e8ca
--- /dev/null
+++ b/contrib/tools/cython/Cython/Debugging.py
@@ -0,0 +1,20 @@
+###############################################
+#
+# Odds and ends for debugging
+#
+###############################################
+
+def print_call_chain(*args):
+ import sys
+ print(" ".join(map(str, args)))
+ f = sys._getframe(1)
+ while f:
+ name = f.f_code.co_name
+ s = f.f_locals.get('self', None)
+ if s:
+ c = getattr(s, "__class__", None)
+ if c:
+ name = "%s.%s" % (c.__name__, name)
+ print("Called from: %s %s" % (name, f.f_lineno))
+ f = f.f_back
+ print("-" * 70)