Can python scripting be enabled in gdb?

Asked by Matthew Peddie

Is there any reason not to enable python scripting (--with-python) in arm-none-eabi-gdb? I see

  (gdb) python print 2 + 3
  Python scripting is not supported in this copy of GDB.

This would be very useful if it doesn't cause problems.

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Terry Guo
Solved:
Last query:
Last reply:
Revision history for this message
Best Terry Guo (terry.guo) said :
#1

The reason to disable python support in GDB is to avoid lib dependence on Python. So the released tool chain can work on more platforms like RHEL4. If you need such support, I think you can rebuild gdb with proper configure option. The build of gdb is pretty independent and can be accomplished in a short time. The tool chain source package and build manual are all in this website, you can start from them.

Revision history for this message
Matthew Peddie (mpeddie+launchpad) said :
#2

Thanks Terry Guo, that solved my question.

Revision history for this message
Kenz Dale (kenn-7) said :
#3

Could specific instructions for building this be provided? Some tools are moving in the direction of only supporting gdb that has python scripting enabled, and so if a version with python support cannot be added it would be nice to have a simplified list of commands to build it locally.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#4

Sorry for the delay. Building gdb with python support should be done by passing --with-python to the configure script. So if you follow the How-to-build-toolchain.pdf document, you should remove the "=no" in the line containing --with-python=no shortly after the line $SRCDIR/$GDB/configure.

Let us know if you have any trouble.

Best regards.