#11 Align gdb-vla-intel-fortran-vla-strings.patch more to upstream,
Closed 7 months ago by jankratochvil. Opened 7 months ago by jankratochvil.
rpms/ jankratochvil/gdb align  into  rawhide

@@ -221,15 +221,7 @@ 

         /* Use 1 as a fallback length if we have nothing else.  */

         length = 1;

       }

- @@ -17603,6 +17673,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)

-        low_bound.set_const_val (1);

-        range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0);

-      }

- +

-    char_type = language_string_char_type (cu->language_defn, gdbarch);

-    type = create_string_type (NULL, char_type, range_type);

-  

- @@ -18078,7 +18149,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)

+ @@ -18078,7 +18148,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)

   static int

   attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,

   		      struct dwarf2_cu *cu, struct dynamic_prop *prop,
@@ -239,7 +231,7 @@ 

   {

     struct dwarf2_property_baton *baton;

     dwarf2_per_objfile *per_objfile = cu->per_objfile;

- @@ -18108,6 +18180,26 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,

+ @@ -18108,6 +18179,26 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,

   	  break;

   	}

   
@@ -266,7 +258,7 @@ 

         prop->set_locexpr (baton);

         gdb_assert (prop->baton () != NULL);

       }

- @@ -18142,11 +18234,31 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,

+ @@ -18142,11 +18233,31 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,

   		baton->property_type = die_type (target_die, target_cu);

   		baton->locexpr.per_cu = cu->per_cu;

   		baton->locexpr.per_objfile = per_objfile;
@@ -301,7 +293,7 @@ 

   	      }

   	    else

   	      {

- @@ -18308,8 +18420,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

+ @@ -18308,8 +18419,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

       }

   

     attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
@@ -312,7 +304,7 @@ 

     else if (!low_default_is_valid)

       complaint (_("Missing DW_AT_lower_bound "

   				      "- DIE at %s [in module %s]"),

- @@ -18318,10 +18430,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

+ @@ -18318,10 +18429,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

   

     struct attribute *attr_ub, *attr_count;

     attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu);
@@ -325,7 +317,7 @@ 

   	{

   	  /* If bounds are constant do the final calculation here.  */

   	  if (low.kind () == PROP_CONST && high.kind () == PROP_CONST)

- @@ -18372,7 +18484,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

+ @@ -18372,7 +18483,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

       {

         struct type *prop_type = cu->addr_sized_int_type (false);

         attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop,
@@ -334,7 +326,7 @@ 

       }

   

     struct dynamic_prop bit_stride_prop;

- @@ -18392,7 +18504,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

+ @@ -18392,7 +18503,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)

   	{

   	  struct type *prop_type = cu->addr_sized_int_type (false);

   	  attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop,
@@ -343,7 +335,7 @@ 

   	}

       }

   

- @@ -24424,7 +24536,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)

+ @@ -24424,7 +24535,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)

     if (attr != NULL)

       {

         struct type *prop_type = cu->addr_sized_int_type (false);
@@ -352,7 +344,7 @@ 

           type->add_dyn_prop (DYN_PROP_ALLOCATED, prop);

       }

   

- @@ -24433,13 +24545,13 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)

+ @@ -24433,13 +24544,13 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)

     if (attr != NULL)

       {

         struct type *prop_type = cu->addr_sized_int_type (false);
@@ -391,15 +383,6 @@ 

   	    }

   	}

   

- @@ -249,7 +250,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,

-      case TYPE_CODE_REF:

-        f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,

-  				   arrayprint_recurse_level, false);

- -      fprintf_filtered (stream, " )");

- +      fprintf_filtered (stream, ")");

-        break;

-  

-      case TYPE_CODE_FUNC:

  diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c

  --- a/gdb/gdbtypes.c

  +++ b/gdb/gdbtypes.c
@@ -574,15 +557,15 @@ 

  +

  +gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]

  +gdb_continue_to_breakpoint "Before pointer assignment"

- +gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) 0x0" "print logp, not associated"

+ +gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"

  +gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"

- +gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) 0x0" "print comp, not associated"

+ +gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"

  +gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"

- +gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) 0x0" "print charp, not associated"

+ +gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"

  +gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"

- +gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) 0x0" "print charap, not associated"

+ +gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"

  +gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"

- +gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" "print intp, not associated"

+ +gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"

  +gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"

  +set test "print intap, not associated"

  +gdb_test_multiple "print intap" $test {
@@ -593,9 +576,9 @@ 

  +    pass $test

  +  }

  +}

- +gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) 0x0" "print realp, not associated"

+ +gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"

  +gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"

- +gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0"

+ +gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"

  +set test "print cyclicp1, not associated"

  +gdb_test_multiple "print cyclicp1" $test {

  +  -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
@@ -607,10 +590,10 @@ 

  +}

  +set test "print cyclicp1%p, not associated"

  +gdb_test_multiple "print cyclicp1%p" $test {

- +  -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) 0x0\r\n$gdb_prompt $" {

+ +  -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {

  +    pass $test

  +  }

- +  -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) <not associated>\r\n$gdb_prompt $" {

+ +  -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {

  +    pass $test

  +  }

  +}
@@ -623,15 +606,15 @@ 

  +

  +gdb_breakpoint [gdb_get_line_number "After value assignment"]

  +gdb_continue_to_breakpoint "After value assignment"

- +gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *logp" "= \\.TRUE\\."

- +gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *comp" "= \\(1,2\\)"

- +gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *charp" "= 'a'"

- +gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *charap" "= 'abc'"

- +gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *intp" "= 10"

  +set test_name "print intap, associated"

  +gdb_test_multiple "print intap" $test_name {
@@ -653,16 +636,16 @@ 

  +    pass $test_name

  +  }

  +}

- +gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *realp" "= 3\\.14000\\d+"

- +gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"

  +set test_name "print arrayOfPtr(3)%p"

  +gdb_test_multiple $test_name $test_name {

- +  -re "= \\(PTR TO -> \\( Type two\\)\\) <not associated>\r\n$gdb_prompt $" {

+ +  -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {

  +    pass $test_name

  +  }

- +  -re "= \\(PTR TO -> \\( Type two\\)\\) 0x0\r\n$gdb_prompt $" {

+ +  -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {

  +    pass $test_name

  +  }

  +}
@@ -676,10 +659,10 @@ 

  +  }

  +}

  +gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"

- +gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer\\)\\) $hex\( <.*>\)?"

+ +gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"

  +gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"

  +gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"

- +gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\) \\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"

+ +gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\) \\(\\) \\)\\) $hex <pointers\\+\\d+>" "Print program counter"

  diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90

  --- a/gdb/testsuite/gdb.fortran/pointers.f90

  +++ b/gdb/testsuite/gdb.fortran/pointers.f90
@@ -773,48 +756,14 @@ 

   # 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

- @@ -42,7 +43,7 @@ set complex [fortran_complex4]

-  # matches the string TYPE.

-  proc check_pointer_type { var_name type } {

-      gdb_test "ptype ${var_name}" \

- -	"type = PTR TO -> \\( ${type} \\)"

- +	"type = PTR TO -> \\( ${type}\\)"

-  }

-  

-  gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]

- @@ -87,7 +88,8 @@ gdb_test "ptype twop" \

-      [multi_line "type = PTR TO -> \\( Type two" \

-                  "    $int, allocatable :: ivla1\\(:\\)" \

+ @@ -89,6 +90,7 @@ gdb_test "ptype twop" \

                   "    $int, allocatable :: ivla2\\(:,:\\)" \

- -                "End Type two \\)"]

- +                "End Type two\\)"]

- +

+                  "End Type two \\)"]

   

+ +

   gdb_breakpoint [gdb_get_line_number "After value assignment"]

   gdb_continue_to_breakpoint "After value assignment"

- @@ -99,11 +101,11 @@ gdb_test "ptype intv" "type = $int"

-  gdb_test "ptype inta" "type = $int \\(10,2\\)"

-  gdb_test "ptype realv" "type = $real"

-  

- -gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)"

- -gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)"

- -gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)"

- -gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)"

- -gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)"

- +gdb_test "ptype logp" "type = PTR TO -> \\( $logical\\)"

- +gdb_test "ptype comp" "type = PTR TO -> \\( $complex\\)"

- +gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1\\)"

- +gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3\\)"

- +gdb_test "ptype intp" "type = PTR TO -> \\( $int\\)"

-  set test "ptype intap"

-  gdb_test_multiple $test $test {

-      -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {

- @@ -113,4 +115,4 @@ gdb_test_multiple $test $test {

-          pass $test

-      }

-  }

- -gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"

- +gdb_test "ptype realp" "type = PTR TO -> \\( $real\\)"

+  gdb_test "ptype logv" "type = $logical"

  diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp

  new file mode 100644

  --- /dev/null
@@ -854,7 +803,7 @@ 

  +gdb_continue_to_breakpoint "var_char-allocated-1"

  +set test "whatis var_char first time"

  +gdb_test_multiple "whatis var_char" $test {

- +    -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {

+ +    -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {

  +	    pass $test

  +    }

  +    -re "type = character\\*10\r\n$gdb_prompt $" {
@@ -863,7 +812,7 @@ 

  +}

  +set test "ptype var_char first time"

  +gdb_test_multiple "ptype var_char" $test {

- +    -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {

+ +    -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {

  +	    pass $test

  +    }

  +    -re "type = character\\*10\r\n$gdb_prompt $" {
@@ -881,7 +830,7 @@ 

  +gdb_continue_to_breakpoint "var_char-filled-1"

  +set test "print var_char, var_char-filled-1"

  +gdb_test_multiple "print var_char" $test {

- +    -re "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\r\n$gdb_prompt $" {

+ +    -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {

  +        gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"

  +	    pass $test

  +    }
@@ -891,7 +840,7 @@ 

  +}

  +set test "ptype var_char, var_char-filled-1"

  +gdb_test_multiple "ptype var_char" $test {

- +    -re "type = PTR TO -> \\( character\\*3\\)\r\n$gdb_prompt $" {

+ +    -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {

  +	    pass $test

  +    }

  +    -re "type = character\\*3\r\n$gdb_prompt $" {
@@ -906,7 +855,7 @@ 

  +gdb_continue_to_breakpoint "var_char-filled-2"

  +set test "print var_char, var_char-filled-2"

  +gdb_test_multiple "print var_char" $test {

- +    -re "= \\(PTR TO -> \\( character\\*6\\)\\) $hex\r\n$gdb_prompt $" {

+ +    -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {

  +        gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"

  +	    pass $test

  +    }
@@ -916,7 +865,7 @@ 

  +}

  +set test "ptype var_char, var_char-filled-2"

  +gdb_test_multiple "ptype var_char" $test {

- +    -re "type = PTR TO -> \\( character\\*6\\)\r\n$gdb_prompt $" {

+ +    -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {

  +	    pass $test

  +    }

  +    -re "type = character\\*6\r\n$gdb_prompt $" {
@@ -967,45 +916,6 @@ 

  +  var_char_p => null()

  +  l = associated(var_char_p)              ! var_char_p-not-associated

  +end program vla_strings

- diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp

- --- a/gdb/testsuite/gdb.fortran/vla-value.exp

- +++ b/gdb/testsuite/gdb.fortran/vla-value.exp

- @@ -37,7 +37,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"]

-  gdb_continue_to_breakpoint "vla1-init"

-  gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"

-  gdb_test "print &vla1" \

- -  " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\) \\\)\\\) $hex" \

- +  " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\)\\\)\\\) $hex" \

-    "print non-allocated &vla1"

-  gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \

-    "print member in non-allocated vla1 (1)"

- @@ -58,7 +58,7 @@ with_timeout_factor 15 {

-  	"step over value assignment of vla1"

-  }

-  gdb_test "print &vla1" \

- -  " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \

- +  " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\)\\\)\\\) $hex" \

-    "print allocated &vla1"

-  gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"

-  gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"

- @@ -78,7 +78,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \

-  # Try to access values in undefined pointer to VLA (dangling)

-  gdb_test "print pvla" " = <not associated>" "print undefined pvla"

-  gdb_test "print &pvla" \

- -  " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\) \\\)\\\) $hex" \

- +  " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \

-    "print non-associated &pvla"

-  gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \

-    "print undefined pvla(1,3,8)"

- @@ -87,7 +87,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated

-  gdb_breakpoint [gdb_get_line_number "pvla-associated"]

-  gdb_continue_to_breakpoint "pvla-associated"

-  gdb_test "print &pvla" \

- -  " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\) \\\)\\\) $hex" \

- +  " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \

-    "print associated &pvla"

-  gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)"

-  gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)"

  diff --git a/gdb/typeprint.c b/gdb/typeprint.c

  --- a/gdb/typeprint.c

  +++ b/gdb/typeprint.c
@@ -1068,19 +978,3 @@ 

   	}

         arg2 = value_at_lazy (enc_type, base_addr);

         enc_type = value_type (arg2);

- diff --git a/gdb/valprint.c b/gdb/valprint.c

- --- a/gdb/valprint.c

- +++ b/gdb/valprint.c

- @@ -1046,12 +1046,6 @@ value_check_printable (struct value *val, struct ui_file *stream,

-        return 0;

-      }

-  

- -  if (type_not_associated (value_type (val)))

- -    {

- -      val_print_not_associated (stream);

- -      return 0;

- -    }

- -

-    if (type_not_allocated (value_type (val)))

-      {

-        val_print_not_allocated (stream);

file modified
+18 -68
@@ -5,28 +5,6 @@ 

  

  ;;=fedoratest

  

- diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp

- --- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp

- +++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp

- @@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1"

-  gdb_test "ptype tinsta" \

-    [multi_line "type = Type tuserdef" \

-                "    $int :: i" \

- -              "    PTR TO -> \\( $real :: ptr \\)" \

- +              "    PTR TO -> \\( $real :: ptr\\)" \

-                "End Type tuserdef"]

- diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp

- --- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp

- +++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp

- @@ -42,7 +42,7 @@ gdb_test "ptype say_numbers" \

-      "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"

-  

-  gdb_test "ptype fun_ptr" \

- -    "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"

- +    "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)"

-  

-  gdb_test "ptype say_string" \

-      "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"

  diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp

  new file mode 100644

  --- /dev/null
@@ -169,16 +147,6 @@ 

  +

  +  ret = .TRUE.                ! func2-returned

  +end program vla_func

- diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp

- --- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp

- +++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp

- @@ -33,5 +33,5 @@ set real4 [fortran_real4]

-  # Check the status of a pointer to a dynamic array.

-  gdb_breakpoint [gdb_get_line_number "pvla-associated"]

-  gdb_continue_to_breakpoint "pvla-associated"

- -gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\) \\)\\) ${hex}" \

- +gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\)\\)\\) ${hex}" \

-    "print pvla pointer information"

  diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp

  new file mode 100644

  --- /dev/null
@@ -217,11 +185,11 @@ 

  +gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]

  +gdb_continue_to_breakpoint "var_char-allocated-1"

  +gdb_test "print var_char" \

- +  " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \

  +  "print var_char after allocated first time"

- +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \

+ +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \

  +  "whatis var_char first time"

- +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \

+ +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \

  +  "ptype var_char first time"

  +gdb_test "next" "\\d+.*var_char = 'foo'.*" \

  +  "next to allocation status of var_char"
@@ -230,13 +198,13 @@ 

  +gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]

  +gdb_continue_to_breakpoint "var_char-filled-1"

  +gdb_test "print var_char" \

- +  " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \

  +  "print var_char after filled first time"

  +gdb_test "print *var_char" " = 'foo'" \

  +  "print *var_char after filled first time"

- +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \

+ +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \

  +  "whatis var_char after filled first time"

- +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \

+ +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \

  +  "ptype var_char after filled first time"

  +gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"

  +gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
@@ -244,46 +212,46 @@ 

  +gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]

  +gdb_continue_to_breakpoint "var_char-filled-2"

  +gdb_test "print var_char" \

- +  " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \

  +  "print var_char after allocated second time"

  +gdb_test "print *var_char" " = 'foobar'" \

  +  "print *var_char after allocated second time"

- +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \

+ +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \

  +  "whatis var_char second time"

- +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \

+ +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \

  +  "ptype var_char second time"

  +

  +gdb_breakpoint [gdb_get_line_number "var_char-empty"]

  +gdb_continue_to_breakpoint "var_char-empty"

  +gdb_test "print var_char" \

- +  " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \

  +  "print var_char after set empty"

  +gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"

- +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \

+ +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \

  +  "whatis var_char after set empty"

- +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \

+ +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \

  +  "ptype var_char after set empty"

  +

  +gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]

  +gdb_continue_to_breakpoint "var_char-allocated-3"

  +gdb_test "print var_char" \

- +  " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \

  +  "print var_char after allocated third time"

- +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \

+ +gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \

  +  "whatis var_char after allocated third time"

- +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \

+ +gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \

  +  "ptype var_char after allocated third time"

  +

  +gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]

  +gdb_continue_to_breakpoint "var_char_p-associated"

  +gdb_test "print var_char_p" \

- +  " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \

+ +  " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \

  +  "print var_char_p after associated"

  +gdb_test "print *var_char_p" " = 'johndoe'" \

  +  "print *var_char_ after associated"

- +gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \

+ +gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \

  +  "whatis var_char_p after associated"

- +gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \

+ +gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \

  +  "ptype var_char_p after associated"

  diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90

  new file mode 100644
@@ -330,21 +298,3 @@ 

  +  var_char_p => null()

  +  l = associated(var_char_p)              ! var_char_p-not-associated

  +end program vla_strings

- diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp

- --- a/gdb/testsuite/gdb.fortran/whatis_type.exp

- +++ b/gdb/testsuite/gdb.fortran/whatis_type.exp

- @@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2"

-  gdb_test "whatis t2v" "type = Type t2"

-  gdb_test "whatis t3" "type = Type t3"

-  gdb_test "whatis t3v" "type = Type t3"

- -gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"

- +gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)"

-  

-  gdb_test "ptype t1" \

-    [multi_line "type = Type t1" \

- @@ -73,4 +73,4 @@ gdb_test "ptype t3p" \

-    [multi_line "type = PTR TO -> \\( Type t3" \

-                "    $int :: t3_i" \

-                "    Type t2 :: t2_n" \

- -              "End Type t3 \\)"]

- +              "End Type t3\\)"]

file modified
+5 -1
@@ -37,7 +37,7 @@ 

  

  # The release always contains a leading reserved number, start it at 1.

  # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.

- Release: 9%{?dist}

+ Release: 10%{?dist}

  

  License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL

  # Do not provide URL for snapshots as the file lasts there only for 2 days.
@@ -1195,6 +1195,10 @@ 

  %endif

  

  %changelog

+ * Thu Mar  4 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-10

+ - Align gdb-vla-intel-fortran-vla-strings.patch more to upstream,

+   particularly whitespaces in Fortran types printing.

+ 

  * Wed Feb 24 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-9

  - Fix aarch64 build problem (RHBZ 1932645, Kevin Buettner).

  

particularly whitespaces in Fortran types printing.

Pull-Request has been closed by jankratochvil

7 months ago