unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
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 22:19:54 +0800	[thread overview]
Message-ID: <CAGP6POL7OoSXCS5VK5XtvT5NMowPSjgNho5JMXv0-OpX2NebfA@mail.gmail.com> (raw)
In-Reply-To: <838rsjekhe.fsf@gnu.org>

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



  parent reply	other threads:[~2022-04-05 14:19 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
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 [this message]
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=CAGP6POL7OoSXCS5VK5XtvT5NMowPSjgNho5JMXv0-OpX2NebfA@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).