From: Daniel Jacobowitz <drow@false.org>
To: Dirk Behme <dirk.behme@googlemail.com>
Cc: gdb@sourceware.org
Subject: Re: MI return error changed from 6.3 to 6.4?
Date: Fri, 07 Apr 2006 17:36:00 -0000 [thread overview]
Message-ID: <20060407160222.GA24731@nevyn.them.org> (raw)
In-Reply-To: <44368B51.1030707@gmail.com>
On Fri, Apr 07, 2006 at 05:54:57PM +0200, Dirk Behme wrote:
> GDB 6.4:
>
> (gdb)
> srwwerrweweer
> &"srwwerrweweer\n"
> &"Undefined command: \"srwwerrweweer\". Try \"help\".\n"
> ^done
> (gdb)
Two things. Here's the cause:
1108 argv[0] = "console";
1109 argv[1] = context->command;
1110 mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);
1111
1112 /* If we changed interpreters, DON'T print out anything. */
1113 if (current_interp_named_p (INTERP_MI)
1114 || current_interp_named_p (INTERP_MI1)
1115 || current_interp_named_p (INTERP_MI2)
1116 || current_interp_named_p (INTERP_MI3))
1117 {
(gdb)
1118 /* print the result */
1119 /* FIXME: Check for errors here. */
1120 fputs_unfiltered (context->token, raw_stdout);
1121 fputs_unfiltered ("^done", raw_stdout);
1122 mi_out_put (uiout, raw_stdout);
1123 mi_out_rewind (uiout);
1124 fputs_unfiltered ("\n", raw_stdout);
1125 args->action = EXECUTE_COMMAND_DISPLAY_PROMPT;
1126 args->rc = MI_CMD_DONE;
1127 }
mi_cmd_interpreter_exec has conveniently returned MI_CMD_ERROR.
So, this should be easy to fix. Thanks for the report.
> With this, a GUI interface has the problem that it can't decide if
> the GDB has some problems parsing the command given to it or not
> because it scans for the "^error" string as result. With 6.4 this
> doesn't work any more.
This only happens if you're sending CLI commands (i.e. commands which
don't start with a "-") to GDB directly. Otherwise you'll get the
expected ^error. A better way to do this than relying on "the CLI
hack" for unknown commands is to use the new -interpreter-exec, and
that will return the error OK:
zz
&"zz\n"
&"Undefined command: \"zz\". Try \"help\".\n"
^done
(gdb)
-interpreter-exec console "zz"
&"Undefined command: \"zz\". Try \"help\".\n"
^error,msg="Undefined command: \"zz\". Try \"help\"."
(gdb)
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-04-07 16:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-07 16:02 Dirk Behme
2006-04-07 17:36 ` Daniel Jacobowitz [this message]
2006-04-08 8:23 ` Nick Roberts
2006-04-08 9:57 ` Eli Zaretskii
2006-04-08 10:07 ` Nick Roberts
2006-04-08 18:35 ` Eli Zaretskii
2006-04-08 18:45 ` Nick Roberts
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=20060407160222.GA24731@nevyn.them.org \
--to=drow@false.org \
--cc=dirk.behme@googlemail.com \
--cc=gdb@sourceware.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