* windows-nat.c (handle_output_debug_string): Avoid typecast
[deliverable/binutils-gdb.git] / gdb / windows-nat.c
index e648d5fa90eda6fb4ed38505b94db5ca860810eb..805ab3031870e5d8169fdf32d431e831ff89cc8f 100644 (file)
@@ -597,6 +597,18 @@ failed:
   return 0;            /* failure */
 }
 
+/* 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);
+}
+
 /* Encapsulate the information required in a call to
    symbol_file_add_args.  */
 struct safe_symbol_file_add_args
@@ -969,16 +981,18 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
       char *p;
       int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0);
       int gotasig = gdb_signal_from_host (sig);
+
       ourstatus->value.sig = gotasig;
       if (gotasig)
        {
          LPCVOID x;
          SIZE_T n;
+
          ourstatus->kind = TARGET_WAITKIND_STOPPED;
          retval = strtoul (p, &p, 0);
          if (!retval)
            retval = main_thread_id;
-         else if ((x = (LPCVOID) strtoull (p, NULL, 0))
+         else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
                   && ReadProcessMemory (current_process_handle, x,
                                         &saved_context,
                                         __COPY_CONTEXT_SIZE, &n)
@@ -2367,7 +2381,7 @@ windows_can_run (void)
 }
 
 static void
-windows_close (int x)
+windows_close (void)
 {
   DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n",
                PIDGET (inferior_ptid)));
This page took 0.025543 seconds and 4 git commands to generate.