Timothy Madden wrote:
Hello
[...]

Can I get the python stack trace working under gdb ?
[...]

Ok I found some other gdb macros on linked from the wiki page and I had to change them to get the stack trace work.

I had to change the symbol PyEval_EvalFrame to PyEval_EvalFrameEx and then I could see the stack trace. The resulting gdb macro was:

define pbt
 set $i = 0
 set $j = 0
 while $i < 1000
  select $i
  if $eip >= &PyEval_EvalFrameEx
   if $eip < &PyEval_EvalCodeEx
    echo c frame #
    p $i
    echo py frame #
    p $j
    set $j = $j+1
    x/s ((PyStringObject*)f->f_code->co_filename)->ob_sval
    x/s ((PyStringObject*)f->f_code->co_name)->ob_sval
    echo line #
    p f->f_lineno
   end
  end
  set $i = $i+1
 end
end
document pbt
show python backtrace
end

Thank you,
Timothy Madden
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to