[1/2] gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK

Message ID 20210831203447.763323-1-ahajkova@redhat.com
State New
Headers show
Series
  • [1/2] gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK
Related show

Commit Message

Lancelot SIX via Gdb-patches Aug. 31, 2021, 8:34 p.m.
From: Alexandra Hájková <ahajkova@redhat.com>


The case for FIELD_LOC_KIND_DWARF_BLOCK was missing for
switch TYPE_FIELD_LOC_KIND. Thas caused an internal-error
under some circumstances.

Fixes bug 28030.
---
 gdb/gdbtypes.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.26.3

Comments

Lancelot SIX via Gdb-patches Sept. 1, 2021, 12:59 p.m. | #1
On 2021-08-31 4:34 p.m., Alexandra Hájková via Gdb-patches wrote:
> From: Alexandra Hájková <ahajkova@redhat.com>

> 

> The case for FIELD_LOC_KIND_DWARF_BLOCK was missing for

> switch TYPE_FIELD_LOC_KIND. Thas caused an internal-error

> under some circumstances.

> 

> Fixes bug 28030.


Hi,

Please add the git trailer:

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

LGTM with that added.

Simon

Patch

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 74ad5d6f7fe..8fbc5d3a80b 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5579,6 +5579,10 @@  copy_type_recursive (struct objfile *objfile,
 				  xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
 								       i)));
 	      break;
+            case FIELD_LOC_KIND_DWARF_BLOCK:
+              SET_FIELD_DWARF_BLOCK (new_type->field (i),
+                                     TYPE_FIELD_DWARF_BLOCK (type, i));
+              break;
 	    default:
 	      internal_error (__FILE__, __LINE__,
 			      _("Unexpected type field location kind: %d"),