From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14121 invoked by alias); 25 Jun 2013 19:16:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14110 invoked by uid 89); 25 Jun 2013 19:16:30 -0000 X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,SPF_PASS autolearn=ham version=3.3.1 Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 19:16:29 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 49.10.15791.B8CE9C15; Tue, 25 Jun 2013 21:16:28 +0200 (CEST) Received: from eusaamw0711.eamcs.ericsson.se (147.117.20.178) by EUSAAHC004.ericsson.se (147.117.188.84) with Microsoft SMTP Server (TLS) id 14.2.328.9; Tue, 25 Jun 2013 15:16:27 -0400 Received: from [142.133.110.167] (147.117.20.214) by smtps-am.internal.ericsson.com (147.117.20.178) with Microsoft SMTP Server (TLS) id 8.3.279.1; Tue, 25 Jun 2013 15:16:26 -0400 Message-ID: <51C9EC7B.1050807@ericsson.com> Date: Tue, 25 Jun 2013 19:23:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: GDB Patches Subject: [PATCH] Fix argument passing in mi_run_cmd_full Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00740.txt.bz2 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 * 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}" { }