5

The configure script was launched like

./configure --with-python=yes  --host=arm-linux-gnueabi

So, the python is enabled. Also in the log of configure script I didn't found anything bad related to the python. But anyway, the compiled gdb keep saying

$ ./gdb -q
/home/constantine/.gdbinit:7: Error in sourced command file:
ind_string_in_backtrace (gdb.Function)::1: Error in sourced command file:
Undefined command: "class".  Try "help".
(gdb) py print("hello")
Python scripting is not supported in this copy of GDB.

The error you can see after I entered in gdb is also about Python (the script that loaded on autostart). I did tried make clean, but it didn't helped. I hope someone knows the solution, I am really need a scripting, and hence the python.

1 Answer 1

2

You are probably missing python development libraries (python-dev package or variations on Ubuntu, python-devel on CentOS) on your build machine.

When configuring gdb there is no mention of python in top level config log of gdb.

Try building like this:

make 1> out.log 2> err.log
Then search for python in out.log. You should see something like this, to get working python scripting.

checking whether to use python... auto
checking for python... /usr/bin/python
checking for python2.7... yes
checking compiler flags for python code...  -fno-strict-aliasing -DNDEBUG -fwrapv
checking whether python supports threads... yes
Sign up to request clarification or add additional context in comments.

5 Comments

Didn't worked ☹ I am installed a python packages, and from what I see in the output it is actually compiled some files for a python support. But after I'm launch it, it is still keeps talking Python scripting is not supported in this copy of GDB.. In the err.log was just two lines «Creating observer.htmp Creating observer.itmp» which, as it looks to me, appeared there just accidentally.
Can you post relevant lines from out.log?
I am leaved a link pastebin.com/gSeSDAEX in the above comment ☺ Anyway, I'm at the moment striving with the fact that gdb refused to compile at all after some recompiling and cleaning.
That is not complete rebuild. Try make distclean or just rm object directory (or start using separate build directory: ../gdb-source-dir/configure --prefix=/your/install/dir etc).
Finally I did it. With the help of IRC. Your answer also important as I hadn't python dev files. But I'll also sum up what was needed to do for someone else: at first I had a typo: in the options I should write «target» instead of «host». Also it is important to configure'n'build everything in the root directory of sources. I suppose an option make no a sense since you'd anyway set it in the gdb/ subdirectory. And the last: for unknown reasons compiling may fail with missing the «version.c» file. You have to copy gdb/version.c-tmp to gdb/version.c. Feelling like a warrior from crusade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.