diff options
author | Tom Tromey <tromey@redhat.com> | 2011-06-24 19:47:37 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-06-24 19:47:37 +0000 |
commit | ddd49eeec46ac948def99330a62f1ce023a0d356 (patch) | |
tree | e5601b9bfd10ae4594e15548ec966ad1acfdd81f /gdb/python/py-param.c | |
parent | 5998129b54923c51b277ab385fbb619189525098 (diff) | |
download | gdb-ddd49eeec46ac948def99330a62f1ce023a0d356.zip gdb-ddd49eeec46ac948def99330a62f1ce023a0d356.tar.gz gdb-ddd49eeec46ac948def99330a62f1ce023a0d356.tar.bz2 |
* varobj.c (update_dynamic_varobj_children): Make 'name' const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
* python/python.c (gdbpy_parameter): Make 'arg' const.
(execute_gdb_command): Likewise.
(gdbpy_decode_line): Likewise. Copy it.
(gdbpy_parse_and_eval): Make 'expr_string' const. Copy it.
(gdbpy_write): Make 'arg' const.
* python/py-type.c (typy_lookup_typename): Make 'type_name'
const.
(gdbpy_lookup_type): Likewise.
* python/py-prettyprint.c (print_children): Make 'name' const.
* python/py-param.c (parmpy_init): Make 'name' const. Copy it.
* python/py-inferior.c (infpy_write_memory): Make 'buf_len' a
Py_ssize_t.
* python/py-function.c (fnpy_init): Make 'name' const.
* python/py-cmd.c (cmdpy_init): Make 'name' const. Copy it.
(gdbpy_string_to_argv): Make 'input' const.
* python/py-breakpoint.c (bppy_init): Make 'spec' const. Copy
it.
* gdbtypes.h (lookup_typename): Update.
* gdbtypes.c (lookup_typename): Make 'name' const.
(lookup_struct): Likewise.
(lookup_union): Likewise.
(lookup_enum): Likewise.
Diffstat (limited to 'gdb/python/py-param.c')
-rw-r--r-- | gdb/python/py-param.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index 4d873d8..5c726d6 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -645,7 +645,8 @@ static int parmpy_init (PyObject *self, PyObject *args, PyObject *kwds) { parmpy_object *obj = (parmpy_object *) self; - char *name; + const char *name; + char *copy; char *set_doc, *show_doc, *doc; char *cmd_name; int parmclass, cmdtype; @@ -696,16 +697,21 @@ parmpy_init (PyObject *self, PyObject *args, PyObject *kwds) obj->type = (enum var_types) parmclass; memset (&obj->value, 0, sizeof (obj->value)); - cmd_name = gdbpy_parse_command_name (name, &set_list, + copy = xstrdup (name); + cmd_name = gdbpy_parse_command_name (copy, &set_list, &setlist); if (! cmd_name) - return -1; + { + xfree (copy); + return -1; + } xfree (cmd_name); - cmd_name = gdbpy_parse_command_name (name, &show_list, + cmd_name = gdbpy_parse_command_name (copy, &show_list, &showlist); if (! cmd_name) return -1; + xfree (copy); set_doc = get_doc_string (self, set_doc_cst); show_doc = get_doc_string (self, show_doc_cst); |