2017-12-10 22:00:49 +00:00
|
|
|
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
2017-12-08 04:31:26 +00:00
|
|
|
From: Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
Date: Thu, 7 Dec 2017 16:20:31 -0500
|
|
|
|
Subject: gdb-vla-intel-fix-print-char-array.patch
|
|
|
|
|
|
|
|
FileName: gdb-vla-intel-fix-print-char-array.patch
|
|
|
|
|
|
|
|
;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
|
|
|
|
|
|
|
|
Revert commit (only the part touching gdb/f-valprint.c):
|
|
|
|
|
|
|
|
commit 469412dd9ccc4de5874fd3299b105833f36b34cd
|
|
|
|
Author: Christoph Weinmann <christoph.t.weinmann@intel.com>
|
|
|
|
Date: Fri Sep 8 15:11:47 2017 +0200
|
|
|
|
|
|
|
|
Remove C/C++ relevant code in Fortran specific file.
|
|
|
|
|
|
|
|
Remove code relevant for printing C/C++ Integer values in a
|
|
|
|
Fortran specific file to unify printing of Fortran values.
|
|
|
|
This does not change the output.
|
|
|
|
|
|
|
|
And adjust its testcase.
|
|
|
|
---
|
|
|
|
gdb/f-valprint.c | 18 ++++++++++++++++--
|
|
|
|
gdb/testsuite/gdb.fortran/printing-types.exp | 2 +-
|
|
|
|
2 files changed, 17 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
|
2017-12-18 17:28:39 +00:00
|
|
|
index bd2e2a7d32..88ca97cbcc 100644
|
2017-12-08 04:31:26 +00:00
|
|
|
--- a/gdb/f-valprint.c
|
|
|
|
+++ b/gdb/f-valprint.c
|
2017-12-18 17:28:39 +00:00
|
|
|
@@ -313,8 +313,22 @@ f_val_print (struct type *type, LONGEST embedded_offset,
|
2017-12-08 04:31:26 +00:00
|
|
|
original_value, &opts, 0, stream);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
- val_print_scalar_formatted (type, embedded_offset,
|
|
|
|
- original_value, options, 0, stream);
|
|
|
|
+ {
|
|
|
|
+ val_print_scalar_formatted (type, embedded_offset,
|
|
|
|
+ original_value, options, 0, stream);
|
|
|
|
+ /* C and C++ has no single byte int type, char is used instead.
|
|
|
|
+ Since we don't know whether the value is really intended to
|
|
|
|
+ be used as an integer or a character, print the character
|
|
|
|
+ equivalent as well. */
|
|
|
|
+ if (TYPE_LENGTH (type) == 1)
|
|
|
|
+ {
|
|
|
|
+ LONGEST c;
|
|
|
|
+
|
|
|
|
+ fputs_filtered (" ", stream);
|
|
|
|
+ c = unpack_long (type, valaddr + embedded_offset);
|
|
|
|
+ LA_PRINT_CHAR ((unsigned char) c, type, stream);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPE_CODE_STRUCT:
|
|
|
|
diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
|
|
|
|
index 085de4fc8f..7b2c6516da 100644
|
|
|
|
--- a/gdb/testsuite/gdb.fortran/printing-types.exp
|
|
|
|
+++ b/gdb/testsuite/gdb.fortran/printing-types.exp
|
|
|
|
@@ -29,7 +29,7 @@ if {![runto MAIN__]} then {
|
|
|
|
gdb_breakpoint [gdb_get_line_number "write"]
|
|
|
|
gdb_continue_to_breakpoint "write"
|
|
|
|
|
|
|
|
-gdb_test "print oneByte" " = 1"
|
|
|
|
+gdb_test "print oneByte" " = 1 \'\\\\001\'"
|
|
|
|
gdb_test "print twobytes" " = 2"
|
|
|
|
gdb_test "print chvalue" " = \'a\'"
|
|
|
|
gdb_test "print logvalue" " = \.TRUE\."
|
|
|
|
--
|
|
|
|
2.14.3
|
|
|
|
|