aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/inferiors.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/inferiors.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/inferiors.c')
-rw-r--r--gdb/gdbserver/inferiors.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index f35cfa0..be94629 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -95,7 +95,7 @@ remove_inferior (struct inferior_list *list,
void
add_thread (unsigned long thread_id, void *target_data, unsigned int gdb_id)
{
- struct thread_info *new_thread = malloc (sizeof (*new_thread));
+ struct thread_info *new_thread = xmalloc (sizeof (*new_thread));
memset (new_thread, 0, sizeof (*new_thread));
@@ -261,12 +261,12 @@ match_dll (struct inferior_list_entry *inf, void *arg)
void
loaded_dll (const char *name, CORE_ADDR base_addr)
{
- struct dll_info *new_dll = malloc (sizeof (*new_dll));
+ struct dll_info *new_dll = xmalloc (sizeof (*new_dll));
memset (new_dll, 0, sizeof (*new_dll));
new_dll->entry.id = -1;
- new_dll->name = strdup (name);
+ new_dll->name = xstrdup (name);
new_dll->base_addr = base_addr;
add_inferior_to_list (&all_dlls, &new_dll->entry);
@@ -314,7 +314,7 @@ add_pid_to_list (struct inferior_list *list, unsigned long pid)
{
struct inferior_list_entry *new_entry;
- new_entry = malloc (sizeof (struct inferior_list_entry));
+ new_entry = xmalloc (sizeof (struct inferior_list_entry));
new_entry->id = pid;
add_inferior_to_list (list, new_entry);
}