Blame SOURCES/gdb-rhbz1976887-field-location-kind.patch

ed07ac
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
ed07ac
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
ed07ac
Date: Wed, 29 Sep 2021 10:58:50 +0200
ed07ac
Subject: gdb-rhbz1976887-field-location-kind.patch
ed07ac
ed07ac
;;Backport upstream patch which fixes internal-error: Unexpected
ed07ac
;;type field location kind (RHBZ 1976887).
ed07ac
ed07ac
gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK
ed07ac
ed07ac
The case for FIELD_LOC_KIND_DWARF_BLOCK was missing for
ed07ac
switch TYPE_FIELD_LOC_KIND. Thas caused an internal-error
ed07ac
under some circumstances.
ed07ac
ed07ac
Fixes bug 28030.
ed07ac
ed07ac
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
ed07ac
--- a/gdb/gdbtypes.c
ed07ac
+++ b/gdb/gdbtypes.c
ed07ac
@@ -5571,6 +5571,10 @@ copy_type_recursive (struct objfile *objfile,
ed07ac
 				  xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
ed07ac
 								       i)));
ed07ac
 	      break;
ed07ac
+            case FIELD_LOC_KIND_DWARF_BLOCK:
ed07ac
+              SET_FIELD_DWARF_BLOCK (new_type->field (i),
ed07ac
+                                     TYPE_FIELD_DWARF_BLOCK (type, i));
ed07ac
+              break;
ed07ac
 	    default:
ed07ac
 	      internal_error (__FILE__, __LINE__,
ed07ac
 			      _("Unexpected type field location kind: %d"),