diff options
author | Marc Khouzam <marc.khouzam@ericsson.com> | 2008-04-09 13:29:55 +0000 |
---|---|---|
committer | Marc Khouzam <marc.khouzam@ericsson.com> | 2008-04-09 13:29:55 +0000 |
commit | de051565dfd9173f9ca885ac8e294ae2c90e409c (patch) | |
tree | 833f79330dea8f31531d2fba050483a361efe667 /gdb/testsuite/gdb.mi | |
parent | cdb0b8f5655411f9926c49ae39386430d3df67b0 (diff) | |
download | gdb-de051565dfd9173f9ca885ac8e294ae2c90e409c.zip gdb-de051565dfd9173f9ca885ac8e294ae2c90e409c.tar.gz gdb-de051565dfd9173f9ca885ac8e294ae2c90e409c.tar.bz2 |
gdb/ChangeLog
2008-04-09 Marc Khouzam <marc.khouzam@ericsson.com>
* mi/mi-cmd-var.c: Include "mi-getopt.h".
(mi_parse_format): New. Factored out from mi_cmd_var_set_format.
(mi_cmd_var_set_format): Use new mi_parse_format.
(mi_cmd_var_evaluate_expression): Support for -f option to specify
format.
* Makefile.in (mi-cmd-var.o): Update dependencies.
* varobj.h (varobj_get_formatted_value): Declare.
* varobj.c (my_value_of_variable): Added format parameter.
(cplus_value_of_variable): Likewise.
(java_value_of_variable): Likewise.
(c_value_of_variable): Likewise. Evaluate expression based
on format parameter.
(struct language_specific): Add format parameter to function member
*value_of_variable.
(varobj_get_formatted_value): New.
(varobj_get_value): Added format parameter to method call.
gdb/doc/ChangeLog
2008-04-09 Marc Khouzam <marc.khouzam@ericsson.com>
* gdb.texinfo (GDB/MI Variable Objects): Add anchor to
-var-set-format. Add -f option to -var-evaluate-expression.
gdb/testsuite/ChangeLog
2008-04-09 Marc Khouzam <marc.khouzam@ericsson.com>
* gdb.mi/mi2-var-display.exp: Added tests for the new -f
option of -var-evaluate-expression.
* gdb.mi/mi2-var-display.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-display.exp | 44 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-display.exp | 43 |
2 files changed, 87 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index b6742de..22ad34d 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -161,6 +161,50 @@ mi_gdb_test "-var-evaluate-expression foo" \ "\\^done,value=\"3\"" \ "eval variable foo" + +# Test: c_variable-6.19 +# Desc: check optional format parameter of var-evaluate-expression +# and check that current format is not changed +mi_gdb_test "-var-evaluate-expression -f hex foo" \ + "\\^done,value=\"0x3\"" \ + "eval variable foo in hex" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in hex" + +mi_gdb_test "-var-evaluate-expression -f octal foo" \ + "\\^done,value=\"03\"" \ + "eval variable foo in octal" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in octal" + +mi_gdb_test "-var-evaluate-expression -f decimal foo" \ + "\\^done,value=\"3\"" \ + "eval variable foo in decimal" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in decimal" + +mi_gdb_test "-var-evaluate-expression -f nat foo" \ + "\\^done,value=\"0x3\"" \ + "eval variable foo in natural" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in natural" + +mi_gdb_test "-var-evaluate-expression -f bin foo" \ + "\\^done,value=\"11\"" \ + "eval variable foo in binary" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in binary" + mi_gdb_test "-var-delete foo" \ "\\^done,ndeleted=\"1\"" \ "delete var foo" diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp index 21f1aa6..00e5a85 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp @@ -161,6 +161,49 @@ mi_gdb_test "-var-evaluate-expression foo" \ "\\^done,value=\"3\"" \ "eval variable foo" +# Test: c_variable-6.19 +# Desc: check optional format parameter of var-evaluate-expression +# and check that current format is not changed +mi_gdb_test "-var-evaluate-expression -f hex foo" \ + "\\^done,value=\"0x3\"" \ + "eval variable foo in hex" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in hex" + +mi_gdb_test "-var-evaluate-expression -f octal foo" \ + "\\^done,value=\"03\"" \ + "eval variable foo in octal" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in octal" + +mi_gdb_test "-var-evaluate-expression -f decimal foo" \ + "\\^done,value=\"3\"" \ + "eval variable foo in decimal" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in decimal" + +mi_gdb_test "-var-evaluate-expression -f nat foo" \ + "\\^done,value=\"0x3\"" \ + "eval variable foo in natural" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in natural" + +mi_gdb_test "-var-evaluate-expression -f bin foo" \ + "\\^done,value=\"11\"" \ + "eval variable foo in binary" + +mi_gdb_test "-var-show-format foo" \ + "\\^done,format=\"decimal\"" \ + "show format variable foo after eval in binary" + mi_gdb_test "-var-delete foo" \ "\\^done,ndeleted=\"1\"" \ "delete var foo" |