This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't emit =cmd-param-changed when executing command -exec-arguments


Hi,
When I read Simon's patch,

  [RFC][PATCH] Fixes to gdb.mi testsuite
  http://sourceware.org/ml/gdb-patches/2013-05/msg00971.html

I find "=cmd-param-changed" is emitted by GDB when executing MI command
"-exec-arguments", which is not expected, like this

-exec-arguments foo
=cmd-param-changed,param="args",value="foo"
^done

"=cmd-param-changed" is emitted only when a CLI command is executed in MI.
Looks this notification is not suppressed.  This patch below is to fix
this problem, suppress the notification like what we did to MI command
"-gdb-set".  A test case is added to test this fix.  With the patch to
mi-cmds.c, we get a fail,

  FAIL: gdb.mi/mi-cmd-param-changed.exp: cmd param: "-exec-arguments foo" no event

after the fix, the fail goes away.  Regression tested on x86_64-linux
with both native and gdbserver.

gdb:

2013-05-29  Yao Qi  <yao@codesourcery.com>

	* mi/mi-cmds.c (mi_cmds): Define MI command
	'-exec-arguments' by macro DEF_MI_CMD_CLI_1 instead of
	DEF_MI_CMD_CLI.

gdb/testsuite:

2013-05-29  Yao Qi  <yao@codesourcery.com>

	* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
	Add a test that no MI notification is emitted when executing
	-exec-arguments.
---
 gdb/mi/mi-cmds.c                              |    3 ++-
 gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 124a9dd..eb67abe 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -93,7 +93,8 @@ static struct mi_cmd mi_cmds[] =
   DEF_MI_CMD_MI ("environment-directory", mi_cmd_env_dir),
   DEF_MI_CMD_MI ("environment-path", mi_cmd_env_path),
   DEF_MI_CMD_MI ("environment-pwd", mi_cmd_env_pwd),
-  DEF_MI_CMD_CLI ("exec-arguments", "set args", 1),
+  DEF_MI_CMD_CLI_1 ("exec-arguments", "set args", 1,
+		    &mi_suppress_notification.cmd_param_changed),
   DEF_MI_CMD_MI ("exec-continue", mi_cmd_exec_continue),
   DEF_MI_CMD_MI ("exec-finish", mi_cmd_exec_finish),
   DEF_MI_CMD_MI ("exec-jump", mi_cmd_exec_jump),
diff --git a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
index 7fc025f..1791c97 100644
--- a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
@@ -44,6 +44,8 @@ proc test_command_param_changed { } {
 	mi_gdb_test "-gdb-set scheduler-locking on" \
 	    {\^done} \
 	    "\"set scheduler-locking on\" no event (requested by MI)"
+	mi_gdb_test "-exec-arguments foo" {\^done} \
+	    "\"-exec-arguments foo\" no event"
 
 	mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
 	    "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]