From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48006 invoked by alias); 18 Dec 2019 14:59:28 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 47998 invoked by uid 89); 18 Dec 2019 14:59:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy=quit, H*i:sk:CCjMcSQ, H*f:sk:CCjMcSQ, H*i:sk:CAHrp7Q X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2019 14:59:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576681165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gd1o0+lZWvzV2CptkF+m+QMwqlb/Bc0p5LoEnCq+gfk=; b=P+MlpLAQj9f/kkFr750jAguDN0yWpZOADYdKu1vRynTSxfzLMI5QTAqtZZ6r6wJOYOAQG8 /mzCW01oo7rFXtiQaplG8mqHPX6V04osjyyOVpq0Fi1HydkBfclNYowb33iXtBShiddORc 77koHVaxEGyjIimxstTUyLxTkI9HWAw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-278-Rk6ckprYPaWv96ICDf9YiA-1; Wed, 18 Dec 2019 09:59:23 -0500 Received: by mail-wr1-f70.google.com with SMTP id o6so982093wrp.8 for ; Wed, 18 Dec 2019 06:59:23 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id s82sm2860078wms.28.2019.12.18.06.59.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Dec 2019 06:59:21 -0800 (PST) Subject: Re: GDB doesn't interrupt target To: Tudor Popescu , gdb@sourceware.org References: From: Pedro Alves Message-ID: Date: Wed, 18 Dec 2019 14:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-12/txt/msg00032.txt.bz2 On 12/18/19 2:20 PM, Tudor Popescu wrote: > Hello, >=20 > I am using an eclipse-based IDE and a gdb/gdbserver combination for aarch= 64 > targets. GDB version we use is 8.2.1 on a Linux host. >=20 > Main problem is GDB doesn't interrupt the target when Ctrl-C is sent to > eclipse's Debugger Console. Same thing happens when using kill -2 on > pidof(gdb), or when pressing suspend button in eclipse. >=20 > As far as I can tell, GDB 8.2.1 is launched with 2 interpreters: console > and mi2. The actual arguments are: > --interpreter mi2 -q --interpreter console -ex "new-ui mi /dev/pts/5" -ex > "set pagination off" -ex "show version" >=20 > The old GDB 7.11.1 we used, received only "=E2=80=93interpreter mi2 --nx"= as > arguments and everything related to target interrupt was working as > expected. >=20 > From my investigation, the behavior described above is somehow related to > the terminal management (and also target_terminal::is_ours()). Looks like > when eclipse is involved, target_pass_ctrlc() is never called. My > understanding is that we need target_terminal::is_ours() to return false = in > order to interrupt the target. But this never happens on my setup. >=20 > What I need, is a way to interrupt the target while target is running. > Also, I would like to understand what is causing the above mentioned > behavior. I know that GDB 7.12+ introduced some changes to support a > prettier Debugger Console in eclipse and this seems to impact somehow the > interrupt functionality in my case. >=20 > So the main question is how do I make GDB 8.2.1 behave like GDB 7.11.1 wh= en > it comes to target interrupting (e.g. Ctrl+C)? Are there any special > arguments that need to be passed to GDB? So what _do_ you see when you "kill -2" gdb? Do you see a "Quit" being pri= nted? I.e., the GDB console is accepting commands while the target is running? I assume Eclipse sends "set mi-async on" or "set target-async on" nowadays. The right way to interrupt the target is to send -exec-interrupt via the MI channel.=20=20 Thanks, Pedro Alves