Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
	Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add a timeout parameter to gdb_do_one_event
Date: Sat, 28 Aug 2021 02:07:32 +0200	[thread overview]
Message-ID: <d032f765-1c55-424a-615a-3cac990a140d@monnerat.net> (raw)
In-Reply-To: <87wno6n4kw.fsf@tromey.com>


On 8/27/21 8:08 PM, Tom Tromey wrote:
>>>>>> "Patrick" == Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org> writes:
> Patrick> The real implementation makes the GUI event loop call gdb_do_one_event
> Patrick> and recursively. The actual event waiting is performed by
> Patrick> gdb_do_one_event, but the GUI may define a timeout for it. The hard
> Patrick> task here is to avoid infinite recursion.
>
> I wonder sometimes how we'll handle integrating event loops when we want
> to let users integrate Python await with GDB APIs.

I don't know much about it. Would you monitor gdb events from Python or 
an asyncio event loop from gdb?

In case you haven't seen it yet, I found that: 
https://docs.python.org/3/c-api/typeobj.html#async-object-structures.

>
> Patrick> The alternate solution would have been to run the GUI in a separate
> Patrick> thread, but that's even a bigger work!
>
> This is what my Python GUI does, but indeed it's complicated.  It needed
> a hack (to block some signals in the GUI thread), and it has to send
> Python code back and forth between the GUI thread and the main thread,
> because GDB isn't thread-safe.

Thanks for the comment Tom: it confirms what I "sniffed" !

I have to admit that, without the Tcl notifier feature, threads would 
have been the only solution.

It was (almost) easy to use gdb event system from Tcl because the latter 
provides support for it. The opposite is not true: gdb events cannot be 
delegated to some external event monitoring handler. If Insight is not 
the only piece of software having to support alternate concurrent event 
loops, shouldn't we dream of such a gdb feature? Just my 2 cents!


Patrick


  reply	other threads:[~2021-08-28  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 18:23 Patrick Monnerat via Gdb-patches
2021-08-26  3:24 ` Simon Marchi via Gdb-patches
2021-08-26 11:36   ` Patrick Monnerat via Gdb-patches
2021-08-26 13:47     ` Simon Marchi via Gdb-patches
2021-08-26 15:14       ` Patrick Monnerat via Gdb-patches
2022-03-14 14:49         ` [PING] " Patrick Monnerat via Gdb-patches
2021-08-27 18:08     ` [PATCH] " Tom Tromey
2021-08-28  0:07       ` Patrick Monnerat via Gdb-patches [this message]
2021-08-26 18:30 Patrick Monnerat via Gdb-patches
2022-03-14 14:49 Patrick Monnerat via Gdb-patches
2022-03-14 16:17 ` Pedro Alves
2022-03-17 13:08 Patrick Monnerat via Gdb-patches
2022-04-15 16:21 ` Tom Tromey
2022-04-16  0:38   ` Patrick Monnerat via Gdb-patches
2022-07-22 13:41 ` Simon Marchi via Gdb-patches
2022-07-22 22:45   ` Patrick Monnerat via Gdb-patches
2022-07-25  1:07     ` Simon Marchi via Gdb-patches
2022-08-18 11:16 ` Andrew Burgess via Gdb-patches
2022-08-19 11:29   ` Patrick Monnerat via Gdb-patches
2022-08-23 18:38     ` Tom Tromey

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=d032f765-1c55-424a-615a-3cac990a140d@monnerat.net \
    --to=gdb-patches@sourceware.org \
    --cc=patrick@monnerat.net \
    --cc=tom@tromey.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