This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][PATCH] Fixes to gdb.mi testsuite
- From: Yao Qi <yao at codesourcery dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>, Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Wed, 29 May 2013 16:57:40 +0800
- Subject: Re: [RFC][PATCH] Fixes to gdb.mi testsuite
- References: <51A50A9F dot 9080107 at ericsson dot com>
Hi, Simon,
On 05/29/2013 03:50 AM, Simon Marchi wrote:
2013-05-28 Simon Marchi<simon.marchi@ericsson.com>
* gdb/testsuite/lib/mi-support.exp (mi_run_to_main): add "args"
parameter.
Each line of changelog entry is started by a tab. The description should
be a sentence, so capitalize "a" in "add".
You can reference this wiki page
http://sourceware.org/gdb/wiki/ContributionChecklist#Properly_Formatted_GNU_ChangeLog
(mi_runto): Idem.
(mi_runto_helper): Idem.
(mi_run_cmd_full): Call -exec-arguments to set args before
running inferior if use_mi_command is set.
Thanks,
Simon
diff --git a/gdb/testsuite/lib/mi-support.exp
b/gdb/testsuite/lib/mi-support.exp
index 50b926f..db8ae1a 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -846,6 +846,20 @@ proc mi_run_cmd_full {use_mi_command args} {
return 0
}
+ if {$use_mi_command} {
+ if { [llength $args] > 0 } {
+ send_gdb "-exec-arguments $args\n"
+ gdb_expect {
+ -re "=cmd-param-changed,param=\"args\",value=.*" {
MI notification =cmd-param-changed is not suppressed by mistake in GDB.
I've post a patch
<http://sourceware.org/ml/gdb-patches/2013-05/msg00976.html> to fix it.
Once it is committed, this part can simplified.
+ }
+ default {
+ fail "-exec-arguments output not matched"
+ return -1
+ }
+ }
+ }
+ }
+
send_gdb "${run_prefix}run $args\n"
Looks the $args are passed to -exec-run command, but -exec-run command
doesn't pass args to the inferior. See mi/mi-main.c:mi_cmd_exec_run.
If we can teach MI command -exec-run pass argument to inferior (not sure
it is a good idea or not), we don't have to use -exec-arguments here.
--
Yao (éå)