Python and native gdb

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Python and native gdb

electricworry
Please could anyone advise, is it possible to build a Python enabled
Native GDB similar to the Cross GDB option that exists in
crosstool-ng?

I've made a small change to 300-gdb.sh to add --with-python=python2
for the native GDB build and I'm testing just now, so I guess I'll
find out later today. But I'm thinking it's less trivial than that and
there might be some extra work to be done. Am I right to be sceptical?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Python and native gdb

Alexey Neyman
You'd need to have the Python libraries built for target first and a
special script as explained in gdb/configure.ac's description of
--with-python:

dnl There are several different values for --with-python:
....
dnl /path/to/python/executable -
dnl        Run python-config.py with this version of python to fetch the
dnl        compilation parameters.
dnl        NOTE: This needn't be the real python executable.
dnl        In a cross-compilation scenario (build != host), this could be
dnl        a shell script that provides what python-config.py provides for
dnl        --ldflags, --includes, --exec-prefix.

Crosstool-NG currently doesn't do that.

Regards,
Alexey.


On 10/20/2017 03:48 AM, electricworry wrote:

> Please could anyone advise, is it possible to build a Python enabled
> Native GDB similar to the Cross GDB option that exists in
> crosstool-ng?
>
> I've made a small change to 300-gdb.sh to add --with-python=python2
> for the native GDB build and I'm testing just now, so I guess I'll
> find out later today. But I'm thinking it's less trivial than that and
> there might be some extra work to be done. Am I right to be sceptical?
>
> Thanks.
>