From: Jeremy Hylton Date: Fri, 3 Oct 2003 20:56:15 +0000 (+0000) Subject: A helper to dump info about the current frame, X-Git-Tag: v2.4a1~1467 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f64ec0f2a1048fde833cb81f1ee199d0d2b507ac;p=python A helper to dump info about the current frame, assuming it is the variable f. --- diff --git a/Misc/gdbinit b/Misc/gdbinit index ae333b2686..05f6a9151c 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