Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH v2] Fix argument passing in mi_run_cmd_full
Date: Tue, 13 May 2014 21:47:00 -0000	[thread overview]
Message-ID: <1400017636-28020-1-git-send-email-simon.marchi@ericsson.com> (raw)

Again, this patch was accepted almost a year ago, I want to make sure
that it is still OK.

Original submission: https://sourceware.org/ml/gdb-patches/2013-06/msg00739.html

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.
---
 gdb/testsuite/lib/mi-support.exp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index ad58775..b27b268 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}" {
 	}
-- 
2.0.0.rc0


             reply	other threads:[~2014-05-13 21:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 21:47 Simon Marchi [this message]
2014-05-15 18:40 ` Tom Tromey
2014-05-15 19:47   ` Simon Marchi
2014-05-19 19:39 ` Tom Tromey
2014-05-20 16:40   ` Simon Marchi
2014-05-20 22:24     ` Simon Marchi
2014-05-21  8:46       ` Pedro Alves

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=1400017636-28020-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@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