https://sourceware.org/gdb/current/onlinedocs/gdb/TUI.html
+config BR2_PACKAGE_GDB_PYTHON
+ bool "Python support"
+ # Only Python 2.x is supported by gdb for now
+ depends on BR2_PACKAGE_PYTHON
+ help
+ This option enables Python support in the target gdb.
+
endif
endif
--- /dev/null
+#!/bin/sh
+
+# This shell script is used to fake Python. Gdb wants to be passed a
+# Python interpreter, to run its own python-config.py program, which
+# uses sysconfig. However, when cross-compiling, this doesn't work
+# well since we would have to use the host Python, whose sysconfig
+# module would return host values.
+#
+# As recommended at
+# https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport,
+# this wrapper shell script can be used as a replacement. It ignores
+# the python-config.py script passed as first arguments, and
+# "emulates" its behavior.
+
+if [ $# -ne 2 ] ; then
+ echo "Bad # args." >&2
+ exit 1
+fi
+
+# The first argument is the path to python-config.py, ignore it.
+
+case "$2" in
+ --includes)
+ echo "-I${STAGING_DIR}/usr/include/python2.7"
+ ;;
+ --ldflags)
+ echo "-lpthread -ldl -lutil -lm -lpython2.7"
+ ;;
+ --exec-prefix)
+ echo "/usr"
+ ;;
+ *)
+ echo "Bad arg $2." >&2
+ exit 1
+ ;;
+esac
GDB_CONF_OPT += --disable-tui
endif
+ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
+ GDB_CONF_OPT += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
+ GDB_DEPENDENCIES += python
+else
+ GDB_CONF_OPT += --without-python
+endif
+
# This removes some unneeded Python scripts and XML target description
# files that are not useful for a normal usage of the debugger.
define GDB_REMOVE_UNNEEDED_FILES