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: Wed, 6 Apr 2022 09:46:27 +0800

On Tue, Apr 5, 2022 at 11:52 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Tue, 5 Apr 2022 22:19:54 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > > > 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

This works, but I noticed the following information:

Target doesn’t 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=mi' (or '--interpreter=mi3') 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



reply via email to

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