Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix argument passing in mi_run_cmd_full
@ 2013-06-25 19:23 Simon Marchi
  2013-06-25 19:50 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2013-06-25 19:23 UTC (permalink / raw)
  To: GDB Patches

Passing arguments did not work when use_mi_command was set.

I split the following patch in two distinct patches, this is the second one:
http://sourceware.org/ml/gdb-patches/2013-06/msg00374.html

gdb/testsuite/ChangeLog:
2013-06-25  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 b3a9de7..fd1d58d 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -803,9 +803,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] {
@@ -846,7 +848,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}"
{
 	}



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix argument passing in mi_run_cmd_full
  2013-06-25 19:23 [PATCH] Fix argument passing in mi_run_cmd_full Simon Marchi
@ 2013-06-25 19:50 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2013-06-25 19:50 UTC (permalink / raw)
  To: Simon Marchi; +Cc: GDB Patches

On 06/25/2013 08:16 PM, Simon Marchi wrote:
> Passing arguments did not work when use_mi_command was set.
> 
> I split the following patch in two distinct patches, this is the second one:
> http://sourceware.org/ml/gdb-patches/2013-06/msg00374.html

Excellent.

> gdb/testsuite/ChangeLog:
> 2013-06-25  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.

Thanks.  This is OK.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-25 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25 19:23 [PATCH] Fix argument passing in mi_run_cmd_full Simon Marchi
2013-06-25 19:50 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox