diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-07-08 14:42:19 +0200 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-07-08 14:42:19 +0200 |
commit | 084641963dba63283bf2eca227f4f77c2598b172 (patch) | |
tree | 2e5715e2ac8d9a6b01c21e02516f0f00d5718a07 /gdb/compile | |
parent | bcf5c1d96b3b5493041002eb2b6d27288d9d160a (diff) | |
download | gdb-084641963dba63283bf2eca227f4f77c2598b172.zip gdb-084641963dba63283bf2eca227f4f77c2598b172.tar.gz gdb-084641963dba63283bf2eca227f4f77c2598b172.tar.bz2 |
compile: Warn for old GCC on cv-qualified self-reference
GDB could:
compile code struct_object.selffield = &struct_object
./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal
error)
The bug was not in GDB but in the GCC part interfacing with GDB.
Alexandre Oliva has fixed it the right way:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commitdiff;h=072dfdba0ea62abb65514cb3a90cdf3868efe286
git://gcc.gnu.org/git/gcc.git
aoliva/libcp1
Attaching this GDB testsuite update + info to user s/he should upgrade GCC.
After Alex upstreams the fix I can update the message to contain the specific
GCC release.
gdb/ChangeLog
2015-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
PR compile/18484
* compile/compile-c-types.c (insert_type): Change gdb_assert to error.
gdb/testsuite/ChangeLog
2015-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
PR compile/18484
* gdb.compile/compile.c (struct struct_type): Add volatile to
selffield's type.
* gdb.compile/compile.exp
(compile code struct_object.selffield = &struct_object): Skip further
struct_object tests if this one xfails.
Diffstat (limited to 'gdb/compile')
-rw-r--r-- | gdb/compile/compile-c-types.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c index 22f5a9d..1ad3dd9 100644 --- a/gdb/compile/compile-c-types.c +++ b/gdb/compile/compile-c-types.c @@ -78,7 +78,8 @@ insert_type (struct compile_c_instance *context, struct type *type, add = *slot; /* The type might have already been inserted in order to handle recursive types. */ - gdb_assert (add == NULL || add->gcc_type == gcc_type); + if (add != NULL && add->gcc_type != gcc_type) + error (_("Unexpected type id from GCC, check you use recent enough GCC.")); if (add == NULL) { |