* mi/mi-main.c (mi_execute_command): Set current_token here.
(mi_cmd_execute): Do not set current_token here.
+2009-03-12 Vladimir Prus <vladimir@codesourcery.com>
+
+ Include token in ^running notification for CLI commands.
+
+ * mi/mi-main.c (mi_execute_command): Set current_token here.
+ (mi_cmd_execute): Do not set current_token here.
+
2009-03-12 Vladimir Prus <vladimir@codesourcery.com>
Fix MI timings.
static void
captured_mi_execute_command (struct ui_out *uiout, void *data)
{
+ struct cleanup *cleanup;
struct mi_parse *context = (struct mi_parse *) data;
if (do_timings)
current_command_ts = context->cmd_start;
+ current_token = xstrdup (context->token);
+ cleanup = make_cleanup (free_current_contents, ¤t_token);
+
running_result_record_printed = 0;
switch (context->op)
{
}
+ do_cleanups (cleanup);
+
return;
}
{
struct cleanup *cleanup;
int i;
- free_all_values ();
- current_token = xstrdup (parse->token);
- cleanup = make_cleanup (free_current_contents, ¤t_token);
+ free_all_values ();
+ cleanup = make_cleanup (null_cleanup, NULL);
if (parse->frame != -1 && parse->thread == -1)
error (_("Cannot specify --frame without --thread"));
+2009-03-12 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.mi/mi-cli.exp: Verify that CLI commands that run inferior
+ include the token in ^running and frame info in *stopped.
+
2009-03-05 Paul Pluzhnikov <ppluzhnikov@google.com>
* solib-display.exp: New file.
$line_main_hello { "" "disp=\"del\"" } \
"-exec-continue to line $line_main_hello"
-mi_execute_to "exec-next" "end-stepping-range" "main" "" ".*basics.c" $line_main_return "" \
- "-exec-next to line $line_main_return"
+# Test that the token is output even for CLI commands
+# Also test that *stopped includes frame information.
+mi_gdb_test "34 next" \
+ ".*34\\\^running.*\\*running,thread-id=\"all\"" \
+ "34 next: run"
+
+gdb_expect {
+ -re "~\[^\r\n\]+\r\n" {
+ verbose -log "Hi there"
+ }
+}
+
+# Note that the output does not include stop reason. This is fine.
+# The purpose of *stopped notification for CLI command is to make
+# sure that frontend knows that inferior is stopped, and knows where.
+# Supplementary information is not necessary.
+mi_expect_stop "" "main" "" ".*basics.c" $line_main_return "" \
+ "34 next: stop"
mi_gdb_test "-interpreter-exec console \"list\"" \
"\~\"$line_main_return\[\\\\t ]*callme \\(1\\);\\\\n\".*\\^done" \