gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 27 Jul 2011 19:25:56 +0000 (19:25 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 27 Jul 2011 19:25:56 +0000 (19:25 +0000)
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
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/implptr.exp
gdb/valops.c

index 91861ee8321ff745ece3430b75f2462ee6e45a9c..27b5a33c5496f530026b4dfc264a81ec82e9df17 100644 (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>
 
        * Makefile.in (HFILES_NO_SRCDIR): Add 'common' prefix for
index cfcc0ff01e04ec9f05d01b4e70c0084863da2647..3060f8e8c96cfd5d5df22b6500a39d9cf969d30e 100644 (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>
 
        * gdb.base/help.exp (help whatis): Update the expected string.
index a199a84b4eaa7530e19a2ab52bf1068ecbdbdd7f..0a7d069d25880270fcc8c36e1a82ef46f957ed25 100644 (file)
@@ -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\\) <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 **k" " = 5" "print **k in implptr:bar"
     gdb_test "print ***l" " = 5" "print ***l in implptr:bar"
index d9cdc134174a4e3d279bdade2e1836877b684d7b..ee05d7316a072f39ad3368aa7694d40462256fc2 100644 (file)
@@ -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;
 }
 
This page took 0.045867 seconds and 4 git commands to generate.