From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63084: 30.0.50; gud: set breakpoint while program is running Date: Fri, 05 May 2023 08:52:26 +0300 Message-ID: <83cz3fjpet.fsf@gnu.org> References: <874jp3n52b.fsf@home.mail-host-address-is-not-set> <838refuqa8.fsf@gnu.org> <83wn1zt1tu.fsf@gnu.org> <83mt2uubzw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18933"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tatrics@gmail.com, 63084@debbugs.gnu.org To: kbrown@cornell.edu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 07:52:07 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puoMR-0004hH-M7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 07:52:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puoMN-0007Mu-P1; Fri, 05 May 2023 01:52:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoMM-0007Mk-4I for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puoML-0000RT-S9 for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puoML-00042A-Nr for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 May 2023 05:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63084 X-GNU-PR-Package: emacs Original-Received: via spool by 63084-submit@debbugs.gnu.org id=B63084.168326590215474 (code B ref 63084); Fri, 05 May 2023 05:52:01 +0000 Original-Received: (at 63084) by debbugs.gnu.org; 5 May 2023 05:51:42 +0000 Original-Received: from localhost ([127.0.0.1]:52927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puoM1-00041V-NA for submit@debbugs.gnu.org; Fri, 05 May 2023 01:51:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puoLz-000414-Nk for 63084@debbugs.gnu.org; Fri, 05 May 2023 01:51:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoLu-0000NW-AI; Fri, 05 May 2023 01:51:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vMcYC+VBteN5JzjVoe3UQ6uLINyADUjkBOwoSWQLZYA=; b=oou61OV6As3E ZfgmWDg41gxLdXgXiSXVnAHRNCgie8bqYBHDA2qX3/YZ9mFh3WsFOZjIwjDR1DjBEWlOTK2bdat1Q GU1GBlYrjSo8gQ3mAuAumVaYxISBlOL2DecI92FvkiDXeWxZbqvqhLQdxDxU+u2JPJAe/L+kN0W+n fH++sydRf4tVCGLJq8/L0xBOfGhbpBbG8RW1FdCImtaaPKV/otGSR20LwxScZLAso500m0kSXSjo9 P2V+RA/wfA5z2vC3lQU17P3q+wQML48s7bAF3bM0WWXjP1NAmMof+pmBG0xMpdJt5PsKpCJHUPZty nvUuJM2az2KXPTmk9VIxCA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoLt-0004Lq-PK; Fri, 05 May 2023 01:51:34 -0400 In-Reply-To: <83mt2uubzw.fsf@gnu.org> (message from Eli Zaretskii on Wed, 26 Apr 2023 14:19:31 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261059 Archived-At: Ping! Ken, could you please look into this, if you have time? > Cc: tatrics@gmail.com, 63084@debbugs.gnu.org > Date: Wed, 26 Apr 2023 14:19:31 +0300 > From: Eli Zaretskii > > > Cc: 63084@debbugs.gnu.org > > Date: Wed, 26 Apr 2023 12:44:29 +0300 > > From: Eli Zaretskii > > > > > From: TatriX > > > Date: Wed, 26 Apr 2023 10:48:53 +0200 > > > Cc: 63084@debbugs.gnu.org > > > > > > Oh, sorry. I tried on a different machine, and realized one have to use "run&". > > > > > > So, here's what I did: > > > > > > $ cat main.c > > > #include > > > #include > > > > > > int main(void) { > > > for (int i = 0; ; i++) { > > > printf("%d\n", i); > > > sleep(1); > > > } > > > } > > > > > > $ gcc -g -o break main.c > > > $ emacs -Q main.c > > > M-x gdb RET > > > # in *gud-break*, NOTE it's "run&" > > > (gdb) run& > > > # in main.c > > > (goto-line 6) > > > (gud-break 1) ; or C-x C-a C-b > > > # nothing happens > > > M-: (gud-call "break 6") RET > > > # breakpoint is set and process execution is paused on hitting that breakpoint > > > > What is the value of gdb-running and of gdb-non-stop after you "run&" > > the program? > > Ken, could you please take a look at this bug report? AFAICT, it has > something to do with the code you changed some 11 years ago (see > bug#9878). > > Basically, what "M-x gdb" now does is send the "-gdb-set non-stop 1" > command, then, when we get a valid response for it, it sends the > "-gdb-set target-async 1" command. So far so good, but when we get > the response for the latter, we send the "-list-target-features" > command and expect it to report "async" as one of the features, and if > not, we decide that non-stop mode is not supported. > > My testing indicates that -list-target-features will only report > "async" after we run the program or attach to a process. So we are > (almost) always disabling the non-stop mode, which doesn't seem right > to me. > > So I'm interested to know how you tested this particular addition of > the -list-target-features command back then (if you remember). Also, > what happens today when you start "M-x gdb" with a modern version of > GDB that does support target-async and non-stop mode. > > The root cause that "C-x C-a C-b" doesn't work in the OP is that > gud-break (and any other command defined via gud-def) does nothing > when gud-running is non-nil. This needs to be changed if we are > running the program in the background, but the question is how to know > that reliably, and that is related -list-target-features, among other > things. > > TIA > > > >