From: Andrew Cagney <ac131313@redhat.com>
To: Nick Roberts <nick@nick.uklinux.net>
Cc: gdb@sources.redhat.com
Subject: Re: GDB/MI
Date: Fri, 21 Feb 2003 01:45:00 -0000 [thread overview]
Message-ID: <3E5585BA.6050409@redhat.com> (raw)
In-Reply-To: <15957.32294.506214.978988@nick.uklinux.net>
> The debugger mode that uses GDB/MI which I am trying to write for Emacs uses a
> queue but I can't get it initialised properly. This is why:
>
> If I start with gdb -interp=mi mytest, I get
>
> ~"GNU gdb 2003-02-04-cvs\n"
> ~"Copyright 2003 Free Software Foundation, Inc.\n"
> ~"GDB is free software, covered by the GNU General Public License, and you are\n"
> ~"welcome to change it and/or distribute copies of it under certain conditions.\n"
> ~"Type \"show copying\" to see the conditions.\n"
> ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
> ~"This GDB was configured as \"i586-pc-linux-gnu\"..."
> ~"\n"
> (gdb)
The prompt:
"(gdb)\n"
indicates that GDB is ready for input. That prompt terminates every
transaction. It is independant of the console GDB prompt:
(gdb)
-interpreter-exec console set prompt foo
&"Argument required (expression to compute).\n"
^error,msg="Argument required (expression to compute)."
(gdb)
-interpreter-exec console "set prompt foo"
^done
(gdb)
-interpreter-exec console "show prompt"
~"Gdb's prompt is \"foo\".\n"
^done
(gdb)
There is a `bug' here - GDB should generate a `=prompt-changed' event.
Andrew
> ^Z^Zpre-prompt
> (gdb)
> ^Z^Zprompt
>
> and the prompt annotation tells Emacs that GDB is ready for input. Since Emacs'
> interaction is asynchronous, the timing is wrong if I assume GDB is ready for
> input immediately after its invocation. I think the initial output should be:
>
> ~"GNU gdb 2003-02-04-cvs\n"
> ~"Copyright 2003 Free Software Foundation, Inc.\n"
> ~"GDB is free software, covered by the GNU General Public License, and you are\n"
> ~"welcome to change it and/or distribute copies of it under certain conditions.\n"
> ~"Type \"show copying\" to see the conditions.\n"
> ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
> ~"This GDB was configured as \"i586-pc-linux-gnu\"..."
> ~"\n"
> ^done
> (gdb)
>
> i.e GDB should notify its status with the ^done record.
>
> I could look for the prompt (gdb) for notification and I imagine this is what
> gvd does but the idea presumably is to have a machine interface and not rely
> on output intended for the (human) user. For example this could be defeated
> with `set prompt'.
>
> I will file a bug report if someone agrees with my analysis.
>
> Nick
>
> Incidently, the string (gdb) that is output here is not the prompt but an
> imposter as I get:
>
> -gdb-set prompt (hec)
> ^done
> (gdb)
> -gdb-show prompt
> ^done,value="(hec)"
> (gdb)
>
next prev parent reply other threads:[~2003-02-21 1:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-21 1:20 GDB/MI Nick Roberts
2003-02-21 1:45 ` Andrew Cagney [this message]
2003-02-21 20:30 ` GDB/MI Nick Roberts
2003-02-22 20:02 ` GDB/MI Eli Zaretskii
2003-02-26 15:03 ` GDB/MI Andrew Cagney
[not found] <1026391983.21348.ezmlm@sources.redhat.com>
2002-07-11 10:47 ` gdb/mi Jim Ingham
-- strict thread matches above, loose matches on Subject: below --
2002-07-05 13:27 gdb/mi Greg Watson
2002-07-10 14:40 ` gdb/mi Andrew Cagney
2002-07-10 16:10 ` gdb/mi Greg Watson
2002-07-10 16:47 ` gdb/mi Keith Seitz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E5585BA.6050409@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=nick@nick.uklinux.net \
/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