]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
In a couple functions (type_update_when_use_rtti_test and
authorLuis Machado <lgustavo@codesourcery.com>
Tue, 17 Jun 2014 09:42:23 +0000 (10:42 +0100)
committerLuis Machado <lgustavo@codesourcery.com>
Tue, 17 Jun 2014 09:42:23 +0000 (10:42 +0100)
commit70795c525e5b8ca5e9fb8ffbaf33a5f281d53320
treeb518559fe27b901ede536fcdb97dc6c285ffceda
parentc8de034b6ae75f0b23d45d15c927daac61c33a3c
In a couple functions (type_update_when_use_rtti_test and
skip_type_update_when_not_use_rtti_test) the testcase assumes an
uninitialized object has a specific type. In particular, 'ptr' and
's'.

In reality the compiler is free to do what it wants with that
uninitialized variable, even initialize it beforehand with the future
assignment's value.  This is exactly what happens on some targets.

ptr should have type 'Base *', but it really has type 'Derived *'
because it is already initialized (earlier) by the compiler. The same
thing happens to 's'.

The following patch addresses this by explicitly initializing those
variables so the compiler doesn't optimize their assignments and GDB
can print their correct values.

2014-06-17  Luis Machado  <lgustavo@codesourcery.com>

* gdb.mi/mi-var-rtti.cc (type_update_when_use_rtti_test):
Initialize ptr and S explicitly.
(skip_type_update_when_not_use_rtti_test): Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi-var-rtti.cc