From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114128 invoked by alias); 24 Feb 2019 16:52:02 -0000 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 Received: (qmail 113968 invoked by uid 89); 24 Feb 2019 16:52:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Feb 2019 16:51:59 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 89D2919461F for ; Sun, 24 Feb 2019 10:51:58 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id xx0Qg40W8YTGMxx0QgLRMj; Sun, 24 Feb 2019 10:51:58 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GlKdnV8Jzvpne4+deaey2G53TpTcoPjvGD+dcDlO51o=; b=p1SWJhL/bivI7Ek5ncWzFg+Ua0 MAGjY4ifD1dq2xlt6zYndeNzzCFGXeUoCGrx/ejjd2afMvXqMGEkADM3ohBdfOWD/4H/sLs6KFSq1 q9FuQ8KNtLceqwsypGSrXsgCf; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:44502 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gxx0Q-001AKk-As; Sun, 24 Feb 2019 10:51:58 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 11/17] Implement event-loop glue for gdbserver Date: Sun, 24 Feb 2019 16:52:00 -0000 Message-Id: <20190224165153.5062-12-tom@tromey.com> In-Reply-To: <20190224165153.5062-1-tom@tromey.com> References: <20190224165153.5062-1-tom@tromey.com> X-SW-Source: 2019-02/txt/msg00401.txt.bz2 event-loop.c requires the client to provide some functions. This patch implements these functions for gdbserver. gdb/gdbserver/ChangeLog 2019-02-24 Tom Tromey * server.c (handle_event_loop_exception) (invoke_async_signal_handlers, check_async_event_handlers) (flush_streams, gdb_select): New functions. --- gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/server.c | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index e960c10d402..1b2b86813fb 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -4503,6 +4503,50 @@ handle_target_event (int err, gdb_client_data client_data) return 0; } +/* See common/event-loop.h. */ + +void +handle_event_loop_exception (const gdb_exception &ex) +{ + /* gdbserver relies on any exception in getpkt escaping from the + event loop, to be caught in captured_main. */ + throw_exception (ex); +} + +/* See common/event-loop.h. */ + +int +invoke_async_signal_handlers () +{ + return 0; +} + +/* See common/event-loop.h. */ + +int +check_async_event_handlers () +{ + return 0; +} + +/* See common/errors.h */ + +void +flush_streams () +{ + fflush (stdout); + fflush (stderr); +} + +/* See common/gdb_select.h. */ + +int +gdb_select (int n, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout) +{ + return select (n, readfds, writefds, exceptfds, timeout); +} + #if GDB_SELF_TEST namespace selftests { -- 2.17.2