Browse Source
https://sourceware.org/bugzilla/show_bug.cgi?id=17642
Regression since:
commit 012370f681
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.
gdb-7.9-branch
6 changed files with 126 additions and 24 deletions
@ -0,0 +1,21 @@ |
|||
/* 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 |
|||
{ |
|||
int dynamic_field[0]; |
|||
} use_dynamic_struct; |
|||
@ -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; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
# 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/>. |
|||
|
|||
standard_testfile .c vla-stub-define.c |
|||
if { [prepare_for_testing "failed to prepare for vla-stub.exp" \ |
|||
${testfile} [list ${srcfile} ${srcfile2}]] } { |
|||
return -1 |
|||
} |
|||
|
|||
gdb_test "p *local_struct.ptr" { = {dynamic_field = 0x0}} |
|||
|
|||
gdb_test "whatis local_struct.here" "type = static_struct_t" |
|||
gdb_test "whatis *local_struct.ptr" "type = dynamic_struct_t" |
|||
Loading…
Reference in new issue