From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23858 invoked by alias); 18 Aug 2010 13:46:16 -0000 Received: (qmail 23838 invoked by uid 22791); 18 Aug 2010 13:46:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 13:46:11 +0000 Received: (qmail 26253 invoked from network); 18 Aug 2010 13:45:55 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Aug 2010 13:45:55 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Implement post_event for Python scripts. Date: Wed, 18 Aug 2010 13:46:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Phil Muldoon , Tom Tromey References: <4C45F0B0.5000903@redhat.com> In-Reply-To: <4C45F0B0.5000903@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008181445.52900.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00292.txt.bz2 On Tuesday 20 July 2010 19:53:36, Phil Muldoon wrote: > 2010-08-11 Tom Tromey > Phil Muldoon > > * python/python.c (gdbpy_run_events): New function. > (gdbpy_post_event): Likewise. > (gdbpy_initialize_events): Likewise. > (_initialize_python): Call gdbpy_initialize_events. It was brought to my attention that this unfortunatly breaks Windows builds: cc1: warnings being treated as errors /scratch/sandra/trunk45/obj/gdb-src-2010.09-999999-arm-none-eabi-i686-mingw32/gdb/python/python.c: In function 'gdbpy_initialize_events': /scratch/sandra/trunk45/obj/gdb-src-2010.09-999999-arm-none-eabi-i686-mingw32/gdb/python/python.c:675: error: implicit declaration of function 'pipe' This is: > if (!pipe (gdbpy_event_fds)) > { > gdbpy_event_list_end = &gdbpy_event_list; > add_file_handler (gdbpy_event_fds[0], gdbpy_run_events, NULL); > } `pipe' doesn't exist on Windows. There's a _pipe function, but it has a different interface (takes two remote arguments). See and look for "gdb_pipe". The expedient way to fix this I guess would be to resurrect gdb_pipe from that patch, so that we have a consistent way across hosts to create a pipe. I do agree that using pipes on common code to wake up the event loop is tackling at the wrong level (we should have an abstracted way to do this, using pipes on posix hosts, events on Windows, etc.), but, I'm happy with a simpler way for now. I'm also not sure whether ... > /* We use a file handler, and not an async handler, so that we can > wake up the main thread even when it is blocked in poll(). */ > static int gdbpy_event_fds[2]; ... mingw-htep.c:gdb_select will be smart enough to apply the proper select for that file descriptor, or if we need to bring the whole patch in. What do you think about this? -- Pedro Alves