diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-08-19 13:00:29 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-08-19 13:00:29 +0000 |
commit | cab0c772ae2d1ffde31e4e8e60b3c2dcb1171bb7 (patch) | |
tree | 6d587997843bf1fda0ba409f7af0e26c679aeeaa /gdb/testsuite | |
parent | bf1102165389c7168c446ce3dcc209046372d599 (diff) | |
download | gdb-cab0c772ae2d1ffde31e4e8e60b3c2dcb1171bb7.zip gdb-cab0c772ae2d1ffde31e4e8e60b3c2dcb1171bb7.tar.gz gdb-cab0c772ae2d1ffde31e4e8e60b3c2dcb1171bb7.tar.bz2 |
ChangeLog:
* value.c (enum internalvar_kind): Replace INTERNALVAR_SCALAR by
INTERNALVAR_INTEGER and INTERNALVAR_POINTER.
(union internalvar_data): Replace "scalar" member by "integer"
and "pointer".
(value_of_internalvar): Handle INTERNALVAR_INTEGER and
INTERNALVAR_POINTER instead of INTERNALVAR_SCALAR.
(get_internalvar_integer): Likewise.
(set_internalvar): Likewise.
(set_internalvar_integer): Likewise.
(preserve_one_internalvar): Likewise.
(value_from_pointer): Handle typedef'd pointer types.
testsuite/ChangeLog:
2009-08-19 Doug Evans <dje@google.com>
* gdb.base/gdbvars.c: New file.
* gdb.base/gdbvars.exp: Test convenience vars with program variables.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/gdbvars.c | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/gdbvars.exp | 19 |
3 files changed, 40 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b56dfc4..9765281 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-08-19 Doug Evans <dje@google.com> + + * gdb.base/gdbvars.c: New file. + * gdb.base/gdbvars.exp: Test convenience vars with program variables. + 2009-08-14 Pedro Alves <pedro@codesourcery.com> * gdb.threads/killed.exp, gdb.threads/manythreads.exp, diff --git a/gdb/testsuite/gdb.base/gdbvars.c b/gdb/testsuite/gdb.base/gdbvars.c new file mode 100644 index 0000000..3a3ba24 --- /dev/null +++ b/gdb/testsuite/gdb.base/gdbvars.c @@ -0,0 +1,16 @@ +/* Simple program to help exercise gdb's convenience variables. */ + +typedef void *ptr; + +ptr p = &p; + +int +main () +{ +#ifdef usestubs + set_debug_traps (); + breakpoint (); +#endif + + return 0; +} diff --git a/gdb/testsuite/gdb.base/gdbvars.exp b/gdb/testsuite/gdb.base/gdbvars.exp index 1c29ea6..8246a14 100644 --- a/gdb/testsuite/gdb.base/gdbvars.exp +++ b/gdb/testsuite/gdb.base/gdbvars.exp @@ -22,6 +22,15 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +set testfile "gdbvars" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + untested gdbvars.exp + return -1 +} + proc test_convenience_variables {} { global gdb_prompt @@ -101,13 +110,23 @@ proc test_value_history {} { "Use value-history element in arithmetic expression" } +proc test_with_program {} { + global hex + gdb_test "set \$prog_var = p" "" \ + "Set a new convenience variable to a program variable" + gdb_test "print /x \$prog_var" " = $hex" \ + "Print contents of new convenience variable of program variable" +} + # Start with a fresh gdb. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $" test_value_history test_convenience_variables +test_with_program |