Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.3671 diff -u -w -r1.3671 ChangeLog --- ChangeLog 6 Jan 2003 18:49:06 -0000 1.3671 +++ ChangeLog 6 Jan 2003 19:17:44 -0000 @@ -1,3 +1,7 @@ +2003-01-06 Brian Ford + * win32-nat.c (cygwin_pid): Removed as unused. + (child_attach): Try fall back to Cygwin pid. + 2003-01-06 Andrew Cagney * MAINTAINERS (Target Instruction Set Architectures): Update Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.66 diff -u -w -r1.66 win32-nat.c --- win32-nat.c 23 Nov 2002 02:49:45 -0000 1.66 +++ win32-nat.c 6 Jan 2003 19:17:38 -0000 @@ -124,7 +124,6 @@ static HANDLE current_process_handle; /* Currently executing process */ static thread_info *current_thread; /* Info on currently selected thread */ static DWORD main_thread_id; /* Thread ID of the main thread */ -static pid_t cygwin_pid; /* pid of cygwin process */ /* Counts of things. */ static int exception_count = 0; @@ -1384,12 +1383,21 @@ if (!args) error_no_arg ("process-id to attach"); - pid = strtoul (args, 0, 0); + pid = strtoul (args, 0, 0); /* Windows pid */ ok = DebugActiveProcess (pid); saw_create = 0; if (!ok) + { + /* Try fall back to Cygwin pid */ + pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); + + if (pid > 0) + ok = DebugActiveProcess (pid); + + if (!ok) error ("Can't attach to process."); + } if (has_detach_ability ()) {