binutils-gdb/gdb/python
Pedro Alves a6e6f79133 Fix build breakage with Python 2.4.
With Python 2.4, we see this build failure:

./python/python-internal.h: In function 'gdb_Py_DECREF':
./python/python-internal.h:179: warning: dereferencing 'void *' pointer
./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union

Python 2.4 forgets to cast 'op' to PyObject pointer on the ob_refcnt
accesses:

  #define Py_DECREF(op)                                   \
          if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
              --(op)->ob_refcnt != 0)                     \
                  _Py_CHECK_REFCNT(op)                    \
          else                                            \
                  _Py_Dealloc((PyObject *)(op))

...

  #define _Py_CHECK_REFCNT(OP)                                    \
  {       if ((OP)->ob_refcnt < 0)                                \
                  _Py_NegativeRefcount(__FILE__, __LINE__,        \
                                       (PyObject *)(OP));         \
  }

Python 2.7:

  #define Py_DECREF(op)                                   \
      do {                                                \
          if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
          --((PyObject*)(op))->ob_refcnt != 0)            \
              _Py_CHECK_REFCNT(op)                        \
          else                                            \
          _Py_Dealloc((PyObject *)(op));                  \
      } while (0)

...

  #define _Py_CHECK_REFCNT(OP)                                    \
  {       if (((PyObject*)OP)->ob_refcnt < 0)                             \
                  _Py_NegativeRefcount(__FILE__, __LINE__,        \
                                       (PyObject *)(OP));         \
  }

gdb/
2013-05-30  Pedro Alves  <palves@redhat.com>

	* python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject
	pointer.
2013-05-30 08:56:56 +00:00
..
lib/gdb
py-arch.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-auto-load.c * python/py-arch.c (gdbpy_initialize_arch): Return 'int'. 2013-05-20 20:28:52 +00:00
py-block.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-bpevent.c * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-breakpoint.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-cmd.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-continueevent.c * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-event.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-event.h * python/py-arch.c (gdbpy_initialize_arch): Return 'int'. 2013-05-20 20:28:52 +00:00
py-events.h * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-evtregistry.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-evts.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-exitedevent.c * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-finishbreakpoint.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-frame.c * ada-lang.c (is_known_support_routine): Add explicit free of 2013-05-22 21:16:18 +00:00
py-framefilter.c
py-function.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-gdb-readline.c * python/py-arch.c (gdbpy_initialize_arch): Return 'int'. 2013-05-20 20:28:52 +00:00
py-inferior.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-infthread.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-lazy-string.c * python/py-arch.c (gdbpy_initialize_arch): Return 'int'. 2013-05-20 20:28:52 +00:00
py-newobjfileevent.c * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-objfile.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-param.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-prettyprint.c py_decref: Don't check for NULL before calling Py_DECREF. 2013-05-21 20:53:21 +00:00
py-progspace.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-signalevent.c * python/py-arch.c (arch_object_type): Use 2013-05-20 20:09:01 +00:00
py-stopevent.c
py-stopevent.h
py-symbol.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-symtab.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
py-threadevent.c * python/py-threadevent.c (get_event_thread): Use 2013-05-20 20:10:03 +00:00
py-type.c * python/py-type.c (typy_fields): Unconditionally decref 'r'. 2013-05-20 20:37:48 +00:00
py-utils.c py_decref: Don't check for NULL before calling Py_DECREF. 2013-05-21 20:53:21 +00:00
py-value.c * python/py-value.c (valpy_get_dynamic_type): Simplify 2013-05-20 20:38:47 +00:00
python-config.py
python-internal.h Fix build breakage with Python 2.4. 2013-05-30 08:56:56 +00:00
python.c * python/py-arch.c (gdbpy_initialize_arch): Use 2013-05-20 20:36:19 +00:00
python.h