aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
committerDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
commitbca929d3a66489b6b2aff2a9a81bc17853dff79e (patch)
tree01fb0fc214848cab8a2629b58956f92238f7edf5 /gdb/gdbserver/linux-low.c
parent023eb17ca2bc152be687b0b5676bdb6fda6cd9d1 (diff)
downloadgdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.zip
gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.gz
gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.bz2
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro. (xmalloc,xcalloc,xstrdup): Declare. * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup. * inferiors.c: Ditto. * linux-low.c: Ditto. * mem-break.c: Ditto. * regcache.c: Ditto. * remote-utils.c: Ditto. * server.c: Ditto. * target.c: Ditto. * win32-low.c: Ditto.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 24ac484..120656a 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -249,7 +249,7 @@ add_process (unsigned long pid)
{
struct process_info *process;
- process = (struct process_info *) malloc (sizeof (*process));
+ process = (struct process_info *) xmalloc (sizeof (*process));
memset (process, 0, sizeof (*process));
process->head.id = pid;
@@ -1120,7 +1120,7 @@ linux_resume_one_process (struct inferior_list_entry *entry,
|| process->bp_reinsert != 0))
{
struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
+ p_sig = xmalloc (sizeof (*p_sig));
p_sig->prev = process->pending_signals;
p_sig->signal = signal;
if (info == NULL)
@@ -1291,7 +1291,7 @@ linux_queue_one_thread (struct inferior_list_entry *entry)
if (process->resume->sig != 0)
{
struct pending_signals *p_sig;
- p_sig = malloc (sizeof (*p_sig));
+ p_sig = xmalloc (sizeof (*p_sig));
p_sig->prev = process->pending_signals;
p_sig->signal = process->resume->sig;
memset (&p_sig->info, 0, sizeof (siginfo_t));
@@ -1527,7 +1527,7 @@ regsets_fetch_inferior_registers ()
continue;
}
- buf = malloc (regset->size);
+ buf = xmalloc (regset->size);
#ifndef __sparc__
res = ptrace (regset->get_request, inferior_pid, 0, buf);
#else
@@ -1580,7 +1580,7 @@ regsets_store_inferior_registers ()
continue;
}
- buf = malloc (regset->size);
+ buf = xmalloc (regset->size);
/* First fill the buffer with the current register set contents,
in case there are any items in the kernel's regset that are
@@ -1832,7 +1832,7 @@ linux_test_for_tracefork (void)
{
int child_pid, ret, status;
long second_pid;
- char *stack = malloc (STACK_SIZE * 4);
+ char *stack = xmalloc (STACK_SIZE * 4);
linux_supports_tracefork_flag = 0;
@@ -2212,6 +2212,6 @@ initialize_low (void)
#ifdef HAVE_LINUX_REGSETS
for (num_regsets = 0; target_regsets[num_regsets].size >= 0; num_regsets++)
;
- disabled_regsets = malloc (num_regsets);
+ disabled_regsets = xmalloc (num_regsets);
#endif
}