bootlin / toolchains-builder

http://toolchains.free-electrons.com
89 stars 27 forks source link

enable Python support in GDB #5

Closed slightlyunconventional closed 2 years ago

slightlyunconventional commented 6 years ago

The aarch64--glibc--stable gdb says:

(gdb) python
>end
Scripting in the "Python" language is not supported in this copy of GDB.

There are some pretty important tools distributed as GDB Python scripts, such as Linux's gdb scripts (including dmesg dumper), and this one-off debug a relocated executable script.

Please enable Python support in GDB. Thanks!

slightlyunconventional commented 6 years ago

This change works for me:

--- aarch64--glibc--bleeding-edge-2017.11-1.defconfig.orig      2018-02-20 17:28:52.567018000 -0800
+++ aarch64--glibc--bleeding-edge-2017.11-1.defconfig   2018-02-20 17:28:56.780343000 -0800
@@ -8,6 +8,7 @@
 BR2_GCC_VERSION_7_X=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 BR2_PACKAGE_HOST_GDB=y
+BR2_PACKAGE_HOST_GDB_PYTHON=y
 BR2_GDB_VERSION_8_0=y
 BR2_INIT_NONE=y
 # BR2_PACKAGE_BUSYBOX is not set

The same config option can be enabled for the "stable" (2017.05) toolchain, but I can understand if you only want to enable new features in a future release.

slightlyunconventional commented 6 years ago

Patch for toolchains-builder.git:

config: enable host-gdb's Python interpreter

There are some pretty important tools distributed as GDB Python scripts, such
as Linux's gdb scripts (including dmesg dumper).

Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>

diff --git a/configs/optionals/*.config b/configs/optionals/*.config
--- a/configs/optionals/*.config
+++ b/configs/optionals/*.config
@@ -1,2 +1,3 @@
 BR2_PACKAGE_HOST_GDB=y
+BR2_PACKAGE_HOST_GDB_PYTHON=y
 BR2_PACKAGE_GDB=y

@tpetazzoni, would you apply it?

zkrx commented 2 years ago

Any chance to see this patch applied? Unfortunately, I cannot use any bootlin toolchain because I need python support in GDB.

tpetazzoni commented 2 years ago

Fixed by e304245b7078be738596fe6fb2c1de3aabb2394a