gdb/
authorDaniel Jacobowitz <drow@false.org>
Thu, 20 Jul 2006 22:50:07 +0000 (22:50 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 20 Jul 2006 22:50:07 +0000 (22:50 +0000)
* eval.c (evaluate_struct_tuple): Skip static fields.
gdb/testsuite/
* gdb.cp/bs15503.exp: Update comment for no longer crashing
test.

gdb/ChangeLog
gdb/eval.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/bs15503.exp

index 111826667c7caa39615b423398c5a5e16fc5d15e..768c7822f7de3e4805fe270f81b8a132a63d689c 100644 (file)
@@ -1,3 +1,7 @@
+2006-07-20  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * eval.c (evaluate_struct_tuple): Skip static fields.
+
 2006-07-19  Mark Kettenis  <kettenis@gnu.org>
 
        * alphaobsd-tdep.c: Include "obsd-tdep.h".
index 66776ea3cac2d9afa4824b2264a06cc1acd686e7..083bbc2f50ec018767081aa4c25989374753e1a1 100644 (file)
@@ -283,6 +283,10 @@ evaluate_struct_tuple (struct value *struct_val,
              if (variantno < 0)
                {
                  fieldno++;
+                 /* Skip static fields.  */
+                 while (fieldno < TYPE_NFIELDS (struct_type)
+                        && TYPE_FIELD_STATIC_KIND (struct_type, fieldno))
+                   fieldno++;
                  subfieldno = fieldno;
                  if (fieldno >= TYPE_NFIELDS (struct_type))
                    error (_("too many initializers"));
index a6ba05e1623506acdf6ce53db7b2bfc6665164a2..4371abe416080c72e99cccbf58977df7927f225f 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-20  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.cp/bs15503.exp: Update comment for no longer crashing
+       test.
+
 2006-07-19  Andrew Stubbs  <andrew.stubbs@st.com>
 
        * gdb.base/ifelse.exp: Remove troublesome 'got here' messages.
index dee8b6ee8220e9d99d0eb32ff69a2a83f745acf7..aa11adab002e575f333fa52cc8d991f80e319183 100644 (file)
@@ -83,11 +83,11 @@ gdb_test "print (const char *) s" \
 # gdb_test "print s > "AAA"                    "\\$\[0-9\]+ = true"
 # gdb_test "print s < "ZZZ"                    "\\$\[0-9\]+ = true"
 
-# TODO crash gdb!  This is going to be a great test!
-# -- chastain 2004-01-07
+# TODO: GDB doesn't know to convert the string to a const char *, and
+# instead tries to use the string as a structure initializer.
 # 
 # gdb_test "print s == \"I am a short stringand now a longer string\"" \
-#     "\\$\[0-9\]+ = "true"
+#     "\\$\[0-9\]+ = true"
 
 gdb_test "print (const char *) s.substr(0,4)"  "\\$\[0-9\]+ = $hex \"I am\""
 gdb_test "print (const char *) (s=s.substr(0,4))" \
This page took 0.037428 seconds and 4 git commands to generate.