delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/09/12:24:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=TXNtZrGOudUkiFKe7C1/oGb3Djd21spa8NXY5iqD06y
kj5hmc2DcpB86XpSPPGvGWM8z2K57xB88Pf4MKdlSmQrECLx9J97/fVPxk0aaJ87
VcaEvru2b6EOPveiyGFQDZCXKNhgoC+1p2P1jDT/p41/90dj+22DRq/KMmoRCLtM
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=abHju66oBjL7O19a4IYIKXP4mSo=; b=iFbbNAUxln6hJfktO
yng6jqFjcL4nQQ9q5UGw7N90j90uvmRT1rdSXaA4gim+v5jG38SQQ/cnvfVU833n
4S5Y+fckBYs0GWHdwRxIXey8DguYZwAtIkzqmRBLk2iwvGbLICbQ3APzanp+WXM1
0cvwvnpa6Ny7+fjVmrpbhfStlA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mout.gmx.net
Message-ID: <52F7B9A3.305@mail.com>
Date: Sun, 09 Feb 2014 12:23:47 -0500
From: Todd Poole <tpoole AT mail DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: PID & WINPID
References: <52F796A3 DOT 5090400 AT mail DOT com> <CAAXzdLVvh87N_y3KtVLCcwL4HKMBHS62zUKe6WAPShuR_2+u_g AT mail DOT gmail DOT com>
In-Reply-To: <CAAXzdLVvh87N_y3KtVLCcwL4HKMBHS62zUKe6WAPShuR_2+u_g@mail.gmail.com>
X-IsSubscribed: yes

Thanks for the start but I am little confused on something. The program 
I wish to dump is running, I check the Windows Task Manager and see the 
PID. I execute ps -W and the PID don't match which I assume is correct. 
The PID I need would come from the ps -W. If I execute ps -p myprogram I 
get a list of (3) PID and Commands see below:

$ ps -p myprogram
   PID    PPID    PGID     WINPID   TTY     UID    STIME COMMAND
   4304    3932    4304       4356  pty0    1001 12:12:23 /usr/bin/ps
   4372       1    4372       4372  ?       1001 12:07:01 /usr/bin/mintty
   3932    4372    3932       1364  pty0    1001 12:07:01 usr/bin/bash

How do I know which is the one I need. I obviously can go thru and run 
the dumper on each and to find out which is correct, I tried this and 
(2) of the (3) tell me Failed to open process error 87. On the one 
listed as /usr/bin/mintty it runs.

Thanks


On 2/9/2014 10:17 AM, Steven Penny wrote:
> On Sun, Feb 9, 2014 at 8:54 AM, Todd Poole wrote:
>> What is a simple straight forward way I can code the script to obtain the
>> process cygwin pid by the process name and perform dumper?
>
> This should get you started
>
>      set calc
>      dumper $1 $(ps -W | awk "/$1/,NF=1")
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019