Fix crash on lval_computed values.
	* valops.c (value_zero): Use not_lval for lval_computed.

gdb/testsuite/
	Fix crash on lval_computed values.
	* gdb.dwarf2/implptr.exp (print sizeof (j[0])): New test.
This commit is contained in:
Jan Kratochvil 2011-07-27 19:25:56 +00:00
parent 2d5213f8bc
commit bb7da2bfb5
4 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix crash on lval_computed values.
* valops.c (value_zero): Use not_lval for lval_computed.
2011-07-27 Tom Tromey <tromey@redhat.com> 2011-07-27 Tom Tromey <tromey@redhat.com>
* Makefile.in (HFILES_NO_SRCDIR): Add 'common' prefix for * Makefile.in (HFILES_NO_SRCDIR): Add 'common' prefix for

View file

@ -1,3 +1,8 @@
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix crash on lval_computed values.
* gdb.dwarf2/implptr.exp (print sizeof (j[0])): New test.
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com> 2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/help.exp (help whatis): Update the expected string. * gdb.base/help.exp (help whatis): Update the expected string.

View file

@ -55,6 +55,7 @@ proc implptr_test_bar {} {
"set bar breakpoint for implptr" "set bar breakpoint for implptr"
gdb_continue_to_breakpoint "continue to bar breakpoint for implptr" gdb_continue_to_breakpoint "continue to bar breakpoint for implptr"
gdb_test "print j" " = \\(intp\\) <synthetic pointer>" "print j in implptr:bar" gdb_test "print j" " = \\(intp\\) <synthetic pointer>" "print j in implptr:bar"
gdb_test {print sizeof (j[0])} " = 4" {print sizeof (j[0]) in implptr:bar}
gdb_test "print *j" " = 5" "print *j in implptr:bar" gdb_test "print *j" " = 5" "print *j in implptr:bar"
gdb_test "print **k" " = 5" "print **k in implptr:bar" gdb_test "print **k" " = 5" "print **k in implptr:bar"
gdb_test "print ***l" " = 5" "print ***l in implptr:bar" gdb_test "print ***l" " = 5" "print ***l in implptr:bar"

View file

@ -860,7 +860,7 @@ value_zero (struct type *type, enum lval_type lv)
{ {
struct value *val = allocate_value (type); struct value *val = allocate_value (type);
VALUE_LVAL (val) = lv; VALUE_LVAL (val) = (lv == lval_computed ? not_lval : lv);
return val; return val;
} }