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: Tue, 5 Apr 2022 20:57:50 +0800 Message-ID: References: <83lewjeq2t.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="26468"; 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 Tue Apr 05 15:05:55 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 1nbisd-0006HE-IO for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 15:05:55 +0200 Original-Received: from localhost ([::1]:48794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbilk-0004gl-Ju for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 08:58:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbil4-0004f8-1N for help-gnu-emacs@gnu.org; Tue, 05 Apr 2022 08:58:06 -0400 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:46769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbil1-0002Wl-TX; Tue, 05 Apr 2022 08:58:05 -0400 Original-Received: by mail-ed1-x535.google.com with SMTP id w18so8533649edi.13; Tue, 05 Apr 2022 05:58:03 -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=Ud/trWWt1KJojk3/aDQvPdk/gUFAGWyOB92nVWYxCYQ=; b=PdoIapeAu4ka4ODmb8Sl5izjpyiZFMXm67M/UGN3hWgvVpjmb8XP8ZJnZvSw4XFftl /MTjshUmqxUmXk4bMboxvC3fgBd4dDp7pQm9mA7jrLE85Or7mr///oHHaSvPAgS4d9rN XbnSgor50e16G8UJuj/tFmXqO03+Tte9c8RqQLzBgvdNgOoMmIyB0Ei8hjcdpDMeAdov hnmcY4W94UPN4Gjl8hqJeoS0Am68Gmnf2gz2nxsNH0naI+n0JaF16ABEvi0obeKYcBqm jI5mj5KoacKn+Ia3q+V0bJnfccnU95Xybj3CSH2KMl2KI22pkEJ5e9VRG4TeIGOpw5c+ GS0g== 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=Ud/trWWt1KJojk3/aDQvPdk/gUFAGWyOB92nVWYxCYQ=; b=UBVGeMAwsgIo4pAxtWQw7ytZQNgIeQkDjgECdieN88Ff4I0alBEIy8rxsyptbSbA5J 25ENOM3u2ASXMtFzop+BbmTF5zQEi6JwsRIbJ2FYOgEJTtSRk2rqKgj8eXaKNpF2I6eA M/RMiWR5flHd1tng4pj6Q/ia3kGB/h0LlqSyWwvW+a4DxUnt7d6Br4YfnpzipmKsJbQc baTELtXjxka9DNvFZIw4Hw6LjWZxAt6w2YG4FQo2IyPYibHcmGJdoV8/xjDXQW66xjIF lsz9g+LMcfJtlC49MV2UNjR5QQFfS+S6Bu2NwKQkwnQy/AWFUql77K/RMgrtJsddOWvC 4Z7A== X-Gm-Message-State: AOAM5305ovJmq8zP148+C7ZMsJP+um6uo4eKJ2nfPULtiMBE5qCGlkHT ZOPmCa00xQ6NlpptJ5aSV1ex7QWtJaULuB05NRESEHjuEBjrqQ== X-Google-Smtp-Source: ABdhPJyVcYBetq7R/GZav0stHQPkvBYL2BCQSy4n4+6Gfs/L2K8ryevvOMOgyLBrxU7gFSrVXcwqZQUT9Ze08aSjj4E= X-Received: by 2002:a05:6402:348b:b0:419:172c:e2aa with SMTP id v11-20020a056402348b00b00419172ce2aamr3477756edc.261.1649163481718; Tue, 05 Apr 2022 05:58:01 -0700 (PDT) In-Reply-To: <83lewjeq2t.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=hongyi.zhao@gmail.com; helo=mail-ed1-x535.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:136853 Archived-At: On Tue, Apr 5, 2022 at 7:18 PM Eli Zaretskii wrote: > > > From: Hongyi Zhao > > Date: Tue, 5 Apr 2022 10:27:41 +0800 > > > > The above code snippet must be run and debug with some arguments, say, > > as follows: > > > > -o 42 -a hello b > > > > So, I want to know how to debug Fortran 90 code in Emacs with arguments. > > Use GDB via the "M-x gdb" Emacs front-end. I tried with the following steps, but still failed to figure it out: 1. $ emacs the_fortran_example.f90 2. In Emacs, issue the command `M-x gdb RET`. At this point, I see the following information: ``` Current directory is ~/temp/FortranProject/bilbao_read/ GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 Copyright (C) 2020 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"... gfotran: No such file or directory. (gdb) exec-file get_command_argument.f90 "/home/werner/temp/FortranProject/bilbao_read/get_command_argument.f90": not in executable format: file format not recognized exit Undefined command: "exit". Try "help". (gdb) q Debugger finished Current directory is ~/temp/FortranProject/bilbao_read/ GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 Copyright (C) 2020 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"... gfotran: No such file or directory. (gdb) q Debugger finished Current directory is ~/temp/FortranProject/bilbao_read/ GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 Copyright (C) 2020 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"... gfotran: No such file or directory. (gdb) ``` How to do next? Regards -- Assoc. Prof. Hongsheng Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province