help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debug Fortran 90 code in Emacs with arguments.


From: Hongyi Zhao
Subject: Re: Debug Fortran 90 code in Emacs with arguments.
Date: Tue, 5 Apr 2022 21:00:31 +0800

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]