From: Daniel Jacobowitz Date: Thu, 20 Jul 2006 22:50:07 +0000 (+0000) Subject: gdb/ X-Git-Tag: newlib-csl-sourcerygxx-3_4_4-25~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16963cb64bd9999537c4a056bff9915bab2911d2;p=external%2Fbinutils.git gdb/ * eval.c (evaluate_struct_tuple): Skip static fields. gdb/testsuite/ * gdb.cp/bs15503.exp: Update comment for no longer crashing test. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1118266..768c782 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2006-07-20 Daniel Jacobowitz + + * eval.c (evaluate_struct_tuple): Skip static fields. + 2006-07-19 Mark Kettenis * alphaobsd-tdep.c: Include "obsd-tdep.h". diff --git a/gdb/eval.c b/gdb/eval.c index 66776ea..083bbc2 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -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")); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a6ba05e..4371abe 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-07-20 Daniel Jacobowitz + + * gdb.cp/bs15503.exp: Update comment for no longer crashing + test. + 2006-07-19 Andrew Stubbs * gdb.base/ifelse.exp: Remove troublesome 'got here' messages. diff --git a/gdb/testsuite/gdb.cp/bs15503.exp b/gdb/testsuite/gdb.cp/bs15503.exp index dee8b6e..aa11ada 100644 --- a/gdb/testsuite/gdb.cp/bs15503.exp +++ b/gdb/testsuite/gdb.cp/bs15503.exp @@ -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))" \