public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC 00/17] Merge event loop implementations
@ 2019-02-24 16:51 Tom Tromey
  2019-02-24 16:52 ` [RFC 07/17] Use warning in event-loop Tom Tromey
                   ` (18 more replies)
  0 siblings, 19 replies; 52+ messages in thread
From: Tom Tromey @ 2019-02-24 16:51 UTC (permalink / raw)
  To: gdb-patches

This series merges the gdb and gdbserver forks of event-loop.[ch].

This is an RFC because there are a few possibly unresolved issues.

Most of the patches are straightforward.  The series begins by tidying
up the gdb event-loop code, removing things that are specific to gdb.
Then, the code is moved.  After this, gdbserver is switched to use the
common code; and finally, a few cleanups are applied.

I initially attempted something more ambitious here: unifying the
async event and async signal code in event-loop (as I do not
understand the reason for the difference); and then further handling
the async signal code using the same code path as ordinary file
descriptors.

However, this didn't work, and since it was not directly important to
my goal of merging event loops, I dropped it.  I think it may be worth
reviving.  For example I think th async event code suffers from the
same race that led Pedro to change the async signal code to use a the
self-pipe trick.

Another related possible to-do item is changing the ser-event code to
maintain just a single self-pipe.  It seems to me that there's never a
reason to need more than one.

create_file_handler may have a latent bug where the global select
masks are not updated if it is called a second time for the same file
descriptor.  Both versions of the event loop have this issue; I didn't
try to verify it, so perhaps I'm just misunderstanding the code here.

The final patch simplifies the rather convoluted handling of "serial"
(meaning remote protocol) input in gdbserver.  It passes testing, but
I wonder whether there's some subtle reason that the code is written
the way it is.  This is one of the unresolved issues I mentioned.

The second unresolved issue involves the USE_WIN32API code.  Before
this series, gdbserver used gdb_fildes_t, defined like:

    #if USE_WIN32API
    #include <winsock2.h>
    typedef SOCKET gdb_fildes_t;
    #else
    typedef int gdb_fildes_t;
    #endif

gdb did not use this approach, but does have a separate gdb_select
implementation in mingw-hdep.c, which gdbserver does not.

I don't know much about Windows, so I don't know why these things are
needed.  I did a build using " --host=i686-w64-mingw32
--target=i686-w64-mingw32", and everything built just fine using a
POSIX-style API.

Given that, I removed gdb_fildes_t in this series.  However, perhaps
it is still needed and this series needs some more work.  I could use
some advice here -- when is this code actually needed and is there a
way I can reproduce any problems?  I don't have a Windows host, so I'm
hoping for some sort of compile-time error using a mingw cross.

Regression tested by the buildbot.

Tom


^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2020-02-14 18:36 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-24 16:51 [RFC 00/17] Merge event loop implementations Tom Tromey
2019-02-24 16:52 ` [RFC 07/17] Use warning in event-loop Tom Tromey
2019-09-26 14:02   ` Pedro Alves
2019-02-24 16:52 ` [RFC 12/17] Add the ability to stop the event loop Tom Tromey
2019-02-24 16:52 ` [RFC 14/17] Remove some dead code from event-loop.c Tom Tromey
2019-02-24 16:52 ` [RFC 16/17] Remove gdb_fildes_t Tom Tromey
2019-02-24 16:52 ` [RFC 05/17] Remove gdb_usleep.c Tom Tromey
2019-09-26 14:02   ` Pedro Alves
2019-09-26 14:43     ` Tom Tromey
2019-02-24 16:52 ` [RFC 02/17] Move gdb-specific code out of start_event_loop Tom Tromey
2019-09-26 14:02   ` Pedro Alves
2019-02-24 16:52 ` [RFC 11/17] Implement event-loop glue for gdbserver Tom Tromey
2019-02-24 16:52 ` [RFC 13/17] Switch gdbserver to common event loop Tom Tromey
2019-02-24 16:52 ` [RFC 15/17] Move gdb_notifier comment Tom Tromey
2019-09-26 14:06   ` Pedro Alves
2019-02-24 16:52 ` [RFC 03/17] Move event-loop configury to common.m4 Tom Tromey
2019-02-24 16:52 ` [RFC 04/17] Move gdb_select.h to common/ Tom Tromey
2019-02-24 16:52 ` [RFC 10/17] Move event-loop.[ch] " Tom Tromey
2019-09-26 14:06   ` Pedro Alves
2019-10-04 22:06     ` Tom Tromey
2019-02-24 16:52 ` [RFC 06/17] Include <chrono> in event-loop.c Tom Tromey
2019-09-26 14:02   ` Pedro Alves
2019-02-24 16:52 ` [RFC 01/17] Remove include from event-loop.c Tom Tromey
2019-02-24 16:52 ` [RFC 09/17] Introduce async-event.[ch] Tom Tromey
2019-09-26 14:06   ` Pedro Alves
2019-10-04 22:17     ` Tom Tromey
2019-02-24 16:52 ` [RFC 17/17] Simplify gdbserver's serial event handling Tom Tromey
2019-09-26 17:36   ` Pedro Alves
2019-10-04 22:08     ` Tom Tromey
2019-02-24 16:52 ` [RFC 08/17] Introduce and use flush_streams Tom Tromey
2019-02-24 17:14 ` [RFC 00/17] Merge event loop implementations Eli Zaretskii
2019-02-24 17:26   ` Tom Tromey
2019-02-24 17:45     ` Eli Zaretskii
2019-02-25 19:57       ` Tom Tromey
2019-02-25 20:30         ` Eli Zaretskii
2019-02-25 20:55           ` Tom Tromey
2019-02-26 16:04             ` Eli Zaretskii
2019-02-26 16:23               ` Tom Tromey
2019-02-26 16:46                 ` Eli Zaretskii
2019-09-26 17:47 ` Pedro Alves
2019-09-26 23:09   ` Tom Tromey
2019-09-27 13:53     ` Pedro Alves
2019-09-27 14:05       ` Pedro Alves
2019-09-27 14:21         ` Eli Zaretskii
2019-09-27 14:53           ` Pedro Alves
2019-09-27 15:32             ` Eli Zaretskii
2019-09-27 19:10       ` Tom Tromey
2020-02-14  2:22         ` Tom Tromey
2020-02-14 17:58           ` Pedro Alves
2020-02-14 18:36             ` Tom Tromey
2019-10-04 22:25   ` Tom Tromey
2020-02-14 18:20     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).