Proposal: Drop GDB support for Python versions < 2.6

Pedro Alves
Thu Feb 21 17:55:00 GMT 2019

If we do this, it'd be good to go over gdb/python/python-internal.h and
remove obsolete workarounds such as:


/* The second argument to PyObject_GetAttrString was missing the 'const'
   qualifier in Python-2.4.  Hence, we wrap it in a function to avoid errors
   when compiled with -Werror.  */

static inline PyObject *
gdb_PyObject_GetAttrString (PyObject *obj,
                            const char *attr) /* ARI: editCase function */
  return PyObject_GetAttrString (obj, (char *) attr);

#define PyObject_GetAttrString(obj, attr) gdb_PyObject_GetAttrString (obj, attr)


/* Python 2.4 doesn't include stdint.h soon enough to get {u,}intptr_t
   needed by pyport.h.  */
/* /usr/include/features.h on linux systems will define _POSIX_C_SOURCE
   if it sees _GNU_SOURCE (which config.h will define).
   pyconfig.h defines _POSIX_C_SOURCE to a different value than
   /usr/include/features.h does causing compilation to fail.
   To work around this, undef _POSIX_C_SOURCE before we include Python.h.

   Same problem with _XOPEN_SOURCE.  */



Pedro Alves

More information about the Gdb mailing list