-/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
This file is part of GDB.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "dll.h"
#define get_dll(inf) ((struct dll_info *)(inf))
+/* An "unspecified" CORE_ADDR, for match_dll. */
+#define UNSPECIFIED_CORE_ADDR (~(CORE_ADDR) 0)
+
struct inferior_list all_dlls;
int dlls_changed;
static int
match_dll (struct inferior_list_entry *inf, void *arg)
{
- struct dll_info *iter = (void *) inf;
- struct dll_info *key = arg;
+ struct dll_info *iter = (struct dll_info *) inf;
+ struct dll_info *key = (struct dll_info *) arg;
- if (key->base_addr != ~(CORE_ADDR) 0
+ if (key->base_addr != UNSPECIFIED_CORE_ADDR
&& iter->base_addr == key->base_addr)
return 1;
else if (key->name != NULL
void
loaded_dll (const char *name, CORE_ADDR base_addr)
{
- struct dll_info *new_dll = xmalloc (sizeof (*new_dll));
- memset (new_dll, 0, sizeof (*new_dll));
+ struct dll_info *new_dll = XCNEW (struct dll_info);
new_dll->entry.id = minus_one_ptid;
key_dll.name = (char *) name;
key_dll.base_addr = base_addr;
- dll = (void *) find_inferior (&all_dlls, match_dll, &key_dll);
+ dll = (struct dll_info *) find_inferior (&all_dlls, match_dll, &key_dll);
if (dll == NULL)
/* For some inferiors we might get unloaded_dll events without having
clear_dlls (void)
{
for_each_inferior (&all_dlls, free_one_dll);
- all_dlls.head = all_dlls.tail = NULL;
+ clear_inferior_list (&all_dlls);
}