2014-06-24 02:48:05 UTC
Recently I'm building gdb with python support, and I noticed that gdb
with python support will heavily depends on the python environment on
the build machine.
So if I give the gdb with python support to other PC, and the python
environment is different from my build machine, the gdb will fail to
launch. Basically, I think python support is not wanted by every user,
but it's a little bit confusing for toolchain maintainer to release
two version of gdb(with and without python). So is it possible to
detect in the gdb, whether the user python environment is ok?(Usually
user will have python, but the library path or version may cause the
gdb fail to launch). If the user do not have the python, then just
disable python function in gdb.
I've noticed a hack patch to do this before, it just test the pyinit
function in a new thread to see if the python environment is ready. Is
such a operation acceptable?