diff options
Diffstat (limited to 'gdb/python/py-inferior.c')
-rw-r--r-- | gdb/python/py-inferior.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 77fc543..4b43c54 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -435,10 +435,10 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw) CORE_ADDR addr, length; gdb_byte *buffer = NULL; PyObject *addr_obj, *length_obj, *result; - static char *keywords[] = { "address", "length", NULL }; + static const char *keywords[] = { "address", "length", NULL }; - if (! PyArg_ParseTupleAndKeywords (args, kw, "OO", keywords, - &addr_obj, &length_obj)) + if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "OO", keywords, + &addr_obj, &length_obj)) return NULL; if (get_addr_from_python (addr_obj, &addr) < 0 @@ -494,21 +494,20 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw) const gdb_byte *buffer; CORE_ADDR addr, length; PyObject *addr_obj, *length_obj = NULL; - static char *keywords[] = { "address", "buffer", "length", NULL }; + static const char *keywords[] = { "address", "buffer", "length", NULL }; #ifdef IS_PY3K Py_buffer pybuf; - if (! PyArg_ParseTupleAndKeywords (args, kw, "Os*|O", keywords, - &addr_obj, &pybuf, - &length_obj)) + if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "Os*|O", keywords, + &addr_obj, &pybuf, &length_obj)) return NULL; buffer = (const gdb_byte *) pybuf.buf; buf_len = pybuf.len; #else - if (! PyArg_ParseTupleAndKeywords (args, kw, "Os#|O", keywords, - &addr_obj, &buffer, &buf_len, - &length_obj)) + if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "Os#|O", keywords, + &addr_obj, &buffer, &buf_len, + &length_obj)) return NULL; buffer = (const gdb_byte *) buffer; @@ -643,7 +642,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw) { struct gdb_exception except = exception_none; CORE_ADDR start_addr, length; - static char *keywords[] = { "address", "length", "pattern", NULL }; + static const char *keywords[] = { "address", "length", "pattern", NULL }; PyObject *start_addr_obj, *length_obj; Py_ssize_t pattern_size; const gdb_byte *buffer; @@ -652,9 +651,9 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw) #ifdef IS_PY3K Py_buffer pybuf; - if (! PyArg_ParseTupleAndKeywords (args, kw, "OOs*", keywords, - &start_addr_obj, &length_obj, - &pybuf)) + if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "OOs*", keywords, + &start_addr_obj, &length_obj, + &pybuf)) return NULL; buffer = (const gdb_byte *) pybuf.buf; @@ -663,9 +662,9 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw) PyObject *pattern; const void *vbuffer; - if (! PyArg_ParseTupleAndKeywords (args, kw, "OOO", keywords, - &start_addr_obj, &length_obj, - &pattern)) + if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "OOO", keywords, + &start_addr_obj, &length_obj, + &pattern)) return NULL; if (!PyObject_CheckReadBuffer (pattern)) |