aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-inferior.c2
-rw-r--r--gdb/python/py-param.c3
-rw-r--r--gdb/python/py-value.c2
-rw-r--r--gdb/python/py-varobj.c2
-rw-r--r--gdb/python/python.c2
5 files changed, 5 insertions, 6 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index fe8a705..3cfa1d5 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -332,7 +332,7 @@ add_thread_object (struct thread_info *tp)
inf_obj = (inferior_object *) thread_obj->inf_obj;
- entry = xmalloc (sizeof (struct threadlist_entry));
+ entry = XNEW (struct threadlist_entry);
entry->thread_obj = thread_obj;
entry->next = inf_obj->threads;
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 06b9ae9..dcc110f 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -594,9 +594,8 @@ compute_enum_values (parmpy_object *self, PyObject *enum_values)
return 0;
}
- self->enumeration = xmalloc ((size + 1) * sizeof (char *));
+ self->enumeration = XCNEWVEC (const char *, size + 1);
back_to = make_cleanup (free_current_contents, &self->enumeration);
- memset (self->enumeration, 0, (size + 1) * sizeof (char *));
for (i = 0; i < size; ++i)
{
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index ec26bc8..ac6b224 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -858,7 +858,7 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
{
int i;
- vargs = alloca (sizeof (struct value *) * args_count);
+ vargs = XALLOCAVEC (struct value *, args_count);
for (i = 0; i < args_count; i++)
{
PyObject *item = PyTuple_GetItem (args, i);
diff --git a/gdb/python/py-varobj.c b/gdb/python/py-varobj.c
index ec44d56..57f8267 100644
--- a/gdb/python/py-varobj.c
+++ b/gdb/python/py-varobj.c
@@ -113,7 +113,7 @@ py_varobj_iter_next (struct varobj_iter *self)
error (_("Invalid item from the child list"));
}
- vitem = xmalloc (sizeof *vitem);
+ vitem = XNEW (struct varobj_item);
vitem->value = convert_value_from_python (py_v);
if (vitem->value == NULL)
gdbpy_print_stack ();
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 14da62c..3a33c75 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -248,7 +248,7 @@ struct cleanup *
ensure_python_env (struct gdbarch *gdbarch,
const struct language_defn *language)
{
- struct python_env *env = xmalloc (sizeof *env);
+ struct python_env *env = XNEW (struct python_env);
/* We should not ever enter Python unless initialized. */
if (!gdb_python_initialized)