@@ -914,62 +914,61 @@ public void writeContent(DebugContext context) {
914914
915915 public int writeAbbrevs (DebugContext context , byte [] buffer , int p ) {
916916 int pos = p ;
917- // Write Abbrevs that are shared for AOT and Runtime compilation
917+ /*
918+ * Write all abbrevs for AOT and run-time debug info Abbrevs use the least space of all
919+ * debug info sections, so there is no real benefit in reducing the amount of abbrevs for
920+ * run-time debug info
921+ */
922+
923+ // Top level DIEs
918924 pos = writeCompileUnitAbbrevs (context , buffer , pos );
919925 pos = writeTypeUnitAbbrev (context , buffer , pos );
926+
927+ // Level 1 DIEs
928+ pos = writePrimitiveTypeAbbrev (context , buffer , pos );
929+ pos = writeVoidTypeAbbrev (context , buffer , pos );
930+ pos = writeObjectHeaderAbbrev (context , buffer , pos );
931+ pos = writeClassConstantAbbrev (context , buffer , pos );
920932 pos = writeNamespaceAbbrev (context , buffer , pos );
921933 pos = writeClassLayoutAbbrevs (context , buffer , pos );
922- pos = writeDummyClassLayoutAbbrev (context , buffer , pos );
923- pos = writeClassReferenceAbbrevs (context , buffer , pos );
924- pos = writeMethodDeclarationAbbrevs (context , buffer , pos );
934+ pos = writePointerTypeAbbrevs (context , buffer , pos );
935+ pos = writeForeignTypedefAbbrev (context , buffer , pos );
936+ pos = writeForeignStructAbbrev (context , buffer , pos );
925937 pos = writeMethodLocationAbbrev (context , buffer , pos );
926- pos = writeAbstractInlineMethodAbbrev (context , buffer , pos );
927- pos = writeInlinedSubroutineAbbrev (buffer , pos );
938+ pos = writeStaticFieldLocationAbbrev (context , buffer , pos );
939+ pos = writeArrayLayoutAbbrev (context , buffer , pos );
940+ pos = writeInterfaceLayoutAbbrev (context , buffer , pos );
941+ /*
942+ * if we address rebasing is required then we need to use compressed layout types supplied
943+ * with a suitable data_location attribute and compressed pointer types to ensure that gdb
944+ * converts offsets embedded in static or instance fields to raw pointers. Transformed
945+ * addresses are typed using pointers to the underlying layout.
946+ *
947+ * if address rebasing is not required then a data_location attribute on the layout type
948+ * will ensure that address tag bits are removed.
949+ *
950+ * The compressed layout is also used for representing the decode step for dynamic hubs.
951+ * I.e. this is also required for builds without isolates
952+ */
953+ pos = writeCompressedLayoutAbbrev (context , buffer , pos );
928954
955+ /* Level 2 DIEs */
956+ pos = writeMethodDeclarationAbbrevs (context , buffer , pos );
957+ pos = writeFieldDeclarationAbbrevs (context , buffer , pos );
958+ pos = writeFieldAbbrevs (context , buffer , pos );
959+ pos = writeArrayDataTypeAbbrevs (context , buffer , pos );
960+ pos = writeArraySubrangeTypeAbbrev (context , buffer , pos );
961+ pos = writeSuperReferenceAbbrev (context , buffer , pos );
962+ pos = writeInterfaceImplementorAbbrev (context , buffer , pos );
963+
964+ /* Level 2+ DIEs (used within functions and inlined functions) */
965+ pos = writeInlinedSubroutineAbbrev (buffer , pos );
966+ pos = writeAbstractInlineMethodAbbrev (context , buffer , pos );
929967 pos = writeParameterDeclarationAbbrevs (context , buffer , pos );
930968 pos = writeLocalDeclarationAbbrevs (context , buffer , pos );
931969 pos = writeParameterLocationAbbrevs (context , buffer , pos );
932970 pos = writeLocalLocationAbbrevs (context , buffer , pos );
933971
934- // Write Abbrevs that are only used for AOT debuginfo generation
935- if (!dwarfSections .isRuntimeCompilation () || true ) {
936-
937- pos = writePrimitiveTypeAbbrev (context , buffer , pos );
938- pos = writeVoidTypeAbbrev (context , buffer , pos );
939- pos = writeObjectHeaderAbbrev (context , buffer , pos );
940-
941- pos = writeFieldDeclarationAbbrevs (context , buffer , pos );
942- pos = writeClassConstantAbbrev (context , buffer , pos );
943-
944- pos = writeArrayLayoutAbbrev (context , buffer , pos );
945-
946- pos = writeInterfaceLayoutAbbrev (context , buffer , pos );
947-
948- pos = writeForeignTypedefAbbrev (context , buffer , pos );
949- pos = writeForeignStructAbbrev (context , buffer , pos );
950-
951- pos = writeFieldAbbrevs (context , buffer , pos );
952- pos = writeArrayDataTypeAbbrevs (context , buffer , pos );
953- pos = writeArraySubrangeTypeAbbrev (context , buffer , pos );
954- pos = writeStaticFieldLocationAbbrev (context , buffer , pos );
955- pos = writeSuperReferenceAbbrev (context , buffer , pos );
956- pos = writeInterfaceImplementorAbbrev (context , buffer , pos );
957-
958- /*
959- * if we address rebasing is required then we need to use compressed layout types
960- * supplied with a suitable data_location attribute and compressed pointer types to
961- * ensure that gdb converts offsets embedded in static or instance fields to raw
962- * pointers. Transformed addresses are typed using pointers to the underlying layout.
963- *
964- * if address rebasing is not required then a data_location attribute on the layout type
965- * will ensure that address tag bits are removed.
966- *
967- * The compressed layout is also used for representing the decode step for dynamic hubs.
968- * I.e. this is also required for builds without isolates
969- */
970- pos = writeCompressedLayoutAbbrev (context , buffer , pos );
971- }
972-
973972 /* write a null abbrev to terminate the sequence */
974973 pos = writeNullAbbrev (context , buffer , pos );
975974 return pos ;
@@ -989,11 +988,9 @@ private int writeHasChildren(DwarfHasChildren hasChildren, byte[] buffer, int po
989988
990989 private int writeCompileUnitAbbrevs (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
991990 int pos = p ;
992- if (!dwarfSections .isRuntimeCompilation () || true ) {
993- pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_CONSTANT_UNIT , buffer , pos );
994- pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_UNIT_1 , buffer , pos );
995- pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_UNIT_2 , buffer , pos );
996- }
991+ pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_CONSTANT_UNIT , buffer , pos );
992+ pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_UNIT_1 , buffer , pos );
993+ pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_UNIT_2 , buffer , pos );
997994 pos = writeCompileUnitAbbrev (context , AbbrevCode .CLASS_UNIT_3 , buffer , pos );
998995 return pos ;
999996 }
@@ -1121,6 +1118,7 @@ private int writeClassLayoutAbbrevs(@SuppressWarnings("unused") DebugContext con
11211118 pos = writeClassLayoutAbbrev (context , AbbrevCode .CLASS_LAYOUT_TU , buffer , pos );
11221119 pos = writeClassLayoutAbbrev (context , AbbrevCode .CLASS_LAYOUT_CU , buffer , pos );
11231120 pos = writeClassLayoutAbbrev (context , AbbrevCode .CLASS_LAYOUT_ARRAY , buffer , pos );
1121+ pos = writeOpaqueClassLayoutAbbrev (context , buffer , pos );
11241122 return pos ;
11251123 }
11261124
@@ -1159,10 +1157,10 @@ private int writeClassLayoutAbbrev(@SuppressWarnings("unused") DebugContext cont
11591157 return pos ;
11601158 }
11611159
1162- private int writeDummyClassLayoutAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
1160+ private int writeOpaqueClassLayoutAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
11631161 int pos = p ;
11641162
1165- pos = writeAbbrevCode (AbbrevCode .CLASS_LAYOUT_DUMMY , buffer , pos );
1163+ pos = writeAbbrevCode (AbbrevCode .CLASS_LAYOUT_OPAQUE , buffer , pos );
11661164 pos = writeTag (DwarfTag .DW_TAG_structure_type , buffer , pos );
11671165 pos = writeHasChildren (DwarfHasChildren .DW_CHILDREN_no , buffer , pos );
11681166 pos = writeAttrType (DwarfAttribute .DW_AT_name , buffer , pos );
@@ -1180,14 +1178,14 @@ private int writeDummyClassLayoutAbbrev(@SuppressWarnings("unused") DebugContext
11801178 return pos ;
11811179 }
11821180
1183- private int writeClassReferenceAbbrevs (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
1181+ private int writePointerTypeAbbrevs (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
11841182 int pos = p ;
1185- pos = writeClassReferenceAbbrev (context , AbbrevCode .TYPE_POINTER_SIG , buffer , pos );
1186- pos = writeClassReferenceAbbrev (context , AbbrevCode .TYPE_POINTER , buffer , pos );
1183+ pos = writePointerTypeAbbrev (context , AbbrevCode .TYPE_POINTER_SIG , buffer , pos );
1184+ pos = writePointerTypeAbbrev (context , AbbrevCode .TYPE_POINTER , buffer , pos );
11871185 return pos ;
11881186 }
11891187
1190- private int writeClassReferenceAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , AbbrevCode abbrevCode , byte [] buffer , int p ) {
1188+ private int writePointerTypeAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , AbbrevCode abbrevCode , byte [] buffer , int p ) {
11911189 int pos = p ;
11921190
11931191 /* A pointer to the class struct type. */
@@ -1213,9 +1211,7 @@ private int writeMethodDeclarationAbbrevs(@SuppressWarnings("unused") DebugConte
12131211 pos = writeMethodDeclarationAbbrev (context , AbbrevCode .METHOD_DECLARATION_INLINE , buffer , pos );
12141212 pos = writeMethodDeclarationAbbrev (context , AbbrevCode .METHOD_DECLARATION_STATIC , buffer , pos );
12151213 pos = writeMethodDeclarationAbbrev (context , AbbrevCode .METHOD_DECLARATION_INLINE_STATIC , buffer , pos );
1216- if (!dwarfSections .isRuntimeCompilation () || true ) {
1217- pos = writeMethodDeclarationAbbrev (context , AbbrevCode .METHOD_DECLARATION_SKELETON , buffer , pos );
1218- }
1214+ pos = writeMethodDeclarationAbbrev (context , AbbrevCode .METHOD_DECLARATION_SKELETON , buffer , pos );
12191215 return pos ;
12201216 }
12211217
@@ -1277,8 +1273,6 @@ private int writeFieldDeclarationAbbrevs(DebugContext context, byte[] buffer, in
12771273 pos = writeFieldDeclarationAbbrev (context , AbbrevCode .FIELD_DECLARATION_3 , buffer , pos );
12781274 /* A static field with line and file. */
12791275 pos = writeFieldDeclarationAbbrev (context , AbbrevCode .FIELD_DECLARATION_4 , buffer , pos );
1280-
1281- pos = writeFieldDeclarationRelTypeAbbrev (context , buffer , pos );
12821276 return pos ;
12831277 }
12841278
@@ -1321,28 +1315,6 @@ private int writeFieldDeclarationAbbrev(@SuppressWarnings("unused") DebugContext
13211315 return pos ;
13221316 }
13231317
1324- private int writeFieldDeclarationRelTypeAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
1325- int pos = p ;
1326- pos = writeAbbrevCode (AbbrevCode .FIELD_DECLARATION_REL_TYPE , buffer , pos );
1327- pos = writeTag (DwarfTag .DW_TAG_member , buffer , pos );
1328- pos = writeHasChildren (DwarfHasChildren .DW_CHILDREN_no , buffer , pos );
1329- pos = writeAttrType (DwarfAttribute .DW_AT_name , buffer , pos );
1330- pos = writeAttrForm (DwarfForm .DW_FORM_strp , buffer , pos );
1331- pos = writeAttrType (DwarfAttribute .DW_AT_type , buffer , pos );
1332- pos = writeAttrForm (DwarfForm .DW_FORM_ref4 , buffer , pos );
1333- /* Instance fields have a member offset relocated relative to the heap base register. */
1334- pos = writeAttrType (DwarfAttribute .DW_AT_data_member_location , buffer , pos );
1335- pos = writeAttrForm (DwarfForm .DW_FORM_data2 , buffer , pos );
1336- pos = writeAttrType (DwarfAttribute .DW_AT_accessibility , buffer , pos );
1337- pos = writeAttrForm (DwarfForm .DW_FORM_data1 , buffer , pos );
1338- /*
1339- * Now terminate.
1340- */
1341- pos = writeAttrType (DwarfAttribute .DW_AT_null , buffer , pos );
1342- pos = writeAttrForm (DwarfForm .DW_FORM_null , buffer , pos );
1343- return pos ;
1344- }
1345-
13461318 private int writeClassConstantAbbrev (@ SuppressWarnings ("unused" ) DebugContext context , byte [] buffer , int p ) {
13471319 int pos = p ;
13481320 pos = writeAbbrevCode (AbbrevCode .CLASS_CONSTANT , buffer , pos );
0 commit comments