Python support in GDB - how does it work?

Asked by Freddie Chopin

I was wondering which option of Python support for GDB did you choose from the list here - https://bugs.launchpad.net/gcc-arm-embedded/+bug/1294231 .

Package for windows (at least the one in .zip format) does not contain any python .dll, so I assume that on Windows the user is responsible for installing the same version of Python that you used, right? Does it have to be exactly the same version, or maybe anythig from 2.x series, maybe the version you used or more recent ones? Maybe it even has to be the package from prebuilt-native-tools.tar.lzma? Does it have to be installed in a specific path in Windows, or maybe anywhere and added to system PATH?

As for the Linux version - from examining the build-toolchain.sh script and browsing through the package mentioned above I think that gdb will load python dynamically, right? So will that work with any version of python, or only with the one you used for the build?

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Freddie Chopin
Solved:
Last query:
Last reply:
Revision history for this message
Tony Wang (wangzheyu1989) said :
#1

Hi,

In the 4.9 readme, I think the following information is quite helpful.

In addition, if you want to use gdb python build (arm-none-eabi-gdb-py), you'd
install 32 bit python2.7. Please refer
https://answers.launchpad.net/gcc-arm-embedded/+faq/2601

To use gdb python build (arm-none-eabi-gdb-py), you need install 32 bit
python2.7 no matter 32 or 64 bit Windows. Please get the package from
https://www.python.org/download/

For the path, I think it just need to be added into system path. It just like you can install your python at anywhere you want, but the path need to be added into the sys path.

Revision history for this message
Freddie Chopin (freddie-chopin) said :
#2

OK, good to know (;

BTW - it seems that producing a 64-bit binary doesn't make much sense at the moment. There is a 64-bit Python package for Windows and it has the libpython27.a library, but x86_64-w64-mingw32 toolchain cannot link it to the final binary (it is said to be "incompatible"). Additionally, this file is suspiciously small... Searching through google gives some results about Python NOT working with this toolchain, so you would actually have to compile whole python yourself and distribute the binary for users. That's why my "bleeding-edge-toolchain" package ( https://sourceforge.net/projects/bleeding-edge/files/ ) doesn't have GDB with Python for 64-bit package - only "standard" version...

If someone has some idea about this 64-bit Windows issue, I'd be happy to hear and test it (;

Thx for help!