Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gdb for openSUSE:Factory checked in 
at 2022-10-01 17:42:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gdb (Old)
 and      /work/SRC/openSUSE:Factory/.gdb.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gdb"

Sat Oct  1 17:42:04 2022 rev:166 rq:1006865 version:12.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/gdb/gdb.changes  2022-09-25 15:34:11.151461484 
+0200
+++ /work/SRC/openSUSE:Factory/.gdb.new.2275/gdb.changes        2022-10-01 
17:42:11.889565365 +0200
@@ -1,0 +2,27 @@
+Thu Sep 29 08:25:06 UTC 2022 - Fabian Vogt <fv...@suse.com>
+
+- Add patch to fix build with readline 8.2:
+  * gdb-add-support-for-readline-8.2.patch
+
+-------------------------------------------------------------------
+Wed Sep 28 11:50:45 UTC 2022 - Tom de Vries <tdevr...@suse.com>
+
+- Patches added:
+  * gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch
+- Maintenance script qa.sh:
+  * Add PR26873 kfails.
+
+-------------------------------------------------------------------
+Fri Sep 23 09:46:57 UTC 2022 - Tom de Vries <tdevr...@suse.com>
+
+- Maintenance script qa-remote.sh:
+  * Make rpm matching yet more precise.
+- Update patch:
+  * gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch
+- Add patches:
+  * gdb-handle-pending-c-after-rl_callback_read_char.patch
+  * gdb-testsuite-fix-have_mpx-test.patch
+  * gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch
+  * gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch
+
+-------------------------------------------------------------------

New:
----
  gdb-add-support-for-readline-8.2.patch
  gdb-handle-pending-c-after-rl_callback_read_char.patch
  gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch
  gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch
  gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch
  gdb-testsuite-fix-have_mpx-test.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gdb.spec ++++++
--- /var/tmp/diff_new_pack.KaZPLm/_old  2022-10-01 17:42:13.721568707 +0200
+++ /var/tmp/diff_new_pack.KaZPLm/_new  2022-10-01 17:42:13.725568714 +0200
@@ -341,6 +341,12 @@
 Patch2027:      fix-for-gdb.base-solib-search.exp-test.patch
 Patch2028:      make-gdb.ada-float-bits.exp-more-generic.patch
 Patch2029:      
gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch
+Patch2030:      gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch
+Patch2031:      gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch
+Patch2032:      gdb-handle-pending-c-after-rl_callback_read_char.patch
+Patch2033:      gdb-testsuite-fix-have_mpx-test.patch
+Patch2034:      
gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch
+Patch2035:      gdb-add-support-for-readline-8.2.patch
 
 # Backports from master, not yet available in next release.
 
@@ -378,8 +384,8 @@
 Patch2113:      gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch
 # https://sourceware.org/bugzilla/show_bug.cgi?id=29423#c8
 Patch2114:      gdb-fix-watchpoints-triggered.patch
-# https://sourceware.org/bugzilla/show_bug.cgi?id=29543#c5
-Patch2115:      gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch
+# https://sourceware.org/pipermail/gdb-patches/2022-September/192172.html
+Patch2115:      
gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch
 
 # Debug patches.
 
@@ -771,6 +777,12 @@
 %patch2027 -p1
 %patch2028 -p1
 %patch2029 -p1
+%patch2030 -p1
+%patch2031 -p1
+%patch2032 -p1
+%patch2033 -p1
+%patch2034 -p1
+%patch2035 -p1
 
 %patch2100 -p1
 %patch2101 -p1

++++++ gdb-add-support-for-readline-8.2.patch ++++++
>From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <sch...@linux-m68k.org>
Date: Sun, 20 Mar 2022 14:01:54 +0100
Subject: [PATCH] Add support for readline 8.2

In readline 8.2 the type of rl_completer_word_break_characters changed to
include const.
---
 gdb/completer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/completer.c b/gdb/completer.c
index d3900ae2014..a51c16ac7f8 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -36,7 +36,7 @@
    calling a hook instead so we eliminate the CLI dependency.  */
 #include "gdbcmd.h"
 
-/* Needed for rl_completer_word_break_characters() and for
+/* Needed for rl_completer_word_break_characters and for
    rl_filename_completion_function.  */
 #include "readline/readline.h"
 
@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw ()
       rl_basic_quote_characters = NULL;
     }
 
-  return rl_completer_word_break_characters;
+  return (char *) rl_completer_word_break_characters;
 }
 
 char *
-- 
2.31.1


++++++ gdb-handle-pending-c-after-rl_callback_read_char.patch ++++++
[gdb] Handle pending ^C after rl_callback_read_char

In completion tests in various test-cases, we've been running into these
"clearing input line" timeouts:
...
(gdb) $cmd^GPASS: gdb.gdb/unittest.exp: tab complete "$cmd"
FAIL: gdb.gdb/unittest.exp: tab complete "$cmd" (clearing input line) (timeout)
...
where $cmd == "maintenance selftest name_that_does_not_exist".

AFAIU, the following scenario happens:
- expect sends "$cmd\t"
- gdb detects the stdin event, and calls rl_callback_read_char until it
  comes to handle \t
- readline interprets the \t as completion, tries to complete, fails to do so,
  outputs a bell (^G)
- expect sees the bell, and proceeds to send ^C
- readline is still in the call to rl_callback_read_char, and stores the
  signal in _rl_caught_signal
- readline returns from the call to rl_callback_read_char, without having
  handled _rl_caught_signal
- gdb goes to wait for the next event
- expect times out waiting for "Quit", the expected reaction for ^C

Fix this by handling pending signals after each call to rl_callback_read_char.

The fix is only available for readline 8.x, if --with-system-readline provides
an older version, then the fix is disabled due to missing function
rl_check_signals.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27813

---
 gdb/event-top.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gdb/event-top.c b/gdb/event-top.c
index 96df89e0901..c7aa9e7d06a 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -186,6 +186,22 @@ gdb_rl_callback_read_char_wrapper_noexcept () noexcept
   TRY_SJLJ
     {
       rl_callback_read_char ();
+#if RL_VERSION_MAJOR >= 8
+      /* It can happen that readline (while in rl_callback_read_char)
+        received a signal, but didn't handle it yet.  Make sure it's handled
+        now.  If we don't do that we run into two related problems:
+        - we have to wait for another event triggering
+          rl_callback_read_char before the signal is handled
+        - there's no guarantee that the signal will be processed before the
+          event.  */
+      while (rl_pending_signal () != 0)
+       /* Do this in a while loop, in case rl_check_signals also leaves a
+          pending signal.  I'm not sure if that's possible, but it seems
+          better to handle the scenario than to assert.  */
+       rl_check_signals ();
+#else
+      /* Unfortunately, rl_check_signals is not available.  */
+#endif
       if (after_char_processing_hook)
        (*after_char_processing_hook) ();
     }

++++++ gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch ++++++
[gdb/symtab] Fix handling of DW_TAG_unspecified_type

Currently, the test-case contained in this patch fails:
...
(gdb) p (int) foo ()^M
Invalid cast.^M
(gdb) FAIL: gdb.dwarf2/dw2-unspecified-type.exp: p (int) foo ()
...
because DW_TAG_unspecified_type is translated as void.

There's some code in read_unspecified_type that marks the type as stub, but
that's only active for ada:
...
  if (cu->lang () == language_ada)
    type->set_is_stub (true);
...

Fix this by:
- marking the type as a stub for all languages, and
- handling the stub return type case in call_function_by_hand_dummy.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29558

---
 gdb/dwarf2/read.c                                  |  6 +-
 gdb/infcall.c                                      |  2 +-
 .../gdb.dwarf2/dw2-unspecified-type-foo.c          | 22 +++++++
 gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c    | 25 ++++++++
 gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp  | 72 ++++++++++++++++++++++
 5 files changed, 123 insertions(+), 4 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 94b12773d3e..631a6df3635 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -18744,9 +18744,9 @@ read_unspecified_type (struct die_info *die, struct 
dwarf2_cu *cu)
   /* In Ada, an unspecified type is typically used when the description
      of the type is deferred to a different unit.  When encountering
      such a type, we treat it as a stub, and try to resolve it later on,
-     when needed.  */
-  if (cu->per_cu->lang == language_ada)
-    type->set_is_stub (true);
+     when needed.
+     Mark this as a stub type for all languages though.  */
+  type->set_is_stub (true);
 
   return set_die_type (die, type, cu);
 }
diff --git a/gdb/infcall.c b/gdb/infcall.c
index f8c812c8f61..57cfa8875a5 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -817,7 +817,7 @@ call_function_by_hand_dummy (struct value *function,
             "target calling convention."),
           get_function_name (funaddr, name_buf, sizeof (name_buf)));
 
-  if (values_type == NULL)
+  if (values_type == NULL || values_type->is_stub ())
     values_type = default_return_type;
   if (values_type == NULL)
     {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c 
b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
new file mode 100644
index 00000000000..b1e3a8b98e4
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2022 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/>.  */
+
+int
+foo (void)
+{
+  asm ("foo_label: .globl foo_label");
+}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c 
b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c
new file mode 100644
index 00000000000..e3218205560
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2022 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/>.  */
+
+extern int foo (void);
+
+int
+main (void)
+{
+  int res = foo ();
+  return res;
+}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp 
b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
new file mode 100644
index 00000000000..20c31dc5740
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
@@ -0,0 +1,72 @@
+# Copyright 2022 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/>.
+
+load_lib dwarf.exp
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+if {![dwarf2_support]} {
+    return 0
+}
+
+standard_testfile .c -foo.c dwz.S
+
+set foo_res \
+    [function_range foo \
+        [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]]
+lassign $foo_res \
+    foo_start foo_len
+set foo_end "$foo_start + $foo_len"
+
+# Create the DWARF.
+set asm_file [standard_output_file $srcfile3]
+Dwarf::assemble $asm_file {
+    global foo_start foo_end
+    declare_labels unspecified_type_label
+
+    cu {} {
+       compile_unit {
+           {language @DW_LANG_Mips_Assembler}
+       } {
+           unspecified_type_label: unspecified_type {}
+
+           DW_TAG_subprogram {
+               {name foo}
+               {low_pc $foo_start addr}
+               {high_pc $foo_end addr}
+               {type :$unspecified_type_label}
+           }
+
+       }
+    }
+}
+
+if [prepare_for_testing "failed to prepare" $testfile \
+       "${asm_file} ${srcfile} ${srcfile2}" {}] {
+    return -1
+}
+
+if ![runto_main] {
+    return -1
+}
+
+# Print the function type.  Return type should be stub type, which is printed
+# as void.
+gdb_test "ptype foo" "type = void \\(void\\)"
+
+# Call the function, casting the function to the correct function type.
+gdb_test "p ((int (*) ()) foo) ()" " = 0"
+
+# Call the function, casting the function result to the correct type.
+gdb_test "p (int) foo ()" " = 0"

++++++ gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch ++++++
--- /var/tmp/diff_new_pack.KaZPLm/_old  2022-10-01 17:42:14.057569319 +0200
+++ /var/tmp/diff_new_pack.KaZPLm/_new  2022-10-01 17:42:14.057569319 +0200
@@ -1,13 +1,33 @@
 [gdb/tdep] Fix PowerPC IEEE 128-bit format arg passing
 
-https://sourceware.org/bugzilla/show_bug.cgi?id=29543#c5
+On a powerpc system with gcc 12 built to default to 128-bit IEEE long double,
+I run into:
+...
+(gdb) print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)^M
+$8 = 0 + 0i^M
+(gdb) FAIL: gdb.base/varargs.exp: print \
+  find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)
+...
+
+This is due to incorrect handling of the argument in ppc64_sysv_abi_push_param.
+
+Fix this and similar cases, and expand the test-case to test handling of
+homogeneous aggregates.
+
+Tested on ppc64le-linux, power 10.
+
+Co-Authored-By: Ulrich Weigand <uweig...@de.ibm.com>
+Tested-by: Carl Love <c...@us.ibm.com>
+Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29543
 
 ---
- gdb/ppc-sysv-tdep.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ gdb/ppc-sysv-tdep.c                | 25 +++++++++++++++++++------
+ gdb/testsuite/gdb.base/varargs.c   | 28 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/varargs.exp |  2 ++
+ 3 files changed, 49 insertions(+), 6 deletions(-)
 
 diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
-index b7106542b5d..2cdf4658e35 100644
+index b7106542b5d..5a8761d64e7 100644
 --- a/gdb/ppc-sysv-tdep.c
 +++ b/gdb/ppc-sysv-tdep.c
 @@ -1444,7 +1444,7 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
@@ -19,4 +39,112 @@
        ppc64_sysv_abi_push_vreg (gdbarch, val, argpos);
      }
    else if (type->code () == TYPE_CODE_FLT
+@@ -1514,7 +1514,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
+     }
+   else
+     {
+-      ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), 0, argpos);
++      /* Align == 0 is correct for ppc64_sysv_abi_push_freg,
++       Align == 16 is correct for ppc64_sysv_abi_push_vreg.
++       Default to 0.  */
++      int align = 0;
+ 
+       /* The ABI (version 1.9) specifies that structs containing a
+        single floating-point value, at any level of nesting of
+@@ -1532,7 +1535,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
+           if (TYPE_LENGTH (type) == 16
+               && (gdbarch_long_double_format (gdbarch)
+                   == floatformats_ia64_quad))
+-            ppc64_sysv_abi_push_vreg (gdbarch, val, argpos);
++            {
++              ppc64_sysv_abi_push_vreg (gdbarch, val, argpos);
++              align = 16;
++            }
+           else
+             ppc64_sysv_abi_push_freg (gdbarch, type, val, argpos);
+         }
+@@ -1556,8 +1562,10 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
+                   && (gdbarch_long_double_format (gdbarch)
+                       == floatformats_ia64_quad))
+                  /* IEEE FLOAT128, args in vector registers.  */
+-                 ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
+-
++                {
++                  ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
++                  align = 16;
++                }
+               else if (eltype->code () == TYPE_CODE_FLT
+                           || eltype->code () == TYPE_CODE_DECFLOAT)
+                   /* IBM long double and all other floats and decfloats, args
+@@ -1567,9 +1575,14 @@ ppc64_sysv_abi_push_param (struct gdbarch *gdbarch,
+                        && eltype->is_vector ()
+                        && tdep->vector_abi == POWERPC_VEC_ALTIVEC
+                        && TYPE_LENGTH (eltype) == 16)
+-                ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
++                {
++                  ppc64_sysv_abi_push_vreg (gdbarch, elval, argpos);
++                  align = 16;
++                }
+             }
+       }
++
++      ppc64_sysv_abi_push_val (gdbarch, val, TYPE_LENGTH (type), align, 
argpos);
+     }
+ }
+ 
+diff --git a/gdb/testsuite/gdb.base/varargs.c 
b/gdb/testsuite/gdb.base/varargs.c
+index cacb29d89e7..fcadcee6fb3 100644
+--- a/gdb/testsuite/gdb.base/varargs.c
++++ b/gdb/testsuite/gdb.base/varargs.c
+@@ -45,6 +45,16 @@ long double _Complex ldc2 = 2.0L + 2.0Li;
+ long double _Complex ldc3 = 3.0L + 3.0Li;
+ long double _Complex ldc4 = 4.0L + 4.0Li;
+ 
++struct sldc
++{
++  long double _Complex ldc;
++};
++
++struct sldc sldc1 = { 1.0L + 1.0Li };
++struct sldc sldc2 = { 2.0L + 2.0Li };
++struct sldc sldc3 = { 3.0L + 3.0Li };
++struct sldc sldc4 = { 4.0L + 4.0Li };
++
+ #endif
+ 
+ int
+@@ -201,4 +211,22 @@ find_max_long_double_real (int num_vals, ...)
+ }
+ 
+ 
++long double _Complex
++find_max_struct_long_double_real (int num_vals, ...)
++{
++  long double _Complex max = 0.0L + 0.0iL;
++  struct sldc x;
++  va_list argp;
++  int i;
++
++  va_start(argp, num_vals);
++  for (i = 0; i < num_vals; i++)
++    {
++      x = va_arg (argp, struct sldc);
++      if (creall (max) < creal (x.ldc)) max = x.ldc;
++    }
++
++  return max;
++}
++
+ #endif /* TEST_COMPLEX */
+diff --git a/gdb/testsuite/gdb.base/varargs.exp 
b/gdb/testsuite/gdb.base/varargs.exp
+index e778af031cf..f3d413e4de6 100644
+--- a/gdb/testsuite/gdb.base/varargs.exp
++++ b/gdb/testsuite/gdb.base/varargs.exp
+@@ -107,4 +107,6 @@ if [support_complex_tests] {
+     set test "print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)"
+     gdb_test $test ".*= 4 \\+ 4i"
+ 
++    set test "print find_max_struct_long_double_real(4, sldc1, sldc2, sldc3, 
sldc4)"
++    gdb_test $test ".*= 4 \\+ 4i"
+ }
 

++++++ gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch 
++++++
[gdb/testsuite] Fix gdb.dwarf2/dw2-unspecified-type-foo.c with -m32

When running test-case gdb.dwarf2/dw2-unspecified-type-foo.c with target board
unix/-m32, I run into:
...
(gdb) PASS: gdb.dwarf2/dw2-unspecified-type.exp: ptype foo
p ((int (*) ()) foo) ()^M
$1 = -135698472^M
...

Add the missing "return 0" in foo, which fixes this.

Tested on x86_64-linux.

---
 gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c 
b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
index b1e3a8b98e4..c92e18b898f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c
@@ -19,4 +19,5 @@ int
 foo (void)
 {
   asm ("foo_label: .globl foo_label");
+  return 0;
 }

++++++ gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch 
++++++
[gdb/testsuite] Fix gdb.mi/mi-sym-info.exp on openSUSE Tumbleweed

On openSUSE Tumbleweed, I run into:
...
FAIL: gdb.mi/mi-sym-info.exp: List all functions from debug information only
...

The problem is in matching this string:
...
{name="_start",type="void (void)",description="void _start(void);"}
...
using regexp fun_re, which requires a line field:
...
set fun_re \
    "\{line=\"$decimal\",name=${qstr},type=${qstr},description=${qstr}\}"
...

Fix this by making the line field optional in fun_re.

Tested on x86_64-linux.

---
 gdb/testsuite/gdb.mi/mi-sym-info.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.mi/mi-sym-info.exp 
b/gdb/testsuite/gdb.mi/mi-sym-info.exp
index 7b936061759..2f723ece882 100644
--- a/gdb/testsuite/gdb.mi/mi-sym-info.exp
+++ b/gdb/testsuite/gdb.mi/mi-sym-info.exp
@@ -38,7 +38,8 @@ mi_clean_restart $binfile
 mi_runto_main
 
 set qstr "\"\[^\"\]+\""
-set fun_re 
"\{line=\"$decimal\",name=${qstr},type=${qstr},description=${qstr}\}"
+set fun_re \
+    "\{(?:line=\"$decimal\",)?name=${qstr},type=${qstr},description=${qstr}\}"
 set type_re "\{(?:line=\"$decimal\",)*name=${qstr}\}"
 set sym_list "\\\[${fun_re}(?:,$fun_re)*\\\]"
 set type_sym_list "\\\[${type_re}(?:,$type_re)*\\\]"

++++++ gdb-testsuite-fix-have_mpx-test.patch ++++++
[gdb/testsuite] Fix have_mpx test

When testing on openSUSE Leap 15.4 I ran into this FAIL:
...
FAIL: gdb.arch/i386-mpx-map.exp: NULL address of the pointer
...
and likewise for all the other mpx tests.

The problem is that have_mpx is supposed to return 0, but it doesn't because
it tries to match this output:
...
builtin_spawn -ignore SIGHUP temp/20294/have_mpx-2-20294.x^M
No MPX support^M
No MPX support^M
...
using:
...
                   && ![string equal $output "No MPX support\r\n"]]
...

Fix this by matching using a regexp instead.

Tested on x86_64-linux.

---
 gdb/testsuite/lib/gdb.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3bfd59109bc..25c1572a53a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -8364,7 +8364,7 @@ gdb_caching_proc have_mpx {
     set status [lindex $result 0]
     set output [lindex $result 1]
     set status [expr ($status == 0) \
-                   && ![string equal $output "No MPX support\r\n"]]
+                   && ![regexp "^No MPX support\r\n" $output]]
 
     remote_file build delete $obj
 

++++++ qa-remote.sh ++++++
--- /var/tmp/diff_new_pack.KaZPLm/_old  2022-10-01 17:42:14.265569698 +0200
+++ /var/tmp/diff_new_pack.KaZPLm/_new  2022-10-01 17:42:14.269569706 +0200
@@ -54,14 +54,16 @@
        mkdir -p $dir
     fi
 
-    if [ ! -f $dir/gdb-testresults-12.1-*.$arch.rpm ]; then
+    rpm=$(echo $dir/gdb-testresults-12.1-*.*.rpm)
+    rpm=$(for f in $rpm; do echo $f; done | grep -v nosrc)
+    if [ ! -f $rpm ]; then
        osc getbinaries -q -M testsuite -d $dir $c $arch
     fi
 
     if [ ! -d $pkgs/gdb-testresults.$c.$arch ]; then
        (
            cd $dir
-           extract gdb-testresults-12.1-*.$arch.rpm
+           extract $rpm
        )
     fi
 

++++++ qa.sh ++++++
--- /var/tmp/diff_new_pack.KaZPLm/_old  2022-10-01 17:42:14.285569735 +0200
+++ /var/tmp/diff_new_pack.KaZPLm/_new  2022-10-01 17:42:14.289569742 +0200
@@ -241,6 +241,10 @@
 
     # https://sourceware.org/bugzilla/show_bug.cgi?id=25038
     "FAIL: gdb.reverse/test_ioctl_TCSETSW.exp: handle TCSETSW"
+
+    # https://sourceware.org/bugzilla/show_bug.cgi?id=26873
+    "FAIL: gdb.threads/watchthreads-threaded.exp: threaded watch loop \(GDB 
internal error\)"
+
 ) # kfail
 
 kfail_sle12=(
@@ -422,6 +426,8 @@
 
            # https://sourceware.org/bugzilla/show_bug.cgi?id=28667
            "record-full.c:[0-9]*: internal-error: ptid_t 
record_full_wait_1\(target_ops\*, ptid_t, target_waitstatus\*, 
target_wait_flags\): Assertion \`\(options & TARGET_WNOHANG\) != 0' failed."
+           # https://sourceware.org/bugzilla/show_bug.cgi?id=26873
+           "infrun.c:[0-9]*: internal-error: resume_1: Assertion 
\`!\(thread_has_single_step_breakpoints_set \(tp\) && step\)' failed."
        )
 
        kfail_re=$(join "|" "${kfail[@]}")

Reply via email to