From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 04 20:13:44 2023 Received: (at submit) by debbugs.gnu.org; 5 Mar 2023 01:13:44 +0000 Received: from localhost ([127.0.0.1]:38117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYcwa-0003Gw-Bl for submit@debbugs.gnu.org; Sat, 04 Mar 2023 20:13:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:36428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYcwY-0003Go-An for submit@debbugs.gnu.org; Sat, 04 Mar 2023 20:13:42 -0500 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 1pYcwX-000840-SX for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2023 20:13:41 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYcwV-0006lH-Qi for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2023 20:13:41 -0500 Received: by mail-wm1-x330.google.com with SMTP id az36so3682021wmb.1 for ; Sat, 04 Mar 2023 17:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677978818; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=88ve/CptuCioRsBjC5O4dJQozJbN7HU+iF84f2FDGBA=; b=Rw5R9HlpNLqBNbVlsoErmHoEDdPM0Y+/6FVRZ/vVlGK6k/nTH5t0Bb/m4aS4ms6cEU 3sfn217uKaIgE8W91uFFO4eGd1m8UEwqGgF4ZC6IcidWLkwQKi9tm4YxhfRmYFK2gxps eCEx3Pb8Av5hyHBRC0z0FID/KUva7d3Lowu2NIuL/0CqOx1MHPSAfE7CXVcwxQukBdOT LDyGr5aoxjsWb1ojSLUI9i/ixQLYkhWWUVd1QTB2oIL7V4ZwKHM4mOmeik5CGOzvOvxT xKeXYSY9RyNtiy5OHrU25LfGm3e4K1dfpCZ/Yo2jdyvQGt6BlUbKF8gE1RWxaJ0Xgil/ syZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677978818; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=88ve/CptuCioRsBjC5O4dJQozJbN7HU+iF84f2FDGBA=; b=3Zm/GssvHLPyOdeNpSxuC1GhAnguVhChfafCyaJhnD08/er7q81O756KhhBNGNJKVU khXw4Y6iP5kUQtYRdWsjVMCbwj8169bvvIgDXHtf+lll+TvyItT6OhcCVi19AXCjg2BG ZsZ6CPUm+osUErz9SMy/7GbvPyBHMWwvZE+ZXasAGCMfMHi66LDA/YLM6nF0nHebF6EN P6alScUiw+IlWD8R9Xv73ZwK+oZ9yeR4pjoGa0DvywJTtZOYKyryhxSWPqPVCMh2Bkq3 jOlgrYnKvl16M0cgSscpbYI5soZGOKdXdR+FzVF7AQMPqWEKYadA2Yrdk2ofFCudiLGs n5Qw== X-Gm-Message-State: AO0yUKUEQR0gR0Zoi+NF9Kvl03Hmz5/0TNub4QjGsSU4Ev/I8upU2dK3 Y6hkNdQ3IKrWpRvHbN2g9tr4xRkJS6M= X-Google-Smtp-Source: AK7set+Xdmo796qsmz7bXf32Uf9asPQQDGfsM4oJbCXy4r0vT46vJGwsShHdQW9EuOZ/DgOOcniNEA== X-Received: by 2002:a05:600c:19d4:b0:3df:3bd6:63e5 with SMTP id u20-20020a05600c19d400b003df3bd663e5mr5428737wmq.12.1677978817729; Sat, 04 Mar 2023 17:13:37 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id r9-20020a05600c458900b003e1f6e18c95sm10795805wmo.21.2023.03.04.17.13.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Mar 2023 17:13:37 -0800 (PST) Message-ID: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> Date: Sun, 5 Mar 2023 03:13:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: Dmitry Gutov Subject: M-x gdb ends up with infinite prompts before starting the process Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=raaahh@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) 1. Run compiled 'emacs' from 'src'. 2. M-x gdb 3. Answer prompt: Run gdb (like this): gdb -i=mi ./emacs 4. See this prompt repeated indefinitely, no matter what I answer: This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.ubuntu.com Enable debuginfod for this session? (y or [n]) Please answer y or [n]. (Emacs 29, more or less latest.) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 05 03:05:12 2023 Received: (at 61973) by debbugs.gnu.org; 5 Mar 2023 08:05:12 +0000 Received: from localhost ([127.0.0.1]:38362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYjMl-0006NB-Jn for submit@debbugs.gnu.org; Sun, 05 Mar 2023 03:05:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYjMk-0006Mu-9N for 61973@debbugs.gnu.org; Sun, 05 Mar 2023 03:05:10 -0500 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 1pYjMe-0002Gp-D9; Sun, 05 Mar 2023 03:05:04 -0500 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=WrtH6R2ZE7RCrtf5r2jRXMGSL78eEA2r6AGkBERjTvs=; b=W9C4E5qoiLIM +fWbhh/hOQoxmWuWkM/s97If/ntbcIVk4OTXoiGi3N4vxEvXyq2OVhLcPRFoMAwG17TvCNDKP/8Ss Y4i/Gu1DbEaXXfJ8mBE6X4bANpmcZ8q0eI4+0Y4qpBH0EkLbqlNe5F07wqfQJSQftMyFQsm9zX283 b2ysKXTlZBCdWxjGsVxsae/Dw7edUlVe4fuaV1McCeRxcXcL+iifpaK4Ee+GW4aQmrSIHaFiz4Prv GGysZFO7rf8ffs+JjoJvQon3VSN3Pol0PPbWmwFUCMLq18hDj7En4g57JT5I4/jtZvQI91LpMR9Yx fhR+JT/PxJMHuJDwsnDgdQ==; 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 1pYjMZ-0005i7-Gc; Sun, 05 Mar 2023 03:05:03 -0500 Date: Sun, 05 Mar 2023 10:04:43 +0200 Message-Id: <83v8jf8vz8.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> (message from Dmitry Gutov on Sun, 5 Mar 2023 03:13:35 +0200) Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 5 Mar 2023 03:13:35 +0200 > From: Dmitry Gutov > > 1. Run compiled 'emacs' from 'src'. > 2. M-x gdb > 3. Answer prompt: Run gdb (like this): gdb -i=mi ./emacs > 4. See this prompt repeated indefinitely, no matter what I answer: > > This GDB supports auto-downloading debuginfo from the following URLs: > https://debuginfod.ubuntu.com > Enable debuginfod for this session? (y or [n]) Please answer y or [n]. > > (Emacs 29, more or less latest.) What GDB version is that? If this is a recent problem, did it start happening because you upgraded to a newer GDB version? By "no matter what I answer, do you mean you tried both "y RET" and "n RET", and the question is repeated regardless? I don't have access to a system with a new enough GDB where debuginfod is enabled, so I need you to please test the possible solutions. First, if you invoke GDB from the shell's prompt in the same way, i.e. $ gdb -i=mi ./emacs does it then ask the same question? And if you then type "y RET", does it stop asking, and does debugging Emacs then works as expected? Can you show me the entire output of this session invoked from the shell's prompt, up to and including the reaction to your "y RET" response? Next, can you enable gdb-enable-debug minor mode, and post the contents of gdb-debug-log (formatted with pp, please) after these questions are asked and you answer them? Finally, if you add the following line to your ~/.gdbinit, does the problem go away? set debuginfod enabled on (If you don't have a ~/.gdbinit file, create it and add this single line to it.) With this line, GDB should not ask the question at all. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 05 08:19:00 2023 Received: (at 61973) by debbugs.gnu.org; 5 Mar 2023 13:19:00 +0000 Received: from localhost ([127.0.0.1]:38734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYoGR-0000Fa-7b for submit@debbugs.gnu.org; Sun, 05 Mar 2023 08:19:00 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:46598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYoGO-0000F9-It for 61973@debbugs.gnu.org; Sun, 05 Mar 2023 08:18:57 -0500 Received: by mail-wr1-f44.google.com with SMTP id bw19so6283457wrb.13 for <61973@debbugs.gnu.org>; Sun, 05 Mar 2023 05:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678022330; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=JPmQQ51ukJcoX9mmotjNF5I4IBaTZYBpUubFjJWliw8=; b=JC62eurD31TKP+bVnZbnBJlKowDl1tImhWDYktSO/JNZOUQHFbh+bZBhrAaRyH8isI NJB9MpUEKmM1CFF4FXNNe35eL1hECvBUgR93/rLUBj+FOnG054wrZTOwGKfM/gYpbvLM By3bITwJI2cldXxk3mYKpNHCDPoulciw0wvWVBZgbq8oQOZ0b773O3d9y1xCMVaba257 OuMydCMN+nGV8FAO0PloGs6eCX50jDc0sZZIOdJ+A6U2EhwBK6WNW1amIZwhdqpyuJBg EUZMmyR4ZWhaukXeLw3EylqyEpGtKB5ql+MjtyErn23dRu+lSDKarCkvtEJ3g0mBrWsx dVsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678022330; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JPmQQ51ukJcoX9mmotjNF5I4IBaTZYBpUubFjJWliw8=; b=KWs9I53IQDsl9NNu8/ckjh3nhaTLuIoB8BWQDgBGHtrq16bBfRHh6gL4WTpAx9EtTA 1a3Sjw1e7YNOUJMpZ85ctdpDPkPe2b1GW48mdyA70XK0KBJ9M2xPV6NCaieMLCOakmVQ St+bjEecmWEpczKdPRjHIeJiCxT1YG0gq0DXEHtet5M8Rlj6fCQuthRQuMYzhtNtwOha c04N6GMDGsy/8rgPM1LHNJttTHqe7IDa5Khyamyhc4lwTEVnI6oF0JQyu82+FhrtUEtv cmqt+EX7+eGBD/WlbgYH9dnUWN/otxzMN6nkfRV+rKwvaRTBhs2ALDNEEt70Xuw4NDMf iWyw== X-Gm-Message-State: AO0yUKV3kTNk10eYDVFTqaV1JTyMG8vvrPmnUDTHWT/4JCeq1PHM0Meg L+UP68qe2WEbk3Pi31j43Z4= X-Google-Smtp-Source: AK7set/jftMXTTSAHR4zTFBSCn2feCD+h68TTk4WvgMkOQSRnCl0niPgkfevRYtRsrWxS5lL1Gjpsw== X-Received: by 2002:a5d:5917:0:b0:2c7:69b:317f with SMTP id v23-20020a5d5917000000b002c7069b317fmr4957528wrd.60.1678022330126; Sun, 05 Mar 2023 05:18:50 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j6-20020a05600c42c600b003eb192787bfsm7535059wme.25.2023.03.05.05.18.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Mar 2023 05:18:49 -0800 (PST) Message-ID: <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> Date: Sun, 5 Mar 2023 15:18:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process Content-Language: en-US To: Eli Zaretskii References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83v8jf8vz8.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 05/03/2023 10:04, Eli Zaretskii wrote: >> Date: Sun, 5 Mar 2023 03:13:35 +0200 >> From: Dmitry Gutov >> >> 1. Run compiled 'emacs' from 'src'. >> 2. M-x gdb >> 3. Answer prompt: Run gdb (like this): gdb -i=mi ./emacs >> 4. See this prompt repeated indefinitely, no matter what I answer: >> >> This GDB supports auto-downloading debuginfo from the following URLs: >> https://debuginfod.ubuntu.com >> Enable debuginfod for this session? (y or [n]) Please answer y or [n]. >> >> (Emacs 29, more or less latest.) > > What GDB version is that? If this is a recent problem, did it start > happening because you upgraded to a newer GDB version? $ gdb --version GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1 I never really use 'M-x gdb', all the time before I just used it from the terminal. But I saw some recent GDB related post on Reddit where you asked for bug reports and decided to give it a try. What I _can_ say, though, is that Emacs 25-28 all behave the same way. All that as long as my src/.gdbinit is added with add-auto-load-safe-path in ~/.config/gdb/gdbinit. Without it, 'M-x gdb' can start Emacs, but then all the special commands are unavailable, of course. > By "no matter what I answer, do you mean you tried both "y RET" and > "n RET", and the question is repeated regardless? That's right. > I don't have access to a system with a new enough GDB where debuginfod > is enabled, so I need you to please test the possible solutions. > > First, if you invoke GDB from the shell's prompt in the same way, > i.e. > > $ gdb -i=mi ./emacs > > does it then ask the same question? And if you then type "y RET", > does it stop asking, and does debugging Emacs then works as expected? It only stops at prompt, in which I'm supposed to input 'run -Q'. After I do that, it doesn't ask me anything anymore. There is a lot of input there, but these lines look relevant (see the end): (gdb) run -Q &"run -Q\n" ~"Starting program: /home/dgutov/vc/emacs/src/emacs -Q\n" =thread-group-started,id="i1",pid="1352423" =thread-created,id="1",group-id="i1" =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555a5522",func="terminate_due_to_signal",file="emacs.c",fullname="/home/dgutov/vc/emacs/src/emacs.c",line="426",thread-groups=["i1"],times="0",original-location="terminate_due_to_signal"} =breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555699f70",func="x_error_quitter",file="xterm.c",fullname="/home/dgutov/vc/emacs/src/xterm.c",line="26119",thread-groups=["i1"],times="0",original-location="x_error_quitter"} =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7fc80a0",to="0x00007ffff7ff0465"}] ~"Debuginfod has been enabled.\nTo make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.\n" ^running *running,thread-id="all" > Can you show me the entire output of this session invoked from the > shell's prompt, up to and including the reaction to your "y RET" > response? $ gdb emacs GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from emacs... warning: File "/home/dgutov/vc/emacs-28/src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/home/dgutov/vc/emacs/src/.gdbinit:/home/dgutov/vc/emacs-master/src/.gdbinit". To enable execution of this file add add-auto-load-safe-path /home/dgutov/vc/emacs-28/src/.gdbinit line to your configuration file "/home/dgutov/.config/gdb/gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/dgutov/.config/gdb/gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" (gdb) run -Q Starting program: /home/dgutov/vc/emacs-28/src/emacs -Q This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.ubuntu.com Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". (emacs:1350264): dbind-WARNING **: 14:41:06.146: Couldn't connect to accessibility bus: Failed to connect to socket /root/.cache/at-spi/bus_1: Permission denied [New Thread 0x7ffff0dff6c0 (LWP 1350270)] [New Thread 0x7fffebfff6c0 (LWP 1350271)] [New Thread 0x7fffeb7fe6c0 (LWP 1350272)] [New Thread 0x7fffeaffd6c0 (LWP 1350273)] [Thread 0x7fffeaffd6c0 (LWP 1350273) exited] [New Thread 0x7fffeaffd6c0 (LWP 1350274)] [New Thread 0x7fffea7fc6c0 (LWP 1350275)] [Thread 0x7fffeaffd6c0 (LWP 1350274) exited] [Thread 0x7fffea7fc6c0 (LWP 1350275) exited] [New Thread 0x7fffea7fc6c0 (LWP 1350276)] > Next, can you enable gdb-enable-debug minor mode, and post the > contents of gdb-debug-log (formatted with pp, please) after these > questions are asked and you answer them? Seems to be pretty-printed already (note that I only pressed 'y' twice): ((recv . "~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ") (mi-send . #("-interpreter-exec console \"y\" " 27 28 (fontified t))) (recv . "~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ") (mi-send . #("-interpreter-exec console \"y\" " 27 28 (fontified t))) (recv . "~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ") (send-item "17-list-target-features" gdb-check-target-async) (send-item "16-gdb-set target-async 1" ignore) (send-item "15-break-list" #f(compiled-function (&rest args) #)) (send-item "14-thread-info" #f(compiled-function (&rest args) #)) (recv . "~\"Breakpoint 2 at 0x145f70: file xterm.c, line 26119.\\n\" =breakpoint-created,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000145f70\",func=\"x_error_quitter\",file=\"xterm.c\",fullname=\"/home/dgutov/vc/emacs/src/xterm.c\",line=\"26119\",thread-groups=[\"i1\"],times=\"0\",original-location=\"x_error_quitter\"} (gdb) 1^done (gdb) 2^done (gdb) 3^done (gdb) 4^done (gdb) 5^done (gdb) ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ~\"Please answer y or [n].\\n\" ~\"\\nThis GDB supports auto-downloading debuginfo from the following URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this session? (y or [n]) \" ") (recv . "=cmd-param-changed,param=\"print pretty\",value=\"on\" =cmd-param-changed,param=\"print sevenbit-strings\",value=\"on\" ~\"DISPLAY = :1\\n\" ~\"TERM = dumb\\n\" =breakpoint-created,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000051522\",func=\"terminate_due_to_signal\",file=\"emacs.c\",fullname=\"/home/dgutov/vc/emacs/src/emacs.c\",line=\"426\",thread-groups=[\"i1\"],times=\"0\",original-location=\"terminate_due_to_signal\"} ") (recv . "~\"SIGINT is used by the debugger.\\nAre you sure you want to change it? \" ~\"(y or n) [answered Y; input not from terminal]\\n\" ") (recv . "=cmd-param-changed,param=\"directories\",value=\"/home/dgutov/vc/emacs/src/../lwlib:$cdir:$cwd\" ") (recv . "~\"Reading symbols from emacs...\\n\" ") (recv . "=thread-group-added,id=\"i1\" ~\"GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1\\n\" ~\"Copyright (C) 2022 Free Software Foundation, Inc.\\n\" ~\"License GPLv3+: GNU GPL version 3 or later \\nThis is free software: you are free to change and redistribute it.\\nThere is NO WARRANTY, to the extent permitted by law.\" ~\"\\nType \\\"show copying\\\" and \\\"show warranty\\\" for details.\\n\" ~\"This GDB was configured as \\\"x86_64-linux-gnu\\\".\\n\" ~\"Type \\\"show configuration\\\" for configuration details.\\n\" ~\"For bug reporting instructions, please see:\\n\" ~\".\\n\" ~\"Find the GDB manual and other documentation resources online at:\\n .\" ~\"\\n\\n\" ~\"For help, type \\\"help\\\".\\n\" ~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\"...\\n\" ") (send-item "13-break-list" #f(compiled-function (&rest args) #)) (send-item "12-thread-info" #f(compiled-function (&rest args) #)) (send-item "11-break-list" #f(compiled-function (&rest args) #)) (send-item "10-thread-info" #f(compiled-function (&rest args) #)) (send-item "9-stack-info-frame" gdb-frame-handler) (send-item "8-gdb-show prompt" gdb-get-prompt) (send-item "7-file-list-exec-source-file" gdb-get-source-file) (send-item "6-file-list-exec-source-files" gdb-get-source-file-list) (send-item "5-enable-frame-filters" ignore) (send-item "4-enable-pretty-printing" ignore) (send-item "3-gdb-set non-stop 1" gdb-non-stop-handler) (send-item "2-gdb-set height 0" ignore) (send-item "1-inferior-tty-set /dev/pts/10" ignore)) > Finally, if you add the following line to your ~/.gdbinit, does the > problem go away? > > set debuginfod enabled on That helps. 'set debuginfod enabled off' also works. > (If you don't have a ~/.gdbinit file, create it and add this single > line to it.) With this line, GDB should not ask the question at all. I had to use ~/.config/gdb/gdbinit, on account of its existence. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 05 10:19:30 2023 Received: (at 61973) by debbugs.gnu.org; 5 Mar 2023 15:19:30 +0000 Received: from localhost ([127.0.0.1]:40326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYq93-0003ih-KP for submit@debbugs.gnu.org; Sun, 05 Mar 2023 10:19:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYq91-0003iD-DO for 61973@debbugs.gnu.org; Sun, 05 Mar 2023 10:19:28 -0500 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 1pYq8v-0004DB-QU; Sun, 05 Mar 2023 10:19:21 -0500 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=453cxqQ5smdRHQufGPaskV2iy87KcGup9L4t99fUBBg=; b=T+loX0IuOZBd ZBZFmAF2OAz47t6S8KTe15V+JZLPA0an6eFsYNzl6UFOKxtU+d4xIgfTQcwau0l3APIJb8OkUCO+7 ChNUi2j2NyaM3VkBpJoILVKIFfF7PrJCmLekD9ApA9JyOK+xyjFb1TIE8D4nQrpTJxzNNjTjKOQ5Z CADmUAIRmmAUu1trJYNduuK//23a1Hj4+VlOJkxEU5LYRGFX/uvcczlbNpPigu3QhSCyyMGRZ56TI pnxoaFlcL/vQpNSDmED11MHu5OBLhCw5orhx9VT4yPUtOhPpkfgi8JA/orTqMAxu8gveS/5UuvQdF SbNUd2K6FHfdKvn4TD8RxA==; 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 1pYq8v-0003xE-9m; Sun, 05 Mar 2023 10:19:21 -0500 Date: Sun, 05 Mar 2023 17:19:13 +0200 Message-Id: <83jzzv8bv2.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> (message from Dmitry Gutov on Sun, 5 Mar 2023 15:18:48 +0200) Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 5 Mar 2023 15:18:48 +0200 > Cc: 61973@debbugs.gnu.org > From: Dmitry Gutov > > > Next, can you enable gdb-enable-debug minor mode, and post the > > contents of gdb-debug-log (formatted with pp, please) after these > > questions are asked and you answer them? > > Seems to be pretty-printed already (note that I only pressed 'y' twice): > > ((recv . "~\"Please answer y or [n].\\n\" > ~\"\\nThis GDB supports auto-downloading debuginfo from the following > URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this > session? (y or [n]) \" > ") > (mi-send . > #("-interpreter-exec console \"y\" > " 27 28 > (fontified t))) > (recv . "~\"Please answer y or [n].\\n\" > ~\"\\nThis GDB supports auto-downloading debuginfo from the following > URLs:\\nhttps://debuginfod.ubuntu.com \\nEnable debuginfod for this > session? (y or [n]) \" > ") > (mi-send . > #("-interpreter-exec console \"y\" > " 27 28 > (fontified t))) Thanks. This confirms my suspicion: we don't recognize the situation where GDB waits for a response, and interpret your "y" response as a GDB command. So we send it as a command: that's what the "-interpreter-exec console" thing is about. So GDB waits for "y" or "n", but gets "-interpreter-exec console \"y\"". We need to teach gdb-mi.el to recognize these prompts. Will look into that. > > Finally, if you add the following line to your ~/.gdbinit, does the > > problem go away? > > > > set debuginfod enabled on > > That helps. 'set debuginfod enabled off' also works. Yes, anything other than "ask" (which is the default). This will serve as a workaround until the solution is found and installed. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 05 10:26:19 2023 Received: (at 61973) by debbugs.gnu.org; 5 Mar 2023 15:26:19 +0000 Received: from localhost ([127.0.0.1]:40332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYqFe-0003mn-Nn for submit@debbugs.gnu.org; Sun, 05 Mar 2023 10:26:19 -0500 Received: from mail-wr1-f53.google.com ([209.85.221.53]:43595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYqFc-0003mX-Rq for 61973@debbugs.gnu.org; Sun, 05 Mar 2023 10:26:17 -0500 Received: by mail-wr1-f53.google.com with SMTP id e13so6460549wro.10 for <61973@debbugs.gnu.org>; Sun, 05 Mar 2023 07:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678029971; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=4Th3FylB2juJndWTU4gIiKQCIzhIeVSMI1exTLU16do=; b=BySV0S9iPFkPyTYet/T7F/9T49Rad1i4haeCgtZKUS2r+qjcZm0bgPlMZq53AK293v 1WbGiKHXs/KD37LClypK74aCxjjhIHQLP1vtGfNzDqxF8eHuVrPYo93e8mSfUs+MjH1T EQJWUgHlGdEsuM0Bk4z/o6L3H7z9ldvYmPJY9ywN5oYDnT9xPy2IftLKBWO2SxZWIwoC IaBVPW0J34Id4rCHOeEPIL0Vz62IAQEmv9Q/IkprCUY1fcv0F7KO0DpSpjOm5FNaBsdk VW68LHn5+jmDgX/eixRIHpHLWTSc3ENx6GJ9DSYgnFrTs7Bfh16xxYf7FXlK5pZ83gYT p7Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678029971; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4Th3FylB2juJndWTU4gIiKQCIzhIeVSMI1exTLU16do=; b=jv+fnDDmHOznvSA13DTVNYyhwXSwH5pAb8EwZ6q2Ip0/dkR97WRp96O727nPo/XjKa LZh2YBGe/UjauvDcYkohfjY3oR1vzsnDezD9tHF40vwj4pjW/1L+sHd/OnHnxSQ2WKz1 JZLg9ES6YLTcSXuz1xLmmTao7BIyUaWmzeSq/s1vNLsXixM5ySj/8fIlp4eY7ahgt3Ml PD12qAbVZeWw5ScjkFtdJHu85RSLmGCj3UrU7DmWs8OsryQcocxQIo3QJkcU8UeGsamC 1ZxhphP0Z/NItTvRIn6zRJCXwzkXV2O2KSHGFw4iFge4UbAiLAeKcqk/g51z5GrQmmvk h9kA== X-Gm-Message-State: AO0yUKVASfkfyWv8FYVS4XfETLckfkBN85gYNv7LbvOpmVqtTWGdSrA4 n2nwzNKB3XlDgxYrpgtUBoI= X-Google-Smtp-Source: AK7set9gdrSW3NKU5F2k0lOgHTEHk74ghyIjalB+W9mxWx49Mj8RhhNyQbGB9++wInuq46Hy7+B6vA== X-Received: by 2002:adf:f3cd:0:b0:2c7:1d0d:7184 with SMTP id g13-20020adff3cd000000b002c71d0d7184mr5476902wrp.11.1678029970779; Sun, 05 Mar 2023 07:26:10 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id e17-20020a5d4e91000000b002c559626a50sm7773819wru.13.2023.03.05.07.26.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Mar 2023 07:26:10 -0800 (PST) Message-ID: <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> Date: Sun, 5 Mar 2023 17:26:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process Content-Language: en-US To: Eli Zaretskii References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> <83jzzv8bv2.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83jzzv8bv2.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 05/03/2023 17:19, Eli Zaretskii wrote: > This confirms my suspicion: we don't recognize the situation > where GDB waits for a response, and interpret your "y" response as a > GDB command. First of all, though, it sends the debuginfod-related prompt to me 12 times. I'm guessing that's because there is some scenario running internally that tries to send some other commands to GDB while it's waiting for a particular response (y/n), so it repeats the question 11 times instead of reacting to those commands. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 13:23:11 2023 Received: (at 61973) by debbugs.gnu.org; 6 Mar 2023 18:23:12 +0000 Received: from localhost ([127.0.0.1]:43600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZFUN-0008C0-Fh for submit@debbugs.gnu.org; Mon, 06 Mar 2023 13:23:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZFUL-0008Bn-Nc for 61973@debbugs.gnu.org; Mon, 06 Mar 2023 13:23:10 -0500 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 1pZFUG-0006vH-AW; Mon, 06 Mar 2023 13:23:04 -0500 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=ArHOCWz+dQMm4NOD2KaUnF74oQcbEq201lBzDpXXVRM=; b=RAdIH2OiY8PF up0l66uQfnf9xeKAsQn7U2MTqYZrRu5StdxDZ6uKtGXVl21ubZJ7PKu7DVwf0EMu/u6i0xcCpZwkW 7v907WtNMW0ukcntCcyi/5hB7kblP4IU+Cu4wP9o1pbKH2fWKwF2f8JyQl1tPCwGNZ5mIZX4GV6UN PNoVUV7lDiqrGkqcz84W4CtTVuGMsA6M46bMe4pjLJ6USeMGnGn/OB8WBhCZykSeeZOBAjYEP+8R7 8Tw6VEvsWQjN8N3IxkN+OnpnXcOhuVUihkRQIedIWRKI5uqq2jvzZjn/uvgJoXyX7Q8himccE2qyC x4wFILKh8SgyJnxoeDGQmA==; 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 1pZFUF-00052T-QJ; Mon, 06 Mar 2023 13:23:04 -0500 Date: Mon, 06 Mar 2023 20:22:57 +0200 Message-Id: <83r0u17n9a.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> (message from Dmitry Gutov on Sun, 5 Mar 2023 17:26:08 +0200) Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> <83jzzv8bv2.fsf@gnu.org> <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 5 Mar 2023 17:26:08 +0200 > Cc: 61973@debbugs.gnu.org > From: Dmitry Gutov > > On 05/03/2023 17:19, Eli Zaretskii wrote: > > This confirms my suspicion: we don't recognize the situation > > where GDB waits for a response, and interpret your "y" response as a > > GDB command. > > First of all, though, it sends the debuginfod-related prompt to me 12 > times. I'm guessing that's because there is some scenario running > internally that tries to send some other commands to GDB while it's > waiting for a particular response (y/n), so it repeats the question 11 > times instead of reacting to those commands. Could you please try the patch below? I don't have access to a system where GDB can actually download the files from debuginfod servers, so I could test this only partially. Please test all the 3 possible values of the new defcustom gdb-debuginfod-enable-setting. TIA. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 8b157dd..dc18938 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -255,6 +255,9 @@ gdb-non-stop It is initialized to `gdb-non-stop-setting' at the beginning of every GDB session.") +(defvar gdb-debuginfod-enable nil + "Whether the current GDB session can query debuginfod servers.") + (defvar-local gdb-buffer-type nil "One of the symbols bound in `gdb-buffer-rules'.") @@ -467,6 +470,26 @@ gdb-non-stop-setting :group 'gdb-non-stop :version "26.1") +(defcustom gdb-debuginfod-enable-setting 'ask + "Whether to enable downloading missing debug info from debuginfod servers. +The debuginfod servers are HTTP servers for distributing source +files and debug info files of programs. If GDB was built with +debuginfod support, it can query these servers when you debug a +program for which some of these files are not available locally, +and download the files if the servers have them. + +The value nil means never to download from debuginfod servers. +The value t means always download from debuginfod servers when +some source or debug info files are missing. +The value `ask', the default, means ask at the beginning of each +debugging session whether to download from debuginfod servers +during that session." + :type '(choice (const :tag "Never download from debuginfod servers" nil) + (const :tag "Download from debuginfod servers when necessary" t) + (const :tag "Ask whether to download for each session" ask)) + :group 'gdb + :version "29.1") + ;; TODO Some commands can't be called with --all (give a notice about ;; it in setting doc) (defcustom gdb-gud-control-all-threads t @@ -1021,6 +1044,11 @@ gdb (run-hooks 'gdb-mode-hook)) +(defconst gdb--string-regexp (rx "\"" + (* (or (seq "\\" nonl) + (not (any "\"\\")))) + "\"")) + (defun gdb-init-1 () ;; (Re-)initialize. (setq gdb-selected-frame nil @@ -1044,7 +1072,8 @@ gdb-init-1 gdb-threads-list '() gdb-breakpoints-list '() gdb-register-names '() - gdb-non-stop gdb-non-stop-setting) + gdb-non-stop gdb-non-stop-setting + gdb-debuginfod-enable gdb-debuginfod-enable-setting) ;; (gdbmi-bnf-init) ;; @@ -1053,6 +1082,15 @@ gdb-init-1 (gdb-force-mode-line-update (propertize "initializing..." 'face font-lock-variable-name-face)) + ;; This needs to be done before we ask GDB for anything that might + ;; trigger questions about debuginfod queries. + (if (eq gdb-debuginfod-enable 'ask) + (setq gdb-debuginfod-enable + (y-or-n-p "Enable querying debuginfod servers for this session?"))) + (gdb-input (format "-gdb-set debuginfod enabled %s" + (if gdb-debuginfod-enable "on" "off")) + 'gdb-debuginfod-message) + (gdb-get-buffer-create 'gdb-inferior-io) (gdb-clear-inferior-io) (gdb-inferior-io--init-proc (get-process "gdb-inferior")) @@ -1080,6 +1118,18 @@ gdb-init-1 (gdb-input "-file-list-exec-source-file" 'gdb-get-source-file) (gdb-input "-gdb-show prompt" 'gdb-get-prompt)) +(defun gdb-debuginfod-message () + "Show in the echo area GDB error response for a debuginfod command, if any." + (goto-char (point-min)) + (cond + ((re-search-forward "msg=\\(\".+\"\\)$" nil t) + ;; Supports debuginfod, but cannot perform command. + (message "%s" (buffer-substring (1+ (match-beginning 1)) + (1- (line-end-position))))) + ((re-search-forward "No symbol" nil t) + (message "This version of GDB doesn't support debuginfod commands.")) + (t (message nil)))) + (defun gdb-non-stop-handler () (goto-char (point-min)) (if (re-search-forward "No symbol" nil t) @@ -1148,11 +1198,6 @@ gdb-create-define-alist (declare-function tooltip-show "tooltip" (text &optional use-echo-area text-face default-face)) -(defconst gdb--string-regexp (rx "\"" - (* (or (seq "\\" nonl) - (not (any "\"\\")))) - "\"")) - (defun gdb-tooltip-print (expr) (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) (goto-char (point-min)) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 17:49:11 2023 Received: (at 61973) by debbugs.gnu.org; 6 Mar 2023 22:49:11 +0000 Received: from localhost ([127.0.0.1]:43904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZJdn-0006fQ-79 for submit@debbugs.gnu.org; Mon, 06 Mar 2023 17:49:11 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:33283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZJdl-0006fA-1s for 61973@debbugs.gnu.org; Mon, 06 Mar 2023 17:49:09 -0500 Received: by mail-wr1-f41.google.com with SMTP id v16so10489236wrn.0 for <61973@debbugs.gnu.org>; Mon, 06 Mar 2023 14:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678142942; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=R8yJHo1ScJWjH1cV8x4oSin36KCjZgLDWu4Hbt3lEGI=; b=mSNd7atSKk1zi+bWCOlTcqii6XS8WFcZRn3C3uwQeMjoronKtbXlIcVBvLmYJxm7Ob VOUI6LzM1o48Pi81LSb3dgHhsW6udbgAKqPsfe0iZ7vyodeI+X303MTIZREG+v9od+GJ ATrhyStA7xvVSszpBBLP5Ykdz5/PktMC5aDv8sFPXU2qUkSkb9OD0DuBskR8e6hxK2sB 1frwHcbjxZhmIxNKyZF0+FAAJuBl7hm05qgb0uKBLb3mAMNYF4f9T54yn36n5OwzoVEs /5+QwshJWEwYHCcOWQB22bAfymCbUSLsokk/sc2cb9cFLZSRyHz1q1GxYEhZr1isd6W1 LpKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678142942; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R8yJHo1ScJWjH1cV8x4oSin36KCjZgLDWu4Hbt3lEGI=; b=AMxXG+UmwdZ755GEXh8IepbxKflT3K+dFTDcL5jYEuaQuYWWzAklxAa4f6L5TAxm1O 1prgA1NcaC+dq7U6VJJpqpYw5lBj3daXG3NTwOMJ4vyZZVtZwSZn+OO7tNwg9Z35annV pWj1b7W2+XoHvfB7rOdV+NGf1+SoSZ16LXXXeaByAsmeQ8h0N8GzYK74eGG/IelyQ4yy GtlvKnTkrCgceY1MNGVFysmBHyVGrIsKlDQLY0yYG4x/JIqJleVpuLo5o/SmbyEa7k0h eihmGtnfPIJmsWlJVBmKBC+4PnymAnOcdW8y8e2i/KlPJouAp/iTNdgBHPBPgGF7UcnQ kvpQ== X-Gm-Message-State: AO0yUKV29hvlgIBP2HVRQdLPjKzGQ9zG774XA/8Jr2lyw7C+KyAeiJz6 IqdfaoKX4SnDfi3rQ2dK+/c= X-Google-Smtp-Source: AK7set8vwLQroI8wMbSoj5TJ5w+yLy8ALZOVC+g6ukDkvlsVt7nA6MQGSko7rWFnmzq6N1PtxjaT5Q== X-Received: by 2002:adf:e302:0:b0:2c5:5ff8:6b02 with SMTP id b2-20020adfe302000000b002c55ff86b02mr8437369wrj.0.1678142942296; Mon, 06 Mar 2023 14:49:02 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id z26-20020a1c4c1a000000b003eb395a8280sm15230644wmf.37.2023.03.06.14.49.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Mar 2023 14:49:01 -0800 (PST) Message-ID: Date: Tue, 7 Mar 2023 00:48:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process Content-Language: en-US To: Eli Zaretskii References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> <83jzzv8bv2.fsf@gnu.org> <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> <83r0u17n9a.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83r0u17n9a.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 61973 Cc: 61973@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 06/03/2023 20:22, Eli Zaretskii wrote: >> Date: Sun, 5 Mar 2023 17:26:08 +0200 >> Cc:61973@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 05/03/2023 17:19, Eli Zaretskii wrote: >>> This confirms my suspicion: we don't recognize the situation >>> where GDB waits for a response, and interpret your "y" response as a >>> GDB command. >> First of all, though, it sends the debuginfod-related prompt to me 12 >> times. I'm guessing that's because there is some scenario running >> internally that tries to send some other commands to GDB while it's >> waiting for a particular response (y/n), so it repeats the question 11 >> times instead of reacting to those commands. > Could you please try the patch below? I don't have access to a system > where GDB can actually download the files from debuginfod servers, so > I could test this only partially. Please test all the 3 possible > values of the new defcustom gdb-debuginfod-enable-setting. TIA. Looking good! Thank you. I have tries all 3 possible values, and the behavior looks as expected. With 't', I even see a small delay when launching the process, presumably from contacting some debuginfo server. I haven't been able to verify that the debuginfo stuff is actually working (nor sure where to look), but the basic functionality is now okay. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 07:49:13 2023 Received: (at 61973-done) by debbugs.gnu.org; 7 Mar 2023 12:49:13 +0000 Received: from localhost ([127.0.0.1]:44739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWkj-0002Mo-86 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWkh-0002Mb-MZ for 61973-done@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:12 -0500 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 1pZWkc-0003z5-Ee; Tue, 07 Mar 2023 07:49:06 -0500 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=NOLb6Lcdu1JKuspDHgIHlD7vhctVLP2LkBCllgiASuw=; b=aCGxBfukBM3r j9+zrjKh4z5EOyUYy18zIsACPtju3BTvu9kmq1/75btQebmLhK/HTBltHOsQZNJXRkhYAp0vJnb6K 9Iv8TfpJcdCRYOAsVIk3eToVb2X+3uAbRltyjdntcrKK41ogRa0rHAa8s7CstL3D337k62icPJxir pUElzffm7Nml6WCnbnWCJyiHQTJCUz7UYEtC91Ud/EunCkwb+Ef+Lqk7Wb3FPzaaI8eZfphk75HIQ 9hXi/ceVw2OmBheZxXJtJ66RloDYq8eGq/BamvRq2cWwWxMt/iQdeek53XrFhrrNXicx3kolcYhxe UZgzBNBJku+iQdITBjApgA==; 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 1pZWkb-0004aI-Uq; Tue, 07 Mar 2023 07:49:06 -0500 Date: Tue, 07 Mar 2023 14:49:02 +0200 Message-Id: <83bkl47mm9.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Tue, 7 Mar 2023 00:48:59 +0200) Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> <83jzzv8bv2.fsf@gnu.org> <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> <83r0u17n9a.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61973-done Cc: 61973-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 7 Mar 2023 00:48:59 +0200 > Cc: 61973@debbugs.gnu.org > From: Dmitry Gutov > > > Could you please try the patch below? I don't have access to a system > > where GDB can actually download the files from debuginfod servers, so > > I could test this only partially. Please test all the 3 possible > > values of the new defcustom gdb-debuginfod-enable-setting. TIA. > > Looking good! Thank you. Thanks, installed, and closing the bug. > I have tries all 3 possible values, and the behavior looks as expected. > With 't', I even see a small delay when launching the process, > presumably from contacting some debuginfo server. > > I haven't been able to verify that the debuginfo stuff is actually > working (nor sure where to look), but the basic functionality is now okay. Apparently, if you do: set debuginfo verbose 1 (probably in your ~/.gdbinit file or somesuch, so that it is set from the beginning of the session), it is supposed to show you messages about downloading. But this is documented to be 1 by default, so maybe you don't see it because gdb-mi.el "swallows" those messages? Try from the shell prompt and see if you get any messages. They are supposed to begin with "Downloading". I think the download will only happen if you debug a program whose sources and/or debug info are not available locally. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 13:27:45 2023 Received: (at 61973-done) by debbugs.gnu.org; 7 Mar 2023 18:27:45 +0000 Received: from localhost ([127.0.0.1]:47161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZc2L-0005nU-0I for submit@debbugs.gnu.org; Tue, 07 Mar 2023 13:27:45 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:37433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZc2I-0005nG-W3 for 61973-done@debbugs.gnu.org; Tue, 07 Mar 2023 13:27:43 -0500 Received: by mail-wm1-f47.google.com with SMTP id j19-20020a05600c1c1300b003e9b564fae9so11057716wms.2 for <61973-done@debbugs.gnu.org>; Tue, 07 Mar 2023 10:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678213656; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=oc/UcK3SfivBmfqhN3VImRPFKpoGpj5dxYJSlKtRKmk=; b=OQJ/2ubm1UKu7B2mR6J7mO0rx14QbxTgfG9gzi6p5nNf9VqXCJIEauwbOAWMz5RlrM 5cnvvvsjT3WmG7bd1qGOZk2qkC/CgxllnuY9AYx/iVnpiM8j6ScAony6JdDCcCE807h6 azIxcMHCrUTFGEdqjdrecRF7+siFQilshss6u5n9xioy8dI2500lsqzLqmSkpVFkT8fZ py71Eua4AEnqRWv1rXnVfRJFKeq2fTr7/nqqJBU0pxG9F/xO4nXMa23RvaKLkyns2LI7 w2V8pk5VZuku/dCYj3ZWAv9i3PmyD4UAd2W2KzXt+Bsiyu/1t+RWli4Ffl+XNjj6aWvf BPKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678213656; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oc/UcK3SfivBmfqhN3VImRPFKpoGpj5dxYJSlKtRKmk=; b=ro/Q+i4h062yNk1bnwCykR2OeK+sqKkKS/xmYzskQHqDh3JUY9mQGGx8djMJNa9iHZ 4G4+x3Dg+P6qF/ur4WyylGbSK2fBI7haSkoKHn6HTIQHc8yX+iuJvoL9XUsxW9N6wxB0 +SI80Z48J3huCxbczPgOk/wKGWaaYnKkuDF0K19FZ35EmEgmpiNb5FgNibERr8W6OKm7 yDPad7Kn2JNLaduVpPleRnOElq7YQkqUmJuyd/PuL9BkumAtNtuWW0qkBJ6PIkwyHd56 3XR19vRcg2Dg35X39rTX++w/y3unkx1T5X/+n+oELt5hZDm9f27EwAae3Gwqdk80nn7V 0ltA== X-Gm-Message-State: AO0yUKVT9/XRLorq/aLdubsZ9GhgEJE+MjxRvttUodnxHCJAPPILKOpH pwWPjzb07R5/7ZDXAjslcxs= X-Google-Smtp-Source: AK7set9gtQ5YBYpYxZD3YhOLoge1y33CGxfxrCIW32BPbGeVfIqnzo82jhxTX+ZMwXkvccGsMt73dA== X-Received: by 2002:a05:600c:4f09:b0:3eb:42fa:39d6 with SMTP id l9-20020a05600c4f0900b003eb42fa39d6mr13292313wmq.14.1678213655710; Tue, 07 Mar 2023 10:27:35 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k19-20020a05600c1c9300b003eb2e33f327sm3537942wms.2.2023.03.07.10.27.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Mar 2023 10:27:35 -0800 (PST) Message-ID: <0a1ca48c-fa4c-4085-bcac-ef5eceb9de50@yandex.ru> Date: Tue, 7 Mar 2023 20:27:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process Content-Language: en-US To: Eli Zaretskii References: <7e2c2b51-f389-191e-9048-4021232a06e6@yandex.ru> <83v8jf8vz8.fsf@gnu.org> <0ad69ade-528f-e14e-1841-66c6967bb672@yandex.ru> <83jzzv8bv2.fsf@gnu.org> <8e3e1bf7-618f-93ec-af09-643b9b49978a@yandex.ru> <83r0u17n9a.fsf@gnu.org> <83bkl47mm9.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83bkl47mm9.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 61973-done Cc: 61973-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 07/03/2023 14:49, Eli Zaretskii wrote: > They are > supposed to begin with "Downloading". I think the download will only > happen if you debug a program whose sources and/or debug info are not > available locally. Indeed, that seems to happen in this case. Thanks. From unknown Fri Sep 19 18:23:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 05 Apr 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator