+2014-05-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * lib/mi-support.exp (mi_run_cmd_full): Set arguments by
+ calling "-exec-arguments" or "set args" before running the
+ inferior.
+
2014-05-15 Simon Marchi <simon.marchi@ericsson.com>
* lib/mi-support.exp (mi_expect_stop): Expect message for
if {$use_mi_command} {
set run_prefix "220-exec-"
set run_match "220"
+ set set_args_cmd "-exec-arguments"
} else {
set run_prefix ""
set run_match ""
+ set set_args_cmd "set args"
}
if [target_info exists gdb_init_command] {
return 0
}
- send_gdb "${run_prefix}run $args\n"
+ send_gdb "${set_args_cmd} $args\n"
+ gdb_expect {
+ -re "$mi_gdb_prompt$" { }
+ default {
+ perror "settings args failed"
+ return -1
+ }
+ }
+
+ send_gdb "${run_prefix}run\n"
gdb_expect {
-re "${run_match}\\^running\r\n(\\*running,thread-id=\"\[^\"\]+\"\r\n|=thread-created,id=\"1\",group-id=\"\[0-9\]+\"\r\n)*(${library_loaded_re})*(${thread_selected_re})?${mi_gdb_prompt}" {
}