Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Brian Ford <ford@vss.fsi.com>
To: gdb-patches@sources.redhat.com
Subject: Re: Fall back from Windows to cygwin PIDs
Date: Tue, 07 Jan 2003 17:03:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.44.0301071058530.544-200000@eos> (raw)
In-Reply-To: <20030107165812.GA6756@redhat.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 822 bytes --]

Oops, sorry.  Typo on the attachment line.  Here it is.  Thanks.

On Tue, 7 Jan 2003, Christopher Faylor wrote:

> On Mon, Jan 06, 2003 at 01:23:35PM -0600, Brian Ford wrote:
> >The attached patch attempts to fall back from Windows to Cygwin PIDs.
> >This only adds functionality, without changing the previous behavior.  As
> >such, I believe it will lessen confusion for those expecting normal
> >Unix like behavior under Cygwin.  Thanks and please CC me on replies.
>
> Sorry, but there was no patch attached to this message.  You attached
> the whole win32-nat.c file.  Please send a patch and ChangeLog if you
> want your changes to be reviewed.
>
> Thanks,
> cgf
>

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1722 bytes --]

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 <ford@vss.fsi.com>
+	* win32-nat.c (cygwin_pid): Removed as unused.
+	(child_attach): Try fall back to Cygwin pid.
+
 2003-01-06  Andrew Cagney  <cagney@redhat.com>
 
 	* 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 ())
     {

  reply	other threads:[~2003-01-07 17:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 19:24 Fall back from Windows to Cygwin PIDs Brian Ford
2003-01-07 16:57 ` Fall back from Windows to cygwin PIDs Christopher Faylor
2003-01-07 17:03   ` Brian Ford [this message]
2003-01-29 16:29     ` Brian Ford
2003-01-30  1:40       ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.44.0301071058530.544-200000@eos \
    --to=ford@vss.fsi.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox