aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2014-05-13 17:37:44 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2014-05-15 15:45:51 -0400
commit8c217a4b684386aa5ce6a078dffbe63265a524e6 (patch)
treeb6e03ad03c244aab77e7f484a742c37f8033c4a4 /gdb
parent3deb39c62d3cdb80ac3bdd4d418e05737433e7a6 (diff)
downloadgdb-8c217a4b684386aa5ce6a078dffbe63265a524e6.zip
gdb-8c217a4b684386aa5ce6a078dffbe63265a524e6.tar.gz
gdb-8c217a4b684386aa5ce6a078dffbe63265a524e6.tar.bz2
Fix argument passing in mi_run_cmd_full
Passing arguments did not work when use_mi_command was set. gdb/testsuite/ChangeLog: 2014-05-13 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/lib/mi-support.exp13
2 files changed, 18 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index aaab227..486a4e2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
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
inferiors that exit with non-zero exit code.
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 4478ba0..1054038 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -818,9 +818,11 @@ proc mi_run_cmd_full {use_mi_command args} {
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] {
@@ -862,7 +864,16 @@ proc mi_run_cmd_full {use_mi_command args} {
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}" {
}