aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-thread-db.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r--gdb/linux-thread-db.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 84599d3..d6bf56f 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -211,9 +211,8 @@ static void record_thread (struct thread_db_info *info,
static struct thread_db_info *
add_thread_db_info (void *handle)
{
- struct thread_db_info *info;
+ struct thread_db_info *info = XCNEW (struct thread_db_info);
- info = xcalloc (1, sizeof (*info));
info->pid = ptid_get_pid (inferior_ptid);
info->handle = handle;
@@ -1308,8 +1307,7 @@ record_thread (struct thread_db_info *info,
return;
/* Construct the thread's private data. */
- priv = xmalloc (sizeof (struct private_thread_info));
- memset (priv, 0, sizeof (struct private_thread_info));
+ priv = XCNEW (struct private_thread_info);
priv->th = *th_p;
priv->tid = ti_p->ti_tid;
@@ -1998,7 +1996,7 @@ info_auto_load_libthread_db (char *args, int from_tty)
if (info->filename != NULL)
info_count++;
- array = xmalloc (sizeof (*array) * info_count);
+ array = XNEWVEC (struct thread_db_info *, info_count);
back_to = make_cleanup (xfree, array);
info_count = 0;