PR gdb/7912:
[deliverable/binutils-gdb.git] / gdb / corelow.c
index 121c84666debd58ede4a46a4aa8c8cf3cb2d49eb..46da88106742a6ba1436c14c5178674cd03c6c61 100644 (file)
@@ -46,6 +46,8 @@
 #include "progspace.h"
 #include "objfiles.h"
 #include "gdb_bfd.h"
+#include "completer.h"
+#include "filestuff.h"
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
@@ -85,7 +87,7 @@ static void core_open (char *, int);
 
 static void core_detach (struct target_ops *ops, char *, int);
 
-static void core_close (int);
+static void core_close (void);
 
 static void core_close_cleanup (void *ignore);
 
@@ -192,10 +194,8 @@ gdb_check_format (bfd *abfd)
    stack spaces as empty.  */
 
 static void
-core_close (int quitting)
+core_close (void)
 {
-  char *name;
-
   if (core_bfd)
     {
       int pid = ptid_get_pid (inferior_ptid);
@@ -225,7 +225,7 @@ core_close (int quitting)
 static void
 core_close_cleanup (void *ignore)
 {
-  core_close (0/*ignored*/);
+  core_close ();
 }
 
 /* Look for sections whose names start with `.reg/' so that we can
@@ -313,7 +313,7 @@ core_open (char *filename, int from_tty)
     flags |= O_RDWR;
   else
     flags |= O_RDONLY;
-  scratch_chan = open (filename, flags, 0);
+  scratch_chan = gdb_open_cloexec (filename, flags, 0);
   if (scratch_chan < 0)
     perror_with_name (filename);
 
@@ -664,7 +664,6 @@ static LONGEST
 get_core_siginfo (bfd *abfd, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
 {
   asection *section;
-  long pid;
   char *section_name;
   const char *name = ".note.linuxcore.siginfo";
 
@@ -980,5 +979,5 @@ _initialize_corelow (void)
 {
   init_core_ops ();
 
-  add_target (&core_ops);
+  add_target_with_completer (&core_ops, filename_completer);
 }
This page took 0.025503 seconds and 4 git commands to generate.