daily update
[deliverable/binutils-gdb.git] / gdb / mingw-hdep.c
index 1a1d1df7e1edfbc9b658757146597fe4f8eb8dd7..50dc372e9efadb71e6c012b82ed6c5844cd15b15 100644 (file)
@@ -1,7 +1,6 @@
 /* Host support routines for MinGW, for GDB, the GNU debugger.
 
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2006-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+#include "main.h"
 #include "serial.h"
 #include "event-loop.h"
 
 #include "gdb_assert.h"
 #include "gdb_select.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "readline/readline.h"
 
 #include <windows.h>
@@ -81,6 +81,19 @@ safe_strerror (int errnum)
   return buffer;
 }
 
+/* Return an absolute file name of the running GDB, if possible, or
+   ARGV0 if not.  The return value is in malloc'ed storage.  */
+
+char *
+windows_get_absolute_argv0 (const char *argv0)
+{
+  char full_name[PATH_MAX];
+
+  if (GetModuleFileName (NULL, full_name, PATH_MAX))
+    return xstrdup (full_name);
+  return xstrdup (argv0);
+}
+
 /* Wrapper for select.  On Windows systems, where the select interface
    only works for sockets, this uses the GDB serial abstraction to
    handle sockets, consoles, pipes, and serial ports.
@@ -252,6 +265,9 @@ gdb_call_async_signal_handler (struct async_signal_handler *handler,
   SetEvent (sigint_event);
 }
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_mingw_hdep;
+
 void
 _initialize_mingw_hdep (void)
 {
This page took 0.039222 seconds and 4 git commands to generate.