gdb/ChangeLog:

* c-typeprint.c (c_type_print_varspec_suffix): Remove cast and
	use plongest to print the array size.

testsuite/ChangeLog:

	* gdb.base/longest-types.c: New test case.
	* gdb.base/longest-types.exp: New test case.
This commit is contained in:
Siddhesh Poyarekar 2012-09-25 12:20:42 +00:00
parent ec4dbad32d
commit 318102b961
5 changed files with 65 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com>
* c-typeprint.c (c_type_print_varspec_suffix): Remove cast and
use plongest to print the array size.
2012-09-24 Siddhesh Poyarekar <siddhesh@redhat.com>
* m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST.

View File

@ -621,8 +621,8 @@ c_type_print_varspec_suffix (struct type *type,
fprintf_filtered (stream, (is_vector ?
"__attribute__ ((vector_size(" : "["));
if (get_array_bounds (type, &low_bound, &high_bound))
fprintf_filtered (stream, "%d",
(int) (high_bound - low_bound + 1));
fprintf_filtered (stream, "%s",
plongest (high_bound - low_bound + 1));
fprintf_filtered (stream, (is_vector ? ")))" : "]"));
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,

View File

@ -1,3 +1,8 @@
2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com>
* gdb.base/longest-types.c: New test case.
* gdb.base/longest-types.exp: New test case.
2012-09-25 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi2-cli.exp: Check breakpoint notification.

View File

@ -0,0 +1,28 @@
/* This testcase is part of GDB, the GNU debugger.
Copyright 2012 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 foo
{
char buf[0xffff000000];
char buf2[2];
} *f;
int
main (void)
{
return 0;
}

View File

@ -0,0 +1,25 @@
# This testcase is part of GDB, the GNU debugger.
# Copyright 2012 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
if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
return -1
}
# 64-bit array size should not overflow
gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}