Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: LRN <lrn1986@gmail.com>
To: gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [Bug win32/14529] Make gdb capable of JIT-debugging on W32
Date: Fri, 31 Aug 2012 15:40:00 -0000	[thread overview]
Message-ID: <5040DACD.3090101@gmail.com> (raw)
In-Reply-To: <20120831153656.GA22517@ednor.casa.cgf.cx>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 31.08.2012 19:36, Christopher Faylor wrote:
> On Fri, Aug 31, 2012 at 05:52:57PM +0300, Eli Zaretskii wrote:
>>> Date: Wed, 29 Aug 2012 21:54:37 +0400 From: LRN
>>> <lrn1986@gmail.com>
>>> 
>>> To be a JIT-debugger [1] on Windows, gdb has to be able to
>>> signal an event, which is passed to it by command line. If that
>>> is not done, the process being debugged will not come out of a
>>> waiting loop after gdb attaches to it. If the event is
>>> signaled, Windows will break the loop, and let the exception
>>> fall into gdb's lap (well, stack will be a bit borked, but 
>>> that's another issue for another day, and there are ways of
>>> working around it), after gdb user does 'continue'.
>>> 
>>> The attached patch [2] does exactly that by adding extra 
>>> "--event=EVENT" argument, thus AeDebug command line will look
>>> like this: c:\mingw32\bin\gdb.exe --pid=%ld --event=%ld
>> 
>> What is AeDebug? do you mean the Registry entry of that name?
>> And what value should be used in --event= option?
>> 
>> This needs a documentation patch to explain how this option
>> should be used.
>> 
>>> +void +signal_event_command (char *args, int from_tty) +{ +
>>> int async_exec = 0; +  uintmax_t event_id = 0; +  char *endargs
>>> = NULL; +  struct cleanup *back_to = make_cleanup
>>> (null_cleanup, NULL); + +  dont_repeat ();		/* Not for the
>>> faint of heart */ + +  event_id = strtoumax (args, &endargs,
>>> 10); + +  if ((event_id == UINTMAX_MAX && errno == ERANGE) ||
>>> event_id == 0) +    error (_("Failed to convert event id `%s'
>>> to integer"), args); + +#ifdef __MINGW32__ +  SetEvent
>>> ((HANDLE) event_id); +  CloseHandle ((HANDLE) event_id); 
>>> +#else +  /* Does nothing on other platforms */ +#endif +
>>> discard_cleanups (back_to); +}
>> 
>> I wonder whether it would be cleaner to have the entire function
>> to be conditionally compiled on MinGW only.
>> 
>>> @@ -1055,6 +1065,7 @@ Options:\n\n\ --dbx              DBX
>>> compatibility mode.\n\ --directory=DIR    Search for source
>>> files in DIR.\n\ --epoch            Output information used by
>>> epoch emacs-GDB interface.\n\ +  --event=EVENT      Signal the
>>> EVENT when attached to a process. W32 only.\n\
>> 
>> And also this part.
> 
> It sounds like it would work on Cygwin too.
Yes, it should. So maybe not __MINGW32__, but _WIN32 (Cygwin version
of gdb will have to link to appropriate W32API libraries though; not
sure if it does something like that by default).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQQNrMAAoJEOs4Jb6SI2Cwk3kH/Ao8RIeIOW+NiRd2J7EJHwJG
YSfaK0B/wnKDJM6N55+DuZ+Uc8grjvQPWoq3BnjS93itECRpv6wQS/sRf/fbfTEV
+FwAmHC765dH8Giyjq5VIJv3Zu6w3F6XkDpz6GUQBklGU1/PoBQomefXCrBnFRma
dQ8het667u3GOpRTWa6fg91or8tEw/XMTYghuW12taw4GQEWO78ZeYDaqPLQwSQa
WDY6m7jjSWe38OC+LJyoXYg4moCYpTPsBgk01xTka1HxPL7RwR3AsZhqE0EFC22y
Qk/BQJvakte8Q0fD1wiqe8l0G9TCdvOwPANh+WLHRzP4cvlwa8t8LctcP3ztuX4=
=CIBx
-----END PGP SIGNATURE-----


  reply	other threads:[~2012-08-31 15:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29 17:55 LRN
2012-08-31 14:53 ` Eli Zaretskii
2012-08-31 15:37   ` LRN
2012-09-10  2:22     ` LRN
2012-09-10 18:15       ` Tom Tromey
2012-09-10 18:32         ` LRN
2012-09-11 18:21       ` Pedro Alves
2012-09-11 18:27         ` LRN
2012-09-11 18:30           ` Pedro Alves
2012-09-11 18:09     ` Pedro Alves
2012-09-11 18:23       ` LRN
2012-09-11 18:27         ` Pedro Alves
2012-09-11 18:31           ` LRN
2012-09-29 12:42           ` LRN
2012-09-29 13:05             ` Eli Zaretskii
2012-09-29 19:32               ` LRN
2012-09-30  7:51                 ` Eli Zaretskii
2012-09-30 12:46                   ` LRN
2012-10-01 13:18                     ` Eli Zaretskii
2012-10-01 16:22                       ` LRN
2012-08-31 15:37   ` Christopher Faylor
2012-08-31 15:40     ` LRN [this message]
2012-10-01 22:37 ` Sergio Durigan Junior
2012-10-01 22:48   ` LRN
2012-10-02  5:53     ` Sergio Durigan Junior
2012-10-02 12:48       ` Joel Brobecker
2012-10-02 12:57         ` LRN
2016-06-30 13:17           ` LRN
2016-06-30 15:25             ` Eli Zaretskii
2016-06-30 15:44               ` LRN
2016-06-30 16:23                 ` Eli Zaretskii
2016-06-30 17:19                   ` LRN
2016-06-30 17:42                     ` Eli Zaretskii
2016-06-30 18:36                       ` LRN
2016-06-30 18:57                         ` Eli Zaretskii
2016-06-30 19:14                           ` LRN
2016-07-02  1:16                             ` LRN
2016-07-02  7:48                               ` Eli Zaretskii
2016-07-10 13:06                                 ` LRN
2016-07-10 14:55                                   ` Eli Zaretskii
2016-07-18 10:08                                     ` LRN
2016-07-19 19:10                                       ` Eli Zaretskii
2016-07-20  4:43                                         ` LRN
2016-07-23  8:41                                           ` Eli Zaretskii

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=5040DACD.3090101@gmail.com \
    --to=lrn1986@gmail.com \
    --cc=eliz@gnu.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