From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33088 invoked by alias); 13 Apr 2016 00:16:25 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 33069 invoked by uid 89); 13 Apr 2016 00:16:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (176.31.208.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 13 Apr 2016 00:16:24 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Pass Ctrl-C to the target in target_terminal_inferior From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <93692b589dc7017d5a2fbdffdfad5f84f597d8f1@gdb-build> Date: Wed, 13 Apr 2016 00:16:00 -0000 X-SW-Source: 2016-q2/txt/msg00597.txt.bz2 *** TEST RESULTS FOR COMMIT 93692b589dc7017d5a2fbdffdfad5f84f597d8f1 *** Author: Pedro Alves Branch: master Commit: 93692b589dc7017d5a2fbdffdfad5f84f597d8f1 Pass Ctrl-C to the target in target_terminal_inferior If the user presses Ctrl-C immediately before target_terminal_inferior is called and the target is resumed, instead of after, the Ctrl-C ends up pending in the quit flag until the target next stops. remote.c has this bit to handle this: if (!target_is_async_p ()) { ofunc = signal (SIGINT, sync_remote_interrupt); /* If the user hit C-c before this packet, or between packets, pretend that it was hit right here. */ if (check_quit_flag ()) sync_remote_interrupt (SIGINT); } But that's only reachable if async is off, while async is on by default nowadays. It's also obviously not reacheable on native targets. This patch generalizes that to all targets. We can't remove that remote.c bit yet, until we get rid of the sync SIGINT handler though. That'll be done later in the series. gdb/ChangeLog: 2016-04-12 Pedro Alves * remote.c (remote_pass_ctrlc): New function. (init_remote_ops): Install it. * target.c (target_terminal_inferior): Pass pending Ctrl-C to the target. (target_pass_ctrlc, default_target_pass_ctrlc): New functions. * target.h (struct target_ops) : New method. (target_pass_ctrlc, default_target_pass_ctrlc): New declarations. * target-delegates.c: Regenerate.