diff options
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 3d4f7be..20afdee 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -690,7 +690,7 @@ create_procinfo (int pid, int tid) create it if it doesn't exist yet? */ - pi = (procinfo *) xmalloc (sizeof (procinfo)); + pi = XNEW (procinfo); memset (pi, 0, sizeof (procinfo)); pi->pid = pid; pi->tid = tid; @@ -918,7 +918,7 @@ load_syscalls (procinfo *pi) maxcall = syscalls[i].pr_number; pi->num_syscalls = maxcall+1; - pi->syscall_names = xmalloc (pi->num_syscalls * sizeof (char *)); + pi->syscall_names = XNEWVEC (char *, pi->num_syscalls); for (i = 0; i < pi->num_syscalls; i++) pi->syscall_names[i] = NULL; @@ -2490,7 +2490,7 @@ proc_get_LDT_entry (procinfo *pi, int key) /* Allocate space for one LDT entry. This alloc must persist, because we return a pointer to it. */ if (ldt_entry == NULL) - ldt_entry = (struct ssd *) xmalloc (sizeof (struct ssd)); + ldt_entry = XNEW (struct ssd); /* Open the file descriptor for the LDT table. */ sprintf (pathname, "/proc/%d/ldt", pi->pid); @@ -2731,7 +2731,7 @@ proc_update_threads (procinfo *pi) if ((nlwp = proc_get_nthreads (pi)) <= 1) return 1; /* Process is not multi-threaded; nothing to do. */ - prstatus = xmalloc (sizeof (gdb_prstatus_t) * (nlwp + 1)); + prstatus = XNEWVEC (gdb_prstatus_t, nlwp + 1); old_chain = make_cleanup (xfree, prstatus); if (ioctl (pi->ctl_fd, PIOCLSTATUS, prstatus) < 0) @@ -2825,7 +2825,7 @@ proc_update_threads (procinfo *pi) if (nthreads < 2) return 0; /* Nothing to do for 1 or fewer threads. */ - threads = xmalloc (nthreads * sizeof (tid_t)); + threads = XNEWVEC (tid_t, nthreads); if (ioctl (pi->ctl_fd, PIOCTLIST, threads) < 0) proc_error (pi, "procfs: update_threads (PIOCTLIST)", __LINE__); |