summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-10-03 20:56:15 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2003-10-03 20:56:15 (GMT)
commitf64ec0f2a1048fde833cb81f1ee199d0d2b507ac (patch)
tree6d9c43689d32d41651c69556acc7429d5e7e7b0b
parentd46e684edd5b75f9674af2acd730c1a2f03655ed (diff)
downloadcpython-f64ec0f2a1048fde833cb81f1ee199d0d2b507ac.zip
cpython-f64ec0f2a1048fde833cb81f1ee199d0d2b507ac.tar.gz
cpython-f64ec0f2a1048fde833cb81f1ee199d0d2b507ac.tar.bz2
A helper to dump info about the current frame,
assuming it is the variable f.
-rw-r--r--Misc/gdbinit9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/gdbinit b/Misc/gdbinit
index ae333b2..05f6a91 100644
--- a/Misc/gdbinit
+++ b/Misc/gdbinit
@@ -25,3 +25,12 @@ end
define pyg
print _PyGC_Dump($arg0)
end
+
+# If you are in an eval_frame() function, calling pyframe with no
+# arguments will print the filename, function name, and line number.
+# It assumes that f is the name of the current frame.
+define pyframe
+x/s ((PyStringObject*)f->f_code->co_filename)->ob_sval
+x/s ((PyStringObject*)f->f_code->co_name)->ob_sval
+p f->f_lineno
+end