Commit 3a9ccee0 authored by Marcel Plch's avatar Marcel Plch Committed by Ned Deily

bpo-29673: fix gdb scripts pystack and pystackv (GH-6126)

parent 1d87c7b8
...@@ -1250,6 +1250,7 @@ Zero Piraeus ...@@ -1250,6 +1250,7 @@ Zero Piraeus
Antoine Pitrou Antoine Pitrou
Jean-François Piéronne Jean-François Piéronne
Oleg Plakhotnyuk Oleg Plakhotnyuk
Marcel Plch
Remi Pointel Remi Pointel
Jon Poler Jon Poler
Ariel Poliak Ariel Poliak
......
...@@ -42,8 +42,8 @@ define pylocals ...@@ -42,8 +42,8 @@ define pylocals
set $_i = 0 set $_i = 0
while $_i < f->f_code->co_nlocals while $_i < f->f_code->co_nlocals
if f->f_localsplus + $_i != 0 if f->f_localsplus + $_i != 0
set $_names = co->co_varnames set $_names = f->f_code->co_varnames
set $_name = _PyUnicode_AsString(PyTuple_GetItem($_names, $_i)) set $_name = PyUnicode_AsUTF8(PyTuple_GetItem($_names, $_i))
printf "%s:\n", $_name printf "%s:\n", $_name
pyo f->f_localsplus[$_i] pyo f->f_localsplus[$_i]
end end
...@@ -84,8 +84,8 @@ define pyframev ...@@ -84,8 +84,8 @@ define pyframev
end end
define pyframe define pyframe
set $__fn = _PyUnicode_AsString(co->co_filename) set $__fn = PyUnicode_AsUTF8(f->f_code->co_filename)
set $__n = _PyUnicode_AsString(co->co_name) set $__n = PyUnicode_AsUTF8(f->f_code->co_name)
printf "%s (", $__fn printf "%s (", $__fn
lineno lineno
printf "): %s\n", $__n printf "): %s\n", $__n
...@@ -110,7 +110,7 @@ end ...@@ -110,7 +110,7 @@ end
#end #end
define printframe define printframe
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
pyframe pyframe
else else
frame frame
...@@ -139,7 +139,7 @@ document pystack ...@@ -139,7 +139,7 @@ document pystack
end end
define pystack define pystack
while $pc < Py_Main || $pc > Py_GetArgcArgv while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
pyframe pyframe
end end
up-silently 1 up-silently 1
...@@ -152,7 +152,7 @@ document pystackv ...@@ -152,7 +152,7 @@ document pystackv
end end
define pystackv define pystackv
while $pc < Py_Main || $pc > Py_GetArgcArgv while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
pyframev pyframev
end end
up-silently 1 up-silently 1
......
...@@ -3661,7 +3661,7 @@ too_many_positional(PyCodeObject *co, Py_ssize_t given, Py_ssize_t defcount, ...@@ -3661,7 +3661,7 @@ too_many_positional(PyCodeObject *co, Py_ssize_t given, Py_ssize_t defcount,
} }
/* This is gonna seem *real weird*, but if you put some other code between /* This is gonna seem *real weird*, but if you put some other code between
PyEval_EvalFrame() and PyEval_EvalCodeEx() you will need to adjust PyEval_EvalFrame() and _PyEval_EvalFrameDefault() you will need to adjust
the test in the if statements in Misc/gdbinit (pystack and pystackv). */ the test in the if statements in Misc/gdbinit (pystack and pystackv). */
PyObject * PyObject *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment