Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gdb for openSUSE:Factory checked in 
at 2021-12-12 00:56:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gdb (Old)
 and      /work/SRC/openSUSE:Factory/.gdb.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gdb"

Sun Dec 12 00:56:06 2021 rev:158 rq:936257 version:11.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/gdb/gdb.changes  2021-12-02 02:12:31.279162780 
+0100
+++ /work/SRC/openSUSE:Factory/.gdb.new.2520/gdb.changes        2021-12-12 
00:56:52.166553886 +0100
@@ -1,0 +2,6 @@
+Mon Dec  6 17:19:44 UTC 2021 - Tom de Vries <tdevr...@suse.com>
+
+- Patches added (swo#28323):
+  gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch
+
+-------------------------------------------------------------------

New:
----
  gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch

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

Other differences:
------------------
++++++ gdb.spec ++++++
--- /var/tmp/diff_new_pack.5y3U0N/_old  2021-12-12 00:56:53.894555072 +0100
+++ /var/tmp/diff_new_pack.5y3U0N/_new  2021-12-12 00:56:53.898555075 +0100
@@ -389,6 +389,8 @@
 Patch2119:      gdb-testsuite-fix-gdb.arch-i386-pkru.exp-on-linux.patch
 # https://sourceware.org/pipermail/gdb-patches/2021-November/183960.html
 Patch2120:      gdb-tdep-fix-avx512-m32-support-in-gdbserver.patch
+# https://sourceware.org/pipermail/gdb-patches/2021-December/184241.html
+Patch2121:      
gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch
 
 BuildRequires:  bison
 BuildRequires:  flex
@@ -815,6 +817,7 @@
 %patch2118 -p1
 %patch2119 -p1
 %patch2120 -p1
+%patch2121 -p1
 
 #unpack libipt
 %if 0%{have_libipt}

++++++ gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch ++++++
[gdb/ada] Fix assert in ada_is_unconstrained_packed_array_type

On openSUSE Leap 42.3, with system compiler gcc 4.8.5 I run into:
...
(gdb) print u_one_two_three^M
src/gdb/gdbtypes.h:1050: internal-error: field: \
 Assertion `idx >= 0 && idx < num_fields ()' failed.^M
...

We run into trouble while doing this in
ada_is_unconstrained_packed_array_type:
...
1953          return TYPE_FIELD_BITSIZE (type, 0) > 0;
...
which tries to get field 0 from a type without fields:
...
(gdb) p type->num_fields ()
$6 = 0
...
which is the case because the type is a typedef:
...
(gdb) p type->code ()
$7 = TYPE_CODE_TYPEDEF
...

Fix this by using the type referenced by the typedef instead.

Tested on x86_64-linux.

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

---
 gdb/ada-lang.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index b098991612d..9341c7b3677 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1927,6 +1927,8 @@ ada_is_unconstrained_packed_array_type (struct type *type)
       /* The structure's first field is a pointer to an array, so this
         fetches the array type.  */
       type = TYPE_TARGET_TYPE (type->field (0).type ());
+      if (type->code () == TYPE_CODE_TYPEDEF)
+       type = ada_typedef_target_type (type);
       /* Now we can see if the array elements are packed.  */
       return TYPE_FIELD_BITSIZE (type, 0) > 0;
     }

Reply via email to