-Wwrite-strings: More fix-old-Python-API wrappers
authorPedro Alves <palves@redhat.com>
Wed, 5 Apr 2017 18:21:35 +0000 (19:21 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 5 Apr 2017 18:21:35 +0000 (19:21 +0100)
commit4d75997912d77497fd395fde222513436a7df046
tree1e4d20c61eb87f144dbee57e83f677b2b43e09ce
parent21c8a587ab81a58d3e067551d5503a765f00ec6e
-Wwrite-strings: More fix-old-Python-API wrappers

When building against Python 2.7, -Wwrite-strings flags several cases
of passing a string literal to Python functions that expect a "char
*".  This commit addresses the issue like we already handle several
other similar cases -- wrap the Python API with our own fixed
version that adds the necessary constification.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

* python/python-internal.h (gdb_PyObject_CallMethod)
(gdb_PyErr_NewException, gdb_PySys_GetObject, gdb_PySys_SetPath):
New functions.
(GDB_PYSYS_SETPATH_CHAR, PyObject_CallMethod, PyErr_NewException)
(PySys_GetObject, PySys_SetPath): New macros.
gdb/ChangeLog
gdb/python/python-internal.h