From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8300 invoked by alias); 23 Jan 2008 06:24:21 -0000 Received: (qmail 8259 invoked by uid 22791); 23 Jan 2008 06:24:20 -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; Wed, 23 Jan 2008 06:23:53 +0000 Received: from kahikatea.snap.net.nz (221.63.255.123.dynamic.snap.net.nz [123.255.63.221]) by viper.snap.net.nz (Postfix) with ESMTP id 09D693DA387; Wed, 23 Jan 2008 19:23:44 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 18F168FC6D; Wed, 23 Jan 2008 19:23:35 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18326.56678.70817.684768@kahikatea.snap.net.nz> Date: Wed, 23 Jan 2008 06:24:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH]: MI -var-set-format In-Reply-To: <20080123034741.GA13735@caradoc.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> <17513.14914.566979.842465@farnswood.snap.net.nz> <20080122201234.GA20622@caradoc.them.org> <18326.45967.522349.613044@kahikatea.snap.net.nz> <20080123034741.GA13735@caradoc.them.org> X-Mailer: VM 7.19 under Emacs 23.0.50.34 X-IsSubscribed: yes 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 X-SW-Source: 2008-01/txt/msg00542.txt.bz2 > That, or put the "set octal" line in gdb.exp (nothing mi-specific > about it). I didn't see that line. All the changes to "global" lines > are not needed. OK. Below is what I've committed. A couple of the tests required new values because of changes since the previous submission, -- Nick http://www.inet.net.nz/~nickrob 2008-01-23 Nick Roberts * mi/mi-cmd-var.c (mi_cmd_var_set_format): Add value field to output. 2008-01-23 Nick Roberts * lib/gdb.exp: Add the variable octal. * gdb.mi/mi-var-display.exp: Add value field to tests for output of -var-set-format. Index: mi/mi-cmd-var.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v retrieving revision 1.43 diff -p -r1.43 mi-cmd-var.c *** mi/mi-cmd-var.c 1 Jan 2008 22:53:14 -0000 1.43 --- mi/mi-cmd-var.c 23 Jan 2008 06:11:02 -0000 *************** mi_cmd_var_set_format (char *command, ch *** 231,236 **** --- 231,239 ---- /* 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; } Index: testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.95 diff -p -r1.95 gdb.exp *** testsuite/lib/gdb.exp 1 Jan 2008 22:53:22 -0000 1.95 --- testsuite/lib/gdb.exp 23 Jan 2008 06:11:05 -0000 *************** if ![info exists env(EXEEXT)] { *** 85,90 **** --- 85,92 ---- set EXEEXT $env(EXEEXT) } + set octal "\[0-7\]+" + ### Only procedures should come after this point. # Index: testsuite/gdb.mi/mi-var-display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v retrieving revision 1.20 diff -p -r1.20 mi-var-display.exp *** testsuite/gdb.mi/mi-var-display.exp 1 Jan 2008 22:53:20 -0000 1.20 --- testsuite/gdb.mi/mi-var-display.exp 23 Jan 2008 06:11:06 -0000 *************** 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=\"0 '\\\\\\\\0'\"" \ "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=\"0\"" \ "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