From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Debug Fortran 90 code in Emacs with arguments.
Date: Tue, 5 Apr 2022 21:00:31 +0800 [thread overview]
Message-ID: <CAGP6POKVaxOg-o5fTrcm_xiRHMzcJKJ07NF5pJDLOskCJWDwLA@mail.gmail.com> (raw)
In-Reply-To: <CAGP6POKy-XPwbJZ95VsBJkOgtp1-teiq3c5=GG9nrR8YgJ43iQ@mail.gmail.com>
On Tue, Apr 5, 2022 at 8:57 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, Apr 5, 2022 at 7:18 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > 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`.
Then I see the following setting in minibuffer, and I just hit RET to use it:
gdb -i=mi gfotran
>
> 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 <http://gnu.org/licenses/gpl.html>
> 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:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
>
> 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 <http://gnu.org/licenses/gpl.html>
> 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:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
>
> 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 <http://gnu.org/licenses/gpl.html>
> 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:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
>
> 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 <hongyi.zhao@gmail.com>
> Theory and Simulation of Materials
> Hebei Vocational University of Technology and Engineering
> No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
next prev parent reply other threads:[~2022-04-05 13:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 2:27 Debug Fortran 90 code in Emacs with arguments Hongyi Zhao
2022-04-05 11:18 ` Eli Zaretskii
2022-04-05 12:57 ` Hongyi Zhao
2022-04-05 13:00 ` Hongyi Zhao [this message]
2022-04-05 13:19 ` Eli Zaretskii
2022-04-05 13:23 ` Eli Zaretskii
2022-04-05 13:52 ` Hongyi Zhao
2022-04-05 14:02 ` Eli Zaretskii
2022-04-05 14:14 ` Hongyi Zhao
2022-04-05 14:19 ` Hongyi Zhao
2022-04-05 15:52 ` Eli Zaretskii
2022-04-06 1:46 ` Hongyi Zhao
2022-04-06 2:32 ` Eli Zaretskii
2022-04-06 3:02 ` Hongyi Zhao
2022-04-06 2:26 ` Hongyi Zhao
2022-04-06 10:50 ` Eli Zaretskii
2022-04-06 13:05 ` Hongyi Zhao
2022-04-06 14:12 ` Eli Zaretskii
2022-04-06 14:42 ` Hongyi Zhao
2022-04-06 15:42 ` Eli Zaretskii
2022-04-07 2:02 ` Hongyi Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGP6POKVaxOg-o5fTrcm_xiRHMzcJKJ07NF5pJDLOskCJWDwLA@mail.gmail.com \
--to=hongyi.zhao@gmail.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).