Problem using py-bt, py-locals, etc. during GDB debugging

M

Mark Shroyer

I'm having trouble with the py-bt, py-locals, etc. GDB commands (from
Python's python-gdb.py) while using GDB 7.4 to debug Python 2.7.3; I was
wondering if anyone here could offer advice.

Briefly, py-bt seems to identify the python stack frames correctly, but
shows "(unable to read python frame information)" for each, and likewise
py-locals fails with "Unable to read information on python frame".

The full GDB session is shown here:

https://gist.github.com/4228342#file_gdb_output.txt

My test script is as follows:

from __future__ import print_function
from os import kill, getpid
from signal import SIGINT

def factorial(n):
if n == 0:
# Break into GDB
kill(getpid(), SIGINT)
return 1
else:
return n * factorial(n-1)

if __name__ == "__main__":
n = 10
print("factorial({0}) = {1}".format(n, factorial(n)))

And I'm seeing this with both the following sets of software:

1. Ubuntu 12.04's python-dbg 2.7.3 and GDB 7.4 packages

2. Freshly-built copies of GDB 7.5 and Python 2.7.3 (the latter built
with -O0 -g3 in Ubuntu's GCC 4.6.3), after loading that Python's own
copy of python-gdb.py into GDB.

Any ideas? Thanks...
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top