From: Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>
To: gdb-patches@sourceware.org
Subject: Re: PR/2386 [2/2]: MinGW attach to process without an exec file
Date: Fri, 28 Dec 2007 04:33:00 -0000 [thread overview]
Message-ID: <20071228013457.GB7602@ednor.casa.cgf.cx> (raw)
In-Reply-To: <47744F9C.8040604@portugalmail.pt>
On Fri, Dec 28, 2007 at 01:21:32AM +0000, Pedro Alves wrote:
> The target_pid_to_exec_file MinGW implementation
> win32-nat.c:win32_pid_to_exec_file is currently an empty stub,
> as I mentioned on http://sourceware.org/ml/gdb/2007-10/msg00104.html.
>
> This patch fills the gap. The patch covers 9x/NT, and tries to
> work even if psapi.dll isn't present, as it isn't part of
> the OS. To do that, it has to resort to non documented
> NT funcionality... If that doesn't work, it falls back
> into using psapi.dll. I'd be very happy if someone could
> point me at better ways to get at executable from a PID on
> Windows, or at a filename from a file handle. Note that de
> documented way to use a mapping relies on psapi.dll.
>
> This is also useful when debugging a native win32 app
> from a Cygwin gdb.
>
> Tested on XP Pro SP2, i686-pc-cygwin, no changes.
>
> OK ?
I'm not going to comment on the MinGW aspects of this other than to note
that I think it is rather intrusive and I don't worrying about ancient
Windows versions is a good idea.
If you want to get the process name from a cygwin pid you just use the
/proc interface.
cgf
next prev parent reply other threads:[~2007-12-28 1:35 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-28 1:35 Pedro Alves
2007-12-28 4:33 ` Christopher Faylor [this message]
2007-12-29 3:37 ` Pedro Alves
2007-12-29 3:50 ` Joel Brobecker
2007-12-29 11:47 ` Eli Zaretskii
2007-12-29 14:02 ` Lerele
2007-12-29 5:42 ` Joel Brobecker
2007-12-29 12:59 ` Pedro Alves
2007-12-29 14:35 ` Pedro Alves
2007-12-29 18:48 ` Christopher Faylor
2007-12-29 20:15 ` Eli Zaretskii
2007-12-29 22:46 ` Pedro Alves
2007-12-30 3:07 ` Christopher Faylor
2007-12-30 4:32 ` Eli Zaretskii
2007-12-30 20:37 ` Christopher Faylor
2007-12-31 6:35 ` Eli Zaretskii
2007-12-31 8:12 ` Christopher Faylor
2007-12-31 21:38 ` Eli Zaretskii
2007-12-30 20:41 ` Pedro Alves
2007-12-30 4:20 ` Eli Zaretskii
2007-12-31 4:13 ` Pedro Alves
2007-12-29 11:41 ` Eli Zaretskii
2007-12-29 11:33 ` Eli Zaretskii
2007-12-29 14:33 ` Pedro Alves
2007-12-29 16:08 ` Eli Zaretskii
2007-12-30 0:30 ` Pedro Alves
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=20071228013457.GB7602@ednor.casa.cgf.cx \
--to=cgf-use-the-mailinglist-please@sourceware.org \
--cc=gdb-patches@sourceware.org \
/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