Fix Cygwin build after 0578e87f
authorJon Turney <jon.turney@dronecode.org.uk>
Fri, 20 May 2022 13:45:53 +0000 (14:45 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Thu, 2 Jun 2022 09:39:46 +0000 (10:39 +0100)
Fix Cygwin build after 0578e87f ("Remove some globals from
nat/windows-nat.c").  Update code under ifdef __CYGWIN__ for globals
moved to members of struct windows_process_info.

gdb/nat/windows-nat.c
gdb/windows-nat.c

index f6818015c5351f25cc424b459f9474dd6ff8cf2c..ca6a529601eb68f07fe9063cb8f4dff223af2b54 100644 (file)
@@ -198,7 +198,7 @@ windows_process_info::get_exec_module_filename (char *exe_name_ret,
        to POSIX format into the destination buffer.  */
     cygwin_buf_t *pathbuf = (cygwin_buf_t *) alloca (exe_name_max_len * sizeof (cygwin_buf_t));
 
-    len = GetModuleFileNameEx (current_process_handle,
+    len = GetModuleFileNameEx (handle,
                               dh_buf, pathbuf, exe_name_max_len);
     if (len == 0)
       error (_("Error getting executable filename: %u."),
index 6c6dea84bfa9f7b0e1c0b2e6edb9ad0e9903cc3f..ab0efe72d8f85999bf93c80ce7ab5a893167add8 100644 (file)
@@ -884,7 +884,7 @@ windows_nat::windows_process_info::handle_output_debug_string
          if (!retval)
            retval = current_event.dwThreadId;
          else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
-                  && ReadProcessMemory (current_process_handle, x,
+                  && ReadProcessMemory (handle, x,
                                         &saved_context,
                                         __COPY_CONTEXT_SIZE, &n)
                   && n == __COPY_CONTEXT_SIZE)