From bb7da2bfb5d890bdb01a15ed46a64011fc08d812 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 27 Jul 2011 19:25:56 +0000 Subject: [PATCH] gdb/ 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. --- gdb/ChangeLog | 5 +++++ gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.dwarf2/implptr.exp | 1 + gdb/valops.c | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 91861ee..27b5a33 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-07-27 Jan Kratochvil + + Fix crash on lval_computed values. + * valops.c (value_zero): Use not_lval for lval_computed. + 2011-07-27 Tom Tromey * Makefile.in (HFILES_NO_SRCDIR): Add 'common' prefix for diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index cfcc0ff..3060f8e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-07-27 Jan Kratochvil + Fix crash on lval_computed values. + * gdb.dwarf2/implptr.exp (print sizeof (j[0])): New test. + +2011-07-27 Jan Kratochvil + * gdb.base/help.exp (help whatis): Update the expected string. 2011-07-27 Jan Kratochvil diff --git a/gdb/testsuite/gdb.dwarf2/implptr.exp b/gdb/testsuite/gdb.dwarf2/implptr.exp index a199a84..0a7d069 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr.exp +++ b/gdb/testsuite/gdb.dwarf2/implptr.exp @@ -55,6 +55,7 @@ proc implptr_test_bar {} { "set bar breakpoint for implptr" gdb_continue_to_breakpoint "continue to bar breakpoint for implptr" gdb_test "print j" " = \\(intp\\) " "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 **k" " = 5" "print **k in implptr:bar" gdb_test "print ***l" " = 5" "print ***l in implptr:bar" diff --git a/gdb/valops.c b/gdb/valops.c index d9cdc13..ee05d73 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -860,7 +860,7 @@ value_zero (struct type *type, enum lval_type lv) { struct value *val = allocate_value (type); - VALUE_LVAL (val) = lv; + VALUE_LVAL (val) = (lv == lval_computed ? not_lval : lv); return val; } -- 2.7.4