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 22:19:54 +0800

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

```
Current directory is /home/werner/temp/FortranProject/bilbao_read/bin/Debug/
Error: Either -i=mi wasn’t specified on the GDB command line, or the
extra socket couldn’t be established.  Consider using M-x gud-gdb
instead.
Excess command line arguments ignored. (2)
=thread-group-added,id="i1"
~"GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2\n"
~"Copyright (C) 2020 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\nThis is free software: you are
free to change and redistribute it.\nThere is NO WARRANTY, to the
extent permitted by law."
~"\nType \"show copying\" and \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-linux-gnu\".\n"
~"Type \"show configuration\" for configuration details.\n"
~"For bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
~"Find the GDB manual and other documentation resources online at:\n
 <http://www.gnu.org/software/gdb/documentation/>."
~"\n\n"
~"For help, type \"help\".\n"
~"Type \"apropos word\" to search for commands related to \"word\"...\n"
~"Reading symbols from
/home/werner/temp/FortranProject/bilbao_read/bin/Debug/bilbao_read...\n"
~"Attaching to program:
/home/werner/temp/FortranProject/bilbao_read/bin/Debug/bilbao_read,
process 1\n"
&"Could not attach to process.  If your uid matches the uid of the
target\nprocess, check the setting of
/proc/sys/kernel/yama/ptrace_scope, or try\nagain as the root user.
For more details, see /etc/sysctl.d/10-ptrace.conf\n"
&"ptrace: Operation not permitted.\n"
&"/home/werner/temp/FortranProject/bilbao_read/bin/Debug/1: No such
file or directory.\n"
(gdb)
1^done
(gdb)
2^done
(gdb)
3^done
(gdb)
4^done
(gdb)
5^done
(gdb)
6^done,files=[{file="get_command_argument.f90",fullname="/home/werner/temp/FortranProject/bilbao_read/get_command_argument.f90"}]
(gdb)
7^done,line="24",file="get_command_argument.f90",fullname="/home/werner/temp/FortranProject/bilbao_read/get_command_argument.f90",macro-info="0"
(gdb)
8^done,value="(gdb) "
(gdb)
9^error,msg="No registers."
(gdb)
10^done,threads=[]
(gdb)
11^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
12^done,threads=[]
(gdb)
13^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
(gdb)
```

Yours,
Hongyi



reply via email to

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