From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28429 invoked by alias); 16 May 2006 02:35:48 -0000 Received: (qmail 28417 invoked by uid 22791); 16 May 2006 02:35:46 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 16 May 2006 02:35:17 +0000 Received: from farnswood.snap.net.nz (p202-124-112-179.snap.net.nz [202.124.112.179]) by viper.snap.net.nz (Postfix) with ESMTP id B7F4F7577BA; Tue, 16 May 2006 14:35:15 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 500) id 4D956627ED; Tue, 16 May 2006 03:34:43 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17513.14914.566979.842465@farnswood.snap.net.nz> Date: Tue, 16 May 2006 03:46:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH]: MI -var-set-format In-Reply-To: <20060515170640.GB385@nevyn.them.org> References: <17494.64020.26176.277202@farnswood.snap.net.nz> <20060505181111.GI31029@nevyn.them.org> <17499.57333.952984.589237@farnswood.snap.net.nz> <20060515170640.GB385@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.50.52 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00349.txt.bz2 > Could you resubmit the patch including any necessary testsuite changes, > please? I've just changed mi-var-display.exp. Shall I do the same for mi2-var-display.exp? I've tried to create a global for $octal. I see that mi-regs.exp has its own but it probably makes sense to centralise it. Have you made a test for your change to val_print? It could go in this file or mi-var-cmd.exp. -- Nick http://www.inet.net.nz/~nickrob 2006-05-16 Nick Roberts * mi/mi-cmd-var.c (mi_cmd_var_set_format): Add value field to output. * gdb.mi/mi-var-display.exp: Add value field to tests for output of -var-set-format. *** mi-cmd-var.c 31 Mar 2006 12:46:48 +1200 1.23 --- mi-cmd-var.c 02 May 2006 18:16:39 +1200 *************** *** 211,216 **** --- 211,219 ---- /* Report the new current format */ ui_out_field_string (uiout, "format", varobj_format_string[(int) format]); + + /* Report the value in the new format */ + ui_out_field_string (uiout, "value", varobj_get_value (var)); return MI_CMD_DONE; } *** mi-support.exp 29 Sep 2005 08:33:05 +1200 1.32 --- mi-support.exp 17 May 2006 14:03:01 +1200 *************** global mi_inferior_tty_name *** 33,38 **** --- 33,39 ---- set MIFLAGS "-i=mi" + set octal "\[0-7\]+" # # mi_gdb_exit -- exit the GDB, killing the target program if necessary # *************** proc mi_runto {func} { *** 870,876 **** } global mi_gdb_prompt expect_out ! global hex decimal fullname_syntax set test "mi runto $func" mi_gdb_test "200-break-insert $func" \ --- 871,877 ---- } global mi_gdb_prompt expect_out ! global hex octal decimal fullname_syntax set test "mi runto $func" mi_gdb_test "200-break-insert $func" \ *************** proc mi_execute_to_helper { cmd reason f *** 926,932 **** return -1 } global mi_gdb_prompt ! global hex global decimal global fullname_syntax send_gdb "220-$cmd\n" --- 927,933 ---- return -1 } global mi_gdb_prompt ! global hex octal global decimal global fullname_syntax send_gdb "220-$cmd\n" *** mi-var-display.exp 30 May 2005 14:02:09 +1200 1.13 --- mi-var-display.exp 17 May 2006 14:10:52 +1200 *************** mi_gdb_test "-var-evaluate-expression ba *** 89,95 **** # Test: c_variable-6.5 # Desc: change format of bar to hex mi_gdb_test "-var-set-format bar hexadecimal" \ ! "\\^done,format=\"hexadecimal\"" \ "set format variable bar" # Test: c_variable-6.6 --- 89,95 ---- # Test: c_variable-6.5 # Desc: change format of bar to hex mi_gdb_test "-var-set-format bar hexadecimal" \ ! "\\^done,format=\"hexadecimal\",value=\"0x849\"" \ "set format variable bar" # Test: c_variable-6.6 *************** mi_gdb_test "-var-assign bar 3" \ *** 105,111 **** "assing to variable bar" mi_gdb_test "-var-set-format bar decimal" \ ! "\\^done,format=\"decimal\"" \ "set format variable bar" mi_gdb_test "-var-evaluate-expression bar" \ --- 105,111 ---- "assing to variable bar" mi_gdb_test "-var-set-format bar decimal" \ ! "\\^done,format=\"decimal\",value=\"3\"" \ "set format variable bar" mi_gdb_test "-var-evaluate-expression bar" \ *************** mi_gdb_test "-var-evaluate-expression fo *** 143,149 **** # Test: c_variable-6.15 # Desc: change format of var to octal mi_gdb_test "-var-set-format foo octal" \ ! "\\^done,format=\"octal\"" \ "set format variable foo" mi_gdb_test "-var-show-format foo" \ --- 143,149 ---- # Test: c_variable-6.15 # Desc: change format of var to octal mi_gdb_test "-var-set-format foo octal" \ ! "\\^done,format=\"octal\",value=\"$octal\"" \ "set format variable foo" mi_gdb_test "-var-show-format foo" \ *************** mi_gdb_test "-var-assign foo 3" \ *** 163,169 **** "assing to variable foo" mi_gdb_test "-var-set-format foo decimal" \ ! "\\^done,format=\"decimal\"" \ "set format variable foo" # Test: c_variable-6.18 --- 163,169 ---- "assing to variable foo" mi_gdb_test "-var-set-format foo decimal" \ ! "\\^done,format=\"decimal\",value=\"3\"" \ "set format variable foo" # Test: c_variable-6.18 *************** mi_gdb_test "-var-list-children weird" \ *** 190,196 **** # Test: c_variable-6.23 # Desc: change format of weird.func_ptr and weird.func_ptr_ptr mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\"" \ "set format variable weird.func_ptr" mi_gdb_test "-var-show-format weird.func_ptr" \ --- 190,196 ---- # Test: c_variable-6.23 # Desc: change format of weird.func_ptr and weird.func_ptr_ptr mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\",value=\"$hex\"" \ "set format variable weird.func_ptr" mi_gdb_test "-var-show-format weird.func_ptr" \ *************** mi_gdb_test "-var-show-format weird.func *** 198,204 **** "show format variable weird.func_ptr" mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\"" \ "set format variable weird.func_ptr_ptr" mi_gdb_test "-var-show-format weird.func_ptr_ptr" \ --- 198,204 ---- "show format variable weird.func_ptr" mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\",value=\"$hex\"" \ "set format variable weird.func_ptr_ptr" mi_gdb_test "-var-show-format weird.func_ptr_ptr" \ *************** mi_gdb_test "-var-show-format weird.func *** 208,258 **** # Test: c_variable-6.24 # Desc: format of weird and children mi_gdb_test "-var-set-format weird natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird" mi_gdb_test "-var-set-format weird.integer natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.integer" mi_gdb_test "-var-set-format weird.character natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.character" mi_gdb_test "-var-set-format weird.char_ptr natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.char_ptr" mi_gdb_test "-var-set-format weird.long_int natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.long_int" mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.int_ptr_ptr" mi_gdb_test "-var-set-format weird.long_array natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.long_array" mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\"" \ "set format variable weird.func_ptr" mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \ ! "\\^done,format=\"hexadecimal\"" \ "set format variable weird.func_ptr_struct" mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.func_ptr_ptr" mi_gdb_test "-var-set-format weird.u1 natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.u1" mi_gdb_test "-var-set-format weird.s2 natural" \ ! "\\^done,format=\"natural\"" \ "set format variable weird.s2" # Test: c_variable-6.25 --- 208,258 ---- # Test: c_variable-6.24 # Desc: format of weird and children mi_gdb_test "-var-set-format weird natural" \ ! "\\^done,format=\"natural\",value=\"$hex\"" \ "set format variable weird" mi_gdb_test "-var-set-format weird.integer natural" \ ! "\\^done,format=\"natural\",value=\"123\"" \ "set format variable weird.integer" mi_gdb_test "-var-set-format weird.character natural" \ ! "\\^done,format=\"natural\",value=\"50 '2'\"" \ "set format variable weird.character" mi_gdb_test "-var-set-format weird.char_ptr natural" \ ! "\\^done,format=\"natural\",value=\"$hex \\\\\"hello\\\\\"\"" \ "set format variable weird.char_ptr" mi_gdb_test "-var-set-format weird.long_int natural" \ ! "\\^done,format=\"natural\",value=\"0\"" \ "set format variable weird.long_int" mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \ ! "\\^done,format=\"natural\",value=\"$hex\"" \ "set format variable weird.int_ptr_ptr" mi_gdb_test "-var-set-format weird.long_array natural" \ ! "\\^done,format=\"natural\",value=\"\\\[10\\\]\"" \ "set format variable weird.long_array" mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ ! "\\^done,format=\"hexadecimal\",value=\"$hex\"" \ "set format variable weird.func_ptr" mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \ ! "\\^done,format=\"hexadecimal\",value=\"$hex\"" \ "set format variable weird.func_ptr_struct" mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \ ! "\\^done,format=\"natural\",value=\"$hex\"" \ "set format variable weird.func_ptr_ptr" mi_gdb_test "-var-set-format weird.u1 natural" \ ! "\\^done,format=\"natural\",value=\"\{...\}\"" \ "set format variable weird.u1" mi_gdb_test "-var-set-format weird.s2 natural" \ ! "\\^done,format=\"natural\",value=\"\{...\}\"" \ "set format variable weird.s2" # Test: c_variable-6.25