Skip to content

Commit 73365e3

Browse files
committed
Use correct name for record types
The gdb test case packed_record.exp has this code: type Response (Length : integer ) is record ... Var : Response(11) := (11, 23, 13, Hello, "abcdefghijk"); I noticed that the resulting DWARF used this for the type of 'var': <1><71>: Abbrev Number: 8 (DW_TAG_structure_type) <72> DW_AT_name : (indirect string, offset: 0xb4): pr__TvarS The name here looks wrong, it should be 'response'. This patch fixes the problem.
1 parent 2e86b9c commit 73365e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm-interface/gnatllvm-debuginfo.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,13 +1142,15 @@ package body GNATLLVM.DebugInfo is
11421142
-- update the members of the type.
11431143
if Is_Unchecked_Union (TE) then
11441144
Result := DI_Create_Union_Type
1145-
(Get_Scope_For (TE), Get_Possibly_Local_Name (TE),
1145+
(Get_Scope_For (Original_Type),
1146+
Get_Possibly_Local_Name (Original_Type),
11461147
Get_Debug_File_Node (Get_Source_File_Index (S)),
11471148
Get_Physical_Line_Number (S), Size, Align, DI_Flag_Zero,
11481149
Empty_Fields, 0, "");
11491150
else
11501151
Result := DI_Create_Struct_Type
1151-
(Get_Scope_For (TE), Get_Possibly_Local_Name (TE),
1152+
(Get_Scope_For (Original_Type),
1153+
Get_Possibly_Local_Name (Original_Type),
11521154
Get_Debug_File_Node (Get_Source_File_Index (S)),
11531155
Get_Physical_Line_Number (S), Size, Align, DI_Flag_Zero,
11541156
No_Metadata_T, Empty_Fields, 0, No_Metadata_T, "");

0 commit comments

Comments
 (0)