Eliminate some uses of __STDC__.
[deliverable/binutils-gdb.git] / gdb / windows-nat.c
index 62db43fb62d2417c9c2f96052ae1bf804b74c7f1..f0d97fa6f2603b1303cbe2890d6f83394226d0d3 100644 (file)
@@ -1,5 +1,6 @@
 /* Target-vector operations for controlling win32 child processes, for GDB.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
    Contributed by Cygnus Solutions, A Red Hat Company.
 
    This file is part of GDB.
@@ -17,8 +18,7 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
- */
+   Boston, MA 02111-1307, USA.  */
 
 /* by Steve Chamberlain, sac@cygnus.com */
 
@@ -30,6 +30,8 @@
 #include "target.h"
 #include "gdbcore.h"
 #include "command.h"
+#include "completer.h"
+#include "regcache.h"
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -249,7 +251,7 @@ child_init_thread_list (void)
       thread_info *here = th->next;
       th->next = here->next;
       (void) CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -273,7 +275,7 @@ child_delete_thread (DWORD id)
       thread_info *here = th->next;
       th->next = here->next;
       CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -514,7 +516,7 @@ register_loaded_dll (const char *name, DWORD load_addr)
 /* Wait for child to do something.  Return pid of child, or -1 in case
    of error; store status through argument pointer OURSTATUS.  */
 static int
-handle_load_dll (PTR dummy ATTRIBUTE_UNUSED)
+handle_load_dll (void *dummy ATTRIBUTE_UNUSED)
 {
   LOAD_DLL_DEBUG_INFO *event = &current_event.u.LoadDll;
   DWORD dll_name_ptr;
@@ -619,7 +621,7 @@ child_clear_solibs (void)
   while ((so = so1) != NULL)
     {
       so1 = so->next;
-      free (so);
+      xfree (so);
     }
 
   solib_start.next = NULL;
@@ -715,7 +717,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
        ourstatus->kind = TARGET_WAITKIND_STOPPED;
     }
 
-  free (s);
+  xfree (s);
   return gotasig;
 }
 
@@ -1228,7 +1230,8 @@ child_stop (void)
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *our, int len,
-                  int write, struct target_ops *target ATTRIBUTE_UNUSED)
+                  int write, struct mem_attrib *mem ATTRIBUTE_UNUSED,
+                  struct target_ops *target ATTRIBUTE_UNUSED)
 {
   DWORD done;
   if (write)
@@ -1376,10 +1379,13 @@ init_child_ops (void)
 void
 _initialize_inftarg (void)
 {
+  struct cmd_list_element *c;
+
   init_child_ops ();
 
-  add_com ("dll-symbols", class_files, dll_symbol_command,
-          "Load dll library symbols from FILE.");
+  c = add_com ("dll-symbols", class_files, dll_symbol_command,
+              "Load dll library symbols from FILE.");
+  c->completer = filename_completer;
 
   auto_solib_add = 1;
   add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
@@ -1488,7 +1494,7 @@ typedef struct
 map_code_section_args;
 
 static void
-map_single_dll_code_section (bfd * abfd, asection * sect, PTR obj)
+map_single_dll_code_section (bfd * abfd, asection * sect, void *obj)
 {
   int old;
   int update_coreops;
@@ -1540,7 +1546,7 @@ dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *t
   char *name;
   if (dll_name == NULL || target == NULL)
     return 0;
-  name = strdup (dll_name);
+  name = xstrdup (dll_name);
   dll_bfd = bfd_openr (name, "pei-i386");
   if (dll_bfd == NULL)
     return 0;
@@ -1553,14 +1559,14 @@ dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *t
       map_args.target = target;
       map_args.addr = base_addr - bfd_section_vma (dll_bfd, lowest_sect);
 
-      bfd_map_over_sections (dll_bfd, &map_single_dll_code_section, (PTR) (&map_args));
+      bfd_map_over_sections (dll_bfd, &map_single_dll_code_section, (void *) (&map_args));
     }
 
   return 1;
 }
 
 static void
-core_section_load_dll_symbols (bfd * abfd, asection * sect, PTR obj)
+core_section_load_dll_symbols (bfd * abfd, asection * sect, void *obj)
 {
   struct target_ops *target = (struct target_ops *) obj;
 
@@ -1610,9 +1616,9 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, PTR obj)
 
 out:
   if (buf)
-    free (buf);
+    xfree (buf);
   if (dll_name)
-    free (dll_name);
+    xfree (dll_name);
   return;
 }
 
@@ -1657,7 +1663,7 @@ static struct core_fns win32_elf_core_fns =
 };
 
 void
-_initialize_core_win32 ()
+_initialize_core_win32 (void)
 {
   add_core_fns (&win32_elf_core_fns);
 }
This page took 0.026636 seconds and 4 git commands to generate.