gdb/gdb-rhbz795424-bitpos-25of25.patch
Michael Matz a2f8e1d8c6 - Update to gdb 7.12.1
* negative repeat count for x examines backwards
  * fortran: support structs/arrays with dynamically types fields
  * support MPX bound checking
  * support for the Rust language
  * 'catch syscall' now can catch groups of related syscalls
  * New (sub)commands:
    - skip {-file,-gfile,-function,-rfunction}: generic skip
      mechanism
    - maint {selftest,info line-table}
    - new-ui: create new user interface for GUI clients
  * (fast) tracepoints on s390x and ppc64le added to gdbserver
  * New target Andes NDS32
- Remove patch gdb-aarch64-v81-hwbreakpoints.diff (upstream)
- Add patches from Fedora package:
    gdb-6.7-testsuite-stable-results.patch
    gdb-add-index-chmod.patch
    gdb-bison-old.patch
    gdb-container-rh-pkg.patch
    gdb-libexec-add-index.patch
    gdb-linux_perf-bundle.patch
    gdb-physname-pr11734-test.patch
    gdb-physname-pr12273-test.patch
    gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
    gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
    gdb-rhbz1149205-catch-syscall-after-fork-test.patch
    gdb-rhbz1156192-recursive-dlopen-test.patch
    gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
    gdb-rhbz1350436-type-printers-error.patch
    gdb-test-ivy-bridge.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=151
2017-02-15 16:05:56 +00:00

137 lines
4.4 KiB
Diff

http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html
Subject: [PATCH] Expand fortran array bounds sizes to LONGEST
--MP_/90J7bck2fqDySEX9JkZtaqL
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
Range bounds for a gdb type can have LONGEST values for low and high
bounds. Fortran range bounds functions however use only int. The larger
ranges don't compile by default on gcc, but it is possible to override
the check in the compiler by using -fno-range-check. As a result, this
check is necessary so that we don't print junk in case of an overflow.
Attached patch does this expansion and also includes a test case that
verifies that the problem is fixed. I have also verified on x86_64 that
this patch does not cause any regressions.
Regards,
Siddhesh
gdb/ChangeLog:
* f-lang.h (f77_get_upperbound): Return LONGEST.
(f77_get_lowerbound): Likewise.
* f-typeprint.c (f_type_print_varspec_suffix): Expand
UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format
print them.
(f_type_print_base): Expand UPPER_BOUND to LONGEST. Use
plongest to format print it.
* f-valprint.c (f77_get_lowerbound): Return LONGEST.
(f77_get_upperbound): Likewise.
(f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND,
LOWER_BOUND to LONGEST.
(f77_create_arrayprint_offset_tbl): Likewise.
testsuite/ChangeLog:
* gdb.fortran/array-bounds.exp: New test case.
* gdb.fortran/array-bounds.f: New test case.
--MP_/90J7bck2fqDySEX9JkZtaqL
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=f77-bounds.patch
Index: gdb-7.11.90.20160907/gdb/f-lang.h
===================================================================
--- gdb-7.11.90.20160907.orig/gdb/f-lang.h 2016-09-07 21:48:33.308624019 +0200
+++ gdb-7.11.90.20160907/gdb/f-lang.h 2016-09-07 21:48:40.967692469 +0200
@@ -49,9 +49,9 @@
struct symbol *contents[1];
};
-extern int f77_get_upperbound (struct type *);
+extern LONGEST f77_get_upperbound (struct type *);
-extern int f77_get_lowerbound (struct type *);
+extern LONGEST f77_get_lowerbound (struct type *);
extern void f77_get_dynamic_array_length (struct type *);
Index: gdb-7.11.90.20160907/gdb/f-typeprint.c
===================================================================
--- gdb-7.11.90.20160907.orig/gdb/f-typeprint.c 2016-09-07 21:48:33.309624028 +0200
+++ gdb-7.11.90.20160907/gdb/f-typeprint.c 2016-09-07 21:48:40.967692469 +0200
@@ -147,7 +147,7 @@
int show, int passed_a_ptr, int demangled_args,
int arrayprint_recurse_level, int print_rank_only)
{
- int upper_bound, lower_bound;
+ LONGEST upper_bound, lower_bound;
/* No static variables are permitted as an error call may occur during
execution of this function. */
@@ -194,7 +194,7 @@
{
lower_bound = f77_get_lowerbound (type);
if (lower_bound != 1) /* Not the default. */
- fprintf_filtered (stream, "%d:", lower_bound);
+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
/* Make sure that, if we have an assumed size array, we
print out a warning and print the upperbound as '*'. */
@@ -204,7 +204,7 @@
else
{
upper_bound = f77_get_upperbound (type);
- fprintf_filtered (stream, "%d", upper_bound);
+ fprintf_filtered (stream, "%s", plongest (upper_bound));
}
}
@@ -276,7 +276,7 @@
f_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
- int upper_bound;
+ LONGEST upper_bound;
int index;
QUIT;
@@ -358,7 +358,7 @@
else
{
upper_bound = f77_get_upperbound (type);
- fprintf_filtered (stream, "character*%d", upper_bound);
+ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
}
break;
Index: gdb-7.11.90.20160907/gdb/f-valprint.c
===================================================================
--- gdb-7.11.90.20160907.orig/gdb/f-valprint.c 2016-09-07 21:48:33.309624028 +0200
+++ gdb-7.11.90.20160907/gdb/f-valprint.c 2016-09-07 21:48:40.967692469 +0200
@@ -43,7 +43,7 @@
/* Array which holds offsets to be applied to get a row's elements
for a given array. Array also holds the size of each subarray. */
-int
+LONGEST
f77_get_lowerbound (struct type *type)
{
if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
@@ -52,7 +52,7 @@
return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
}
-int
+LONGEST
f77_get_upperbound (struct type *type)
{
if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))