@@ -218,6 +218,7 @@ DEFINE_PROCESS_UDATA_ATTRIBUTE(encoding)
218
218
}
219
219
220
220
DEFINE_MATCH (formal_parameter )
221
+ DEFINE_MATCH (subrange )
221
222
222
223
bool match_all (Dwarf_Die * die )
223
224
{
@@ -309,6 +310,34 @@ DEFINE_PROCESS_TYPE(shared)
309
310
DEFINE_PROCESS_TYPE (volatile )
310
311
DEFINE_PROCESS_TYPE (typedef )
311
312
313
+ static int process_subrange_type (struct state * state , struct die * cache ,
314
+ Dwarf_Die * die )
315
+ {
316
+ Dwarf_Word count = 0 ;
317
+
318
+ if (get_udata_attr (die , DW_AT_count , & count ))
319
+ return check (process_fmt (state , cache , "[%" PRIu64 "]" , count ));
320
+ if (get_udata_attr (die , DW_AT_upper_bound , & count ))
321
+ return check (
322
+ process_fmt (state , cache , "[%" PRIu64 "]" , count + 1 ));
323
+
324
+ return check (process (state , cache , "[]" ));
325
+ }
326
+
327
+ static int process_array_type (struct state * state , struct die * cache ,
328
+ Dwarf_Die * die )
329
+ {
330
+ check (process (state , cache , "array_type " ));
331
+ /* Array size */
332
+ check (process_die_container (state , cache , die , process_type ,
333
+ match_subrange_type ));
334
+ check (process (state , cache , " {" ));
335
+ check (process_linebreak (cache , 1 ));
336
+ check (process_type_attr (state , cache , die ));
337
+ check (process_linebreak (cache , -1 ));
338
+ return check (process (state , cache , "}" ));
339
+ }
340
+
312
341
static int __process_subroutine_type (struct state * state , struct die * cache ,
313
342
Dwarf_Die * die , const char * type )
314
343
{
@@ -411,7 +440,9 @@ static int process_type(struct state *state, struct die *parent, Dwarf_Die *die)
411
440
PROCESS_TYPE (volatile )
412
441
/* Subtypes */
413
442
PROCESS_TYPE (formal_parameter )
443
+ PROCESS_TYPE (subrange )
414
444
/* Other types */
445
+ PROCESS_TYPE (array )
415
446
PROCESS_TYPE (base )
416
447
PROCESS_TYPE (subroutine )
417
448
PROCESS_TYPE (typedef )
0 commit comments