Fix type of values representing optimized out static members
authorSimon Marchi <simark@simark.ca>
Wed, 7 Feb 2018 13:48:14 +0000 (08:48 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 7 Feb 2018 13:49:56 +0000 (08:49 -0500)
commitc2e0e465f9488970c7e460a41e3fb7c366530619
tree00cfae01e81e136757a6d03ff938de392d073f29
parent407aa07cee4d075c8e7996a5e994c02e76f19276
Fix type of values representing optimized out static members

As reported here:

  https://sourceware.org/ml/gdb/2018-02/msg00019.html

the type of values representing static members that are optimized out is
wrong.  It currently assigns the type of the containing class rather
than the type of the field.  This patch fixes that.

I found a place in m-static.exp already dealing with optimized out
static members, so I just added some gdb_test there.

gdb/ChangeLog:

* value.c (value_static_field): Assign field type instead of
containing type when returning an optimized out value.

gdb/testsuite/ChangeLog:

* gdb.cp/m-static.exp: Check type of optimized out static
member.
gdb/ChangeLog
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/m-static.exp
gdb/value.c