diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-12-13 15:31:59 +0100 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-12-13 15:31:59 +0100 |
commit | 5537b577695dd5cd72395590d7ebd7aa92ee856a (patch) | |
tree | e6056d71387242223a6d42b4b8d384c9c07612e0 /gdb/testsuite/gdb.base/vla-stub.c | |
parent | 14aba1ac0d583ebd77b7645f88308d75c0a69d0f (diff) | |
download | gdb-5537b577695dd5cd72395590d7ebd7aa92ee856a.zip gdb-5537b577695dd5cd72395590d7ebd7aa92ee856a.tar.gz gdb-5537b577695dd5cd72395590d7ebd7aa92ee856a.tar.bz2 |
Fix 7.8 regression: resolve_dynamic_struct: Assertion `TYPE_NFIELDS (type) > 0' (PR 17642)
https://sourceware.org/bugzilla/show_bug.cgi?id=17642
Regression since:
commit 012370f6818657a816df1463ee71ca4e4ee40b33
Author: Tom Tromey <tromey@redhat.com>
Date: Thu May 8 11:26:44 2014 -0600
handle VLA in a struct or union
Bugreport:
Regression with gdb scripts for Linux kernel
https://sourceware.org/ml/gdb/2014-08/msg00127.html
That big change after "else" is just reindentation.
gdb/ChangeLog
2014-12-13 Jan Kratochvil <jan.kratochvil@redhat.com>
PR symtab/17642
* gdbtypes.c (resolve_dynamic_type_internal): Apply check_typedef to
TYPE if not TYPE_CODE_TYPEDEF.
gdb/testsuite/ChangeLog
2014-12-13 Jan Kratochvil <jan.kratochvil@redhat.com>
PR symtab/17642
* gdb.base/vla-stub-define.c: New file.
* gdb.base/vla-stub.c: New file.
* gdb.base/vla-stub.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.base/vla-stub.c')
-rw-r--r-- | gdb/testsuite/gdb.base/vla-stub.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/vla-stub.c b/gdb/testsuite/gdb.base/vla-stub.c new file mode 100644 index 0000000..b7ccf041 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla-stub.c @@ -0,0 +1,37 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2014 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +struct dynamic_struct; +typedef struct dynamic_struct dynamic_struct_t; + +struct static_struct +{ + int field; +}; +typedef struct static_struct static_struct_t; + +struct local_struct +{ + static_struct_t here; + dynamic_struct_t *ptr; +} local_struct; + +int +main (void) +{ + return 0; +} |