From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Debug Fortran 90 code in Emacs with arguments. Date: Wed, 6 Apr 2022 09:46:27 +0800 Message-ID: References: <83lewjeq2t.fsf@gnu.org> <838rsjekhe.fsf@gnu.org> <831qybedeg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 06 03:47:08 2022 Return-path: Envelope-to: geh-help-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 1nbulI-0006Qy-6Q for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 06 Apr 2022 03:47:08 +0200 Original-Received: from localhost ([::1]:59658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbulG-0004Kd-Ls for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 21:47:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbukt-0004KE-ME for help-gnu-emacs@gnu.org; Tue, 05 Apr 2022 21:46:43 -0400 Original-Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:35839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbuks-0002z4-2I; Tue, 05 Apr 2022 21:46:43 -0400 Original-Received: by mail-ej1-x633.google.com with SMTP id yy13so1311221ejb.2; Tue, 05 Apr 2022 18:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=O+Q0LqSpH40DVva0CXIzrL8hbdIxb7fHetysb/N9If8=; b=AuG6ukDxjEU/Ugu8bi7YytkQjLQ48zyfPSonVBFhbudHhxrQnE4Yz7uczgewrMS6HR T0v2vQxW90XmWIfi2QW2fSLaJfkGQnPRon/wmTZXj7qSiK8TFd8ARgSn5UpzFbiBWdAP xILHkXf+JYKTFdbmSCv01tCUFA0Z+Hp2Ktx2Z+mPQFVZmfLkcXE/8ql1CBYOl7auoV95 Rb/lPjD96vqvhw37Kk0Y8TnH3T5gqjqIn4FowvGx+6aXQn7jvD9btflGI6H/RrlnvOay gOdibIyTj0jwwfADNueKuKs24mOH9gSp/39tj69qTAcCzJQvoUTIaESFpBg6tjQuzH91 m/uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=O+Q0LqSpH40DVva0CXIzrL8hbdIxb7fHetysb/N9If8=; b=nbi6H4nQiNfZAqD1W7XgYbKvn+J4bJJJmwwljpKvC+T2Z3zU/aEb1G7K4VUZhkj96N yKEAkqK8G9Xtv3V1/911zBL4VS9YBgIYm642Ij6G0BaaKrBLvRSWVpB5CtsiIpWbl7R/ A+hrKEdEUYOcC5snpwUUad8me5bsrN/EPRU7YdJVDQNAHghskA3x7LAEeljXkiyXHD9T AM6VJKxInlcdAWM9u5Ozzu5X93gIuV/MTLwCfRZsGmIKqmSQBijAyCCbhifnypCdqL2v A+0yVWQ2bfrUP6ithV4HvGMgIz4/I1IQm6f7wcOOtQbtQ74OJuDfsZpmKViz8AtLq48I UDOQ== X-Gm-Message-State: AOAM533NDzwCNK1wnK0TQSeFJdcNsjIypZ85D0sFH1LvBSEqFxaOtGz0 iT33uEfuOLPIpC4N990LGFA8Ry4O6O2th8ibkzxd+R0kvzE++g== X-Google-Smtp-Source: ABdhPJwr8LzvCszOAJTpJqXgzTljXAuVYhPyLkoG/iJKqg0xkMa+SiLFypiODoLJR35Ll+q7L4GJMTuK3qlXTkK9aIc= X-Received: by 2002:a17:907:2d9f:b0:6e8:9c:4b13 with SMTP id gt31-20020a1709072d9f00b006e8009c4b13mr6389141ejc.124.1649209599459; Tue, 05 Apr 2022 18:46:39 -0700 (PDT) In-Reply-To: <831qybedeg.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=hongyi.zhao@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136870 Archived-At: On Tue, Apr 5, 2022 at 11:52 PM Eli Zaretskii wrote: > > > From: Hongyi Zhao > > Date: Tue, 5 Apr 2022 22:19:54 +0800 > > Cc: help-gnu-emacs > > > > > > gdb -i=3Dmi gfotran > > > > > > Is 'gfortran' the name of your program's executable file? If not, > > > edit the command to replace "gfortran" with the name of your program'= s > > > executable file. > > > > I tried as follows, but still failed: > > > > M-x gdb RET > > # 1 2 are arguments passed to the program: > > Run gdb (like this): gdb -i=3Dmi ./bin/Debug/bilbao_read 1 2 > > > > Then I encounter the following rather messy information: > > You use a non-trivial tool for the first time, so you should at least > study its --help screen. That's not how you pass command-line > arguments to a program being debugged. You need to use --args: > > gdb -i=3Dmi --args ./bin/Debug/bilbao_read 1 2 This works, but I noticed the following information: Target doesn=E2=80=99t support non-stop mode. Turning it off. Some additional remarks: 1. GDB itself is quite complex to use. Not to mention using it in Emacs. Therefore, it is indeed an extraordinary tool for users who use it for the first time. 2. I figured out the meaning of the above-mentioned options used in the example here, as shown below, found from the info manual: $ info gdb '-interpreter INTERP' Use the interpreter INTERP for interface with the controlling program or device. This option is meant to be set by programs which communicate with GDB using it as a back end. *Note Command Interpreters: Interpreters. '--interpreter=3Dmi' (or '--interpreter=3Dmi3') causes GDB to use the "GDB/MI interface" version 3 (*note The GDB/MI Interface: GDB/MI.) included since GDB version 9.1. GDB/MI version 2 ('mi2'), included in GDB 6.0 and version 1 ('mi1'), included in GDB 5.3, are also available. Earlier GDB/MI interfaces are no longer supported. '--args' Change interpretation of command line so that arguments following the executable file are passed as command line arguments to the inferior. This option stops option processing. But I can't find any explanation that the `-interpreter' can be abbreviated as `-i'. Regards, Hongyi