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 10:26:11 +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" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19302"; 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 04:26:52 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 1nbvNj-0004rQ-PM for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 06 Apr 2022 04:26:51 +0200 Original-Received: from localhost ([::1]:39966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbvNi-0003gE-Ck for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 22:26:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbvNL-0003g5-T2 for help-gnu-emacs@gnu.org; Tue, 05 Apr 2022 22:26:27 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:43917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbvNK-0000ge-1c; Tue, 05 Apr 2022 22:26:27 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id b24so934576edu.10; Tue, 05 Apr 2022 19:26:25 -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; bh=5i4aNxDCbdDPubSfZmU+vZdYgldCy7T9dtCkm8kgqgM=; b=OTrJssyG81H/UjXzM621QP6vaoRvICbsQgxO4RWBhx0BR5Bw048IOFqv5T/cK5u+ih MnZlbS1DnNSryz5V0GdFAJMv3bIohjYUImCE8WT1sx5BIfUuEiaTBZQLdaS4+4FYEsk/ w+2eQMIprSNynm3hqWqxc+3raf5lbXQH42oF0PUvmSFuFTYY3AwcEtpxdEBv9J+8DTQI WW4QT3tN0hoxulwpHx4ym/r+BUjS/57WN2+zgKPXEVqSXQRhIjIg4bNWcAlxUZzpP4kh NiPho7GZDxY4MfFDf5GEbaNH8ImVzrTxbR69fQDQHGBJFo2Bvc6dkHmbzmQZhaP+z39p sgcA== 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; bh=5i4aNxDCbdDPubSfZmU+vZdYgldCy7T9dtCkm8kgqgM=; b=aq6Kn2z8oL+sFytnzYx5Gany00z57/K+AwR0g1H+TIK7MCQBOgjQfS3S24qZz5Cfbb BTPXo83dxF2mVvL+aSnCGZid1N+mhTbgx8+IPU+2lkf3lmrdRtuFAh2pVjJPUvWAijYY 5VFpUgR9guRErFz3ln+dxKiULQUAnuGXQ4HEDZ/LO2ElEMbhBxAkYPVzK3Oe+1d2TLRJ ufEPg11KAsIlGDOLU13XFHcqMnUD1l97qtEXvrgxAU8sQ4HMfQbX16Xbf6bFq+HWW3CC ZJsGROJpBxd8rmEwXfvNvBpfaUviBXdcVWok1B0HWpVuvNX5vpckjBTxKNqfN6iSPSCx W5aw== X-Gm-Message-State: AOAM530TzPOw6HX3P32roWlb3NYMPO23CNvMmS/bxn5T0lHIQ6enmEN7 LTtqLx02X8JzZFHZKJvjzg0XLhwOgsS72SzHxY1uv6orZWKwDQ== X-Google-Smtp-Source: ABdhPJzLanpOJfG+jouhl2dmb6dkFmGoOrmpmhcDdnFG0z7klY7jmBjZ521l+SnE4SAbPUOAVK2mqIr/mdsATXxXEJw= X-Received: by 2002:a05:6402:1d4a:b0:419:7c50:dcbf with SMTP id dz10-20020a0564021d4a00b004197c50dcbfmr6473177edb.340.1649211983510; Tue, 05 Apr 2022 19:26:23 -0700 (PDT) In-Reply-To: <831qybedeg.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=hongyi.zhao@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 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, URI_DOTEDU=1.246 autolearn=no 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:136872 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=mi 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=mi ./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=mi --args ./bin/Debug/bilbao_read 1 2 I have understood by and large the usage of GDB within Emacs, based on a brief introduction here [1]. BTW, the above introduction says the following: ``` Set a breakpoint by going to the source line of the program you're debugging, and typing: C-x [space] (That's the space bar.) GDB will tell you that you've just set a breakpoint. ``` But I noticed the following key binding by running `C-h k C-x [space] RET` on my machine: ``` rectangle-mark-mode is an autoloaded, interactive and compiled function defined in rect.el.gz. Signature (rectangle-mark-mode &optional ARG) Documentation Toggle the region as rectangular. This is a minor mode. If called interactively, toggle the Rectangle-Mark mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate rectangle-mark-mode. The mode's hook is called both when the mode is enabled and when it is disabled. Activates the region if needed. Only lasts until the region is deactivated. View in manual Key Bindings ctl-x-map SPC global-map C-x SPC ``` [1] https://courses.cs.washington.edu/courses/cse378/97au/help/gdb-emacs.html Regards, Hongyi