aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c4
-rw-r--r--gdb/python/py-cmd.c10
-rw-r--r--gdb/python/py-event.c4
-rw-r--r--gdb/python/py-event.h4
-rw-r--r--gdb/python/py-evts.c2
-rw-r--r--gdb/python/py-finishbreakpoint.c2
-rw-r--r--gdb/python/py-framefilter.c2
-rw-r--r--gdb/python/py-inferior.c5
-rw-r--r--gdb/python/py-param.c2
-rw-r--r--gdb/python/py-unwind.c2
-rw-r--r--gdb/python/python.c2
11 files changed, 21 insertions, 18 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index a08501e..6bf517c 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -41,7 +41,7 @@ static int bppy_live;
gdbpy_breakpoint_object *bppy_pending_object;
/* Function that is called when a Python condition is evaluated. */
-static char * const stop_func = "stop";
+static const char stop_func[] = "stop";
/* This is used to initialize various gdb.bp_* constants. */
struct pybp_code
@@ -400,7 +400,7 @@ bppy_get_location (PyObject *self, void *closure)
static PyObject *
bppy_get_expression (PyObject *self, void *closure)
{
- char *str;
+ const char *str;
gdbpy_breakpoint_object *obj = (gdbpy_breakpoint_object *) self;
struct watchpoint *wp;
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 3e60673..6203211 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -32,10 +32,8 @@
/* Struct representing built-in completion types. */
struct cmdpy_completer
{
- /* Python symbol name.
- This isn't a const char * for Python 2.4's sake.
- PyModule_AddIntConstant only takes a char *, sigh. */
- char *name;
+ /* Python symbol name. */
+ const char *name;
/* Completion function. */
completer_ftype *completer;
};
@@ -111,8 +109,10 @@ cmdpy_destroyer (struct cmd_list_element *self, void *context)
/* Called by gdb to invoke the command. */
static void
-cmdpy_function (struct cmd_list_element *command, char *args, int from_tty)
+cmdpy_function (struct cmd_list_element *command,
+ char *args_entry, int from_tty)
{
+ const char *args = args_entry;
cmdpy_object *obj = (cmdpy_object *) get_cmd_context (command);
gdbpy_enter enter_py (get_current_arch (), current_language);
diff --git a/gdb/python/py-event.c b/gdb/python/py-event.c
index dc1d73e..b349891 100644
--- a/gdb/python/py-event.c
+++ b/gdb/python/py-event.c
@@ -47,7 +47,7 @@ create_event_object (PyTypeObject *py_type)
function acquires a new reference to ATTR. */
int
-evpy_add_attribute (PyObject *event, char *name, PyObject *attr)
+evpy_add_attribute (PyObject *event, const char *name, PyObject *attr)
{
return PyObject_SetAttrString (event, name, attr);
}
@@ -67,7 +67,7 @@ gdbpy_initialize_event (void)
int
gdbpy_initialize_event_generic (PyTypeObject *type,
- char *name)
+ const char *name)
{
if (PyType_Ready (type) < 0)
return -1;
diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h
index 4b2f4c0..ccb8513 100644
--- a/gdb/python/py-event.h
+++ b/gdb/python/py-event.h
@@ -131,9 +131,9 @@ extern int emit_clear_objfiles_event (void);
extern void evpy_dealloc (PyObject *self);
extern int evpy_add_attribute (PyObject *event,
- char *name, PyObject *attr)
+ const char *name, PyObject *attr)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
-int gdbpy_initialize_event_generic (PyTypeObject *type, char *name)
+int gdbpy_initialize_event_generic (PyTypeObject *type, const char *name)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
#endif /* GDB_PY_EVENT_H */
diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c
index 4766bd6..126d18c 100644
--- a/gdb/python/py-evts.c
+++ b/gdb/python/py-evts.c
@@ -38,7 +38,7 @@ static struct PyModuleDef EventModuleDef =
/* Initialize python events. */
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
-add_new_registry (eventregistry_object **registryp, char *name)
+add_new_registry (eventregistry_object **registryp, const char *name)
{
*registryp = create_eventregistry_object ();
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index 06f6ff9..797ca84 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -33,7 +33,7 @@
#include "py-ref.h"
/* Function that is called when a Python finish bp is found out of scope. */
-static char * const outofscope_func = "out_of_scope";
+static const char outofscope_func[] = "out_of_scope";
/* struct implementing the gdb.FinishBreakpoint object by extending
the gdb.Breakpoint class. */
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 6db4aab..75b055c 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -301,7 +301,7 @@ py_print_value (struct ui_out *out, struct value *val,
This function can return an iterator, or NULL. */
static PyObject *
-get_py_iter_from_func (PyObject *filter, char *func)
+get_py_iter_from_func (PyObject *filter, const char *func)
{
if (PyObject_HasAttrString (filter, func))
{
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 4b43c54..3d2cb1d 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -576,7 +576,10 @@ get_buffer (PyObject *self, Py_buffer *buf, int flags)
ret = PyBuffer_FillInfo (buf, self, membuf_obj->buffer,
membuf_obj->length, 0,
PyBUF_CONTIG);
- buf->format = "c";
+
+ /* Despite the documentation saying this field is a "const char *",
+ in Python 3.4 at least, it's really a "char *". */
+ buf->format = (char *) "c";
return ret;
}
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index d80b731..f0d3423 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -32,7 +32,7 @@
/* Parameter constants and their values. */
struct parm_constant
{
- char *name;
+ const char *name;
int value;
};
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index b7821b5..a5c2873 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -204,7 +204,7 @@ unwind_infopy_str (PyObject *self)
stb.puts ("Frame ID: ");
fprint_frame_id (&stb, unwind_info->frame_id);
{
- char *sep = "";
+ const char *sep = "";
int i;
struct value_print_options opts;
saved_reg *reg;
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 25f475f..cc58267 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -457,7 +457,7 @@ gdbpy_parameter_value (enum var_types type, void *var)
case var_filename:
case var_enum:
{
- char *str = * (char **) var;
+ const char *str = *(char **) var;
if (! str)
str = "";