1 /* Copyright (c) 2008-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
15 #include <elfutils/libdw.h>
19 #include "mc/Frame.hpp"
20 #include "mc/ObjectInformation.hpp"
21 #include "mc/Variable.hpp"
23 #include "mc/mc_dwarf.hpp"
24 #include "mc/mc_libdw.hpp"
26 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_libdw, mc, "DWARF processing");
28 /** \brief Get the name of the tag of a given DIE
31 * \return name of the tag of this DIE
33 static inline const char *MC_dwarf_die_tagname(Dwarf_Die * die)
35 return MC_dwarf_tagname(dwarf_tag(die));
39 simgrid::mc::DwarfExpression MC_dwarf_expression(Dwarf_Op* ops, std::size_t len)
41 simgrid::mc::DwarfExpression expression(len);
42 for (std::size_t i = 0; i != len; ++i) {
43 expression[i].atom = ops[i].atom;
44 expression[i].number = ops[i].number;
45 expression[i].number2 = ops[i].number2;
46 expression[i].offset = ops[i].offset;
48 return std::move(expression);
51 static void mc_dwarf_location_list_init_libdw(
52 simgrid::mc::LocationList* list, simgrid::mc::ObjectInformation* info,
53 Dwarf_Die * die, Dwarf_Attribute * attr)
58 Dwarf_Addr base, start, end;
64 offset = dwarf_getlocations(attr, offset, &base, &start, &end, &ops, &len);
67 else if (offset == -1)
68 xbt_die("Error while loading location list");
70 simgrid::mc::LocationListEntry entry;
71 entry.expression = MC_dwarf_expression(ops, len);
73 void *base = info->base_address();
74 // If start == 0, this is not a location list:
75 entry.lowpc = start == 0 ? NULL : (char *) base + start;
76 entry.highpc = start == 0 ? NULL : (char *) base + end;
78 list->push_back(std::move(entry));
85 /** \brief Get an attribute of a given DIE as a string
88 * \param attribute attribute
89 * \return value of the given attribute of the given DIE
91 static const char *MC_dwarf_attr_integrate_string(Dwarf_Die * die,
95 if (!dwarf_attr_integrate(die, attribute, &attr)) {
98 return dwarf_formstring(&attr);
102 /** \brief Get the linkage name of a DIE.
104 * Use either DW_AT_linkage_name or DW_AT_MIPS_linkage_name.
105 * DW_AT_linkage_name is standardized since DWARF 4.
106 * Before this version of DWARF, the MIPS extensions
107 * DW_AT_MIPS_linkage_name is used (at least by GCC).
110 * \return linkage name of the given DIE (or NULL)
112 static const char *MC_dwarf_at_linkage_name(Dwarf_Die * die)
114 const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_linkage_name);
116 name = MC_dwarf_attr_integrate_string(die, DW_AT_MIPS_linkage_name);
120 static Dwarf_Off MC_dwarf_attr_dieoffset(Dwarf_Die * die, int attribute)
122 Dwarf_Attribute attr;
123 if (dwarf_hasattr_integrate(die, attribute) == 0)
125 dwarf_attr_integrate(die, attribute, &attr);
126 Dwarf_Die subtype_die;
127 if (dwarf_formref_die(&attr, &subtype_die) == NULL)
128 xbt_die("Could not find DIE");
129 return dwarf_dieoffset(&subtype_die);
132 static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die * die,
135 Dwarf_Attribute attr;
136 if (dwarf_hasattr_integrate(die, attribute) == 0)
138 dwarf_attr_integrate(die, DW_AT_type, &attr);
139 Dwarf_Die subtype_die;
140 if (dwarf_formref_die(&attr, &subtype_die) == NULL)
141 xbt_die("Could not find DIE");
142 return dwarf_dieoffset(&subtype_die);
145 /** \brief Find the type/subtype (DW_AT_type) for a DIE
148 * \return DW_AT_type reference as a global offset in hexadecimal (or NULL)
151 std::uint64_t MC_dwarf_at_type(Dwarf_Die * die)
153 return MC_dwarf_attr_integrate_dieoffset(die, DW_AT_type);
156 static std::uint64_t MC_dwarf_attr_integrate_addr(Dwarf_Die * die, int attribute)
158 Dwarf_Attribute attr;
159 if (dwarf_attr_integrate(die, attribute, &attr) == NULL)
162 if (dwarf_formaddr(&attr, &value) == 0)
163 return (std::uint64_t) value;
168 static std::uint64_t MC_dwarf_attr_integrate_uint(Dwarf_Die * die, int attribute,
169 std::uint64_t default_value)
171 Dwarf_Attribute attr;
172 if (dwarf_attr_integrate(die, attribute, &attr) == NULL)
173 return default_value;
175 return dwarf_formudata(dwarf_attr_integrate(die, attribute, &attr),
176 &value) == 0 ? (std::uint64_t) value : default_value;
179 static bool MC_dwarf_attr_flag(Dwarf_Die * die, int attribute, bool integrate)
181 Dwarf_Attribute attr;
182 if ((integrate ? dwarf_attr_integrate(die, attribute, &attr)
183 : dwarf_attr(die, attribute, &attr)) == 0)
187 if (dwarf_formflag(&attr, &result))
188 xbt_die("Unexpected form for attribute %s", MC_dwarf_attrname(attribute));
192 /** \brief Finds the number of elements in a DW_TAG_subrange_type or DW_TAG_enumeration_type DIE
195 * \param unit DIE of the compilation unit
196 * \return number of elements in the range
198 static std::uint64_t MC_dwarf_subrange_element_count(Dwarf_Die * die,
201 xbt_assert(dwarf_tag(die) == DW_TAG_enumeration_type
202 || dwarf_tag(die) == DW_TAG_subrange_type,
203 "MC_dwarf_subrange_element_count called with DIE of type %s",
204 MC_dwarf_die_tagname(die));
206 // Use DW_TAG_count if present:
207 if (dwarf_hasattr_integrate(die, DW_AT_count))
208 return MC_dwarf_attr_integrate_uint(die, DW_AT_count, 0);
209 // Otherwise compute DW_TAG_upper_bound-DW_TAG_lower_bound + 1:
211 if (!dwarf_hasattr_integrate(die, DW_AT_upper_bound))
212 // This is not really 0, but the code expects this (we do not know):
215 std::uint64_t upper_bound =
216 MC_dwarf_attr_integrate_uint(die, DW_AT_upper_bound, -1);
218 std::uint64_t lower_bound = 0;
219 if (dwarf_hasattr_integrate(die, DW_AT_lower_bound))
220 lower_bound = MC_dwarf_attr_integrate_uint(die, DW_AT_lower_bound, -1);
222 lower_bound = MC_dwarf_default_lower_bound(dwarf_srclang(unit));
223 return upper_bound - lower_bound + 1;
226 /** \brief Finds the number of elements in a array type (DW_TAG_array_type)
228 * The compilation unit might be needed because the default lower
229 * bound depends on the language of the compilation unit.
231 * \param die the DIE of the DW_TAG_array_type
232 * \param unit the DIE of the compilation unit
233 * \return number of elements in this array type
236 std::uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit)
238 xbt_assert(dwarf_tag(die) == DW_TAG_array_type,
239 "MC_dwarf_array_element_count called with DIE of type %s",
240 MC_dwarf_die_tagname(die));
245 for (res = dwarf_child(die, &child); res == 0;
246 res = dwarf_siblingof(&child, &child)) {
247 int child_tag = dwarf_tag(&child);
248 if (child_tag == DW_TAG_subrange_type
249 || child_tag == DW_TAG_enumeration_type)
250 result *= MC_dwarf_subrange_element_count(&child, unit);
255 // ***** simgrid::mc::Type*
257 /** \brief Initialize the location of a member of a type
258 * (DW_AT_data_member_location of a DW_TAG_member).
260 * \param type a type (struct, class)
261 * \param member the member of the type
262 * \param child DIE of the member (DW_TAG_member)
264 static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::Type* member,
267 if (dwarf_hasattr(child, DW_AT_data_bit_offset))
268 xbt_die("Can't groke DW_AT_data_bit_offset.");
270 if (!dwarf_hasattr_integrate(child, DW_AT_data_member_location)) {
271 if (type->type == DW_TAG_union_type)
274 ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%"
275 PRIx64 ">%s", member->name.c_str(),
276 (std::uint64_t) type->id, type->name.c_str());
279 Dwarf_Attribute attr;
280 dwarf_attr_integrate(child, DW_AT_data_member_location, &attr);
281 int form = dwarf_whatform(&attr);
282 int klass = MC_dwarf_form_get_class(form);
284 case MC_DW_CLASS_EXPRLOC:
285 case MC_DW_CLASS_BLOCK:
286 // Location expression:
290 if (dwarf_getlocation(&attr, &expr, &len))
292 ("Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%"
293 PRIx64 ">%s", MC_dwarf_attr_integrate_string(child, DW_AT_name),
294 (std::uint64_t) type->id, type->name.c_str());
295 member->location_expression = MC_dwarf_expression(expr, len);
298 case MC_DW_CLASS_CONSTANT:
299 // Offset from the base address of the object:
302 if (!dwarf_formudata(&attr, &offset))
303 member->offset(offset);
305 xbt_die("Cannot get %s location <%" PRIx64 ">%s",
306 MC_dwarf_attr_integrate_string(child, DW_AT_name),
307 (std::uint64_t) type->id, type->name.c_str());
310 case MC_DW_CLASS_LOCLISTPTR:
311 // Reference to a location list:
313 case MC_DW_CLASS_REFERENCE:
314 // It's supposed to be possible in DWARF2 but I couldn't find its semantic
317 xbt_die("Can't handle form class (%i) / form 0x%x as DW_AT_member_location",
323 /** \brief Populate the list of members of a type
325 * \param info ELF object containing the type DIE
326 * \param die DIE of the type
327 * \param unit DIE of the compilation unit containing the type DIE
328 * \param type the type
330 static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
331 Dwarf_Die * unit, simgrid::mc::Type* type)
335 xbt_assert(type->members.empty());
336 for (res = dwarf_child(die, &child); res == 0;
337 res = dwarf_siblingof(&child, &child)) {
338 int tag = dwarf_tag(&child);
339 if (tag == DW_TAG_member || tag == DW_TAG_inheritance) {
341 // Skip declarations:
342 if (MC_dwarf_attr_flag(&child, DW_AT_declaration, false))
345 // Skip compile time constants:
346 if (dwarf_hasattr(&child, DW_AT_const_value))
349 // TODO, we should use another type (because is is not a type but a member)
350 simgrid::mc::Type member;
354 member.id = dwarf_dieoffset(&child);
356 const char *name = MC_dwarf_attr_integrate_string(&child, DW_AT_name);
360 MC_dwarf_attr_integrate_uint(&child, DW_AT_byte_size, 0);
361 member.element_count = -1;
362 member.type_id = MC_dwarf_at_type(&child);
364 if (dwarf_hasattr(&child, DW_AT_data_bit_offset))
365 xbt_die("Can't groke DW_AT_data_bit_offset.");
367 MC_dwarf_fill_member_location(type, &member, &child);
370 xbt_die("Missing type for member %s of <%" PRIx64 ">%s",
372 (std::uint64_t) type->id, type->name.c_str());
374 type->members.push_back(std::move(member));
379 /** \brief Create a MC type object from a DIE
381 * \param info current object info object
382 * \param DIE (for a given type);
383 * \param unit compilation unit of the current DIE
384 * \return MC representation of the type
386 static simgrid::mc::Type MC_dwarf_die_to_type(
387 simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
388 Dwarf_Die * unit, simgrid::mc::Frame* frame,
391 simgrid::mc::Type type;
392 type.type = dwarf_tag(die);
393 type.name = std::string();
394 type.element_count = -1;
397 type.id = dwarf_dieoffset(die);
399 const char *prefix = "";
401 case DW_TAG_structure_type:
404 case DW_TAG_union_type:
407 case DW_TAG_class_type:
414 const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
416 char* full_name = ns ? bprintf("%s%s::%s", prefix, ns, name) :
417 bprintf("%s%s", prefix, name);
418 type.name = std::string(full_name);
422 type.type_id = MC_dwarf_at_type(die);
424 // Some compilers do not emit DW_AT_byte_size for pointer_type,
425 // so we fill this. We currently assume that the model-checked process is in
426 // the same architecture..
427 if (type.type == DW_TAG_pointer_type)
428 type.byte_size = sizeof(void*);
430 // Computation of the byte_size;
431 if (dwarf_hasattr_integrate(die, DW_AT_byte_size))
432 type.byte_size = MC_dwarf_attr_integrate_uint(die, DW_AT_byte_size, 0);
433 else if (type.type == DW_TAG_array_type
434 || type.type == DW_TAG_structure_type
435 || type.type == DW_TAG_class_type) {
437 if (dwarf_aggregate_size(die, &size) == 0)
438 type.byte_size = size;
442 case DW_TAG_array_type:
443 type.element_count = MC_dwarf_array_element_count(die, unit);
444 // TODO, handle DW_byte_stride and (not) DW_bit_stride
447 case DW_TAG_pointer_type:
448 case DW_TAG_reference_type:
449 case DW_TAG_rvalue_reference_type:
450 type.is_pointer_type = 1;
453 case DW_TAG_structure_type:
454 case DW_TAG_union_type:
455 case DW_TAG_class_type:
456 MC_dwarf_add_members(info, die, unit, &type);
457 char *new_ns = ns == NULL ? xbt_strdup(type.name.c_str())
458 : bprintf("%s::%s", ns, name);
459 MC_dwarf_handle_children(info, die, unit, frame, new_ns);
464 return std::move(type);
467 static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
468 Dwarf_Die * unit, simgrid::mc::Frame* frame,
471 simgrid::mc::Type type = MC_dwarf_die_to_type(info, die, unit, frame, ns);
472 auto& t = (info->types[type.id] = std::move(type));
473 if (!t.name.empty() && type.byte_size != 0)
474 info->full_types_by_name[t.name] = &t;
477 static int mc_anonymous_variable_index = 0;
479 static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
480 simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
481 Dwarf_Die * unit, simgrid::mc::Frame* frame,
484 // Skip declarations:
485 if (MC_dwarf_attr_flag(die, DW_AT_declaration, false))
488 // Skip compile time constants:
489 if (dwarf_hasattr(die, DW_AT_const_value))
492 Dwarf_Attribute attr_location;
493 if (dwarf_attr(die, DW_AT_location, &attr_location) == NULL)
494 // No location: do not add it ?
497 std::unique_ptr<simgrid::mc::Variable> variable =
498 std::unique_ptr<simgrid::mc::Variable>(new simgrid::mc::Variable());
499 variable->dwarf_offset = dwarf_dieoffset(die);
500 variable->global = frame == NULL; // Can be override base on DW_AT_location
501 variable->object_info = info;
503 const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
505 variable->name = name;
506 variable->type_id = MC_dwarf_at_type(die);
508 int form = dwarf_whatform(&attr_location);
511 DW_FORM_sec_offset ? MC_DW_CLASS_CONSTANT : MC_dwarf_form_get_class(form);
513 case MC_DW_CLASS_EXPRLOC:
514 case MC_DW_CLASS_BLOCK:
515 // Location expression:
519 if (dwarf_getlocation(&attr_location, &expr, &len)) {
521 "Could not read location expression in DW_AT_location "
522 "of variable <%" PRIx64 ">%s",
523 (std::uint64_t) variable->dwarf_offset,
524 variable->name.c_str());
527 if (len == 1 && expr[0].atom == DW_OP_addr) {
528 variable->global = 1;
529 uintptr_t offset = (uintptr_t) expr[0].number;
530 uintptr_t base = (uintptr_t) info->base_address();
531 variable->address = (void *) (base + offset);
533 simgrid::mc::LocationListEntry entry;
534 entry.expression = MC_dwarf_expression(expr, len);
535 variable->location_list = { std::move(entry) };
540 case MC_DW_CLASS_LOCLISTPTR:
541 case MC_DW_CLASS_CONSTANT:
542 // Reference to location list:
543 mc_dwarf_location_list_init_libdw(
544 &variable->location_list, info, die,
548 xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location "
549 "in <%" PRIx64 ">%s",
550 form, form, klass, klass,
551 (std::uint64_t) variable->dwarf_offset,
552 variable->name.c_str());
555 // Handle start_scope:
556 if (dwarf_hasattr(die, DW_AT_start_scope)) {
557 Dwarf_Attribute attr;
558 dwarf_attr(die, DW_AT_start_scope, &attr);
559 int form = dwarf_whatform(&attr);
560 int klass = MC_dwarf_form_get_class(form);
562 case MC_DW_CLASS_CONSTANT:
565 variable->start_scope =
566 dwarf_formudata(&attr, &value) == 0 ? (size_t) value : 0;
569 case MC_DW_CLASS_RANGELISTPTR: // TODO
572 ("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s",
573 form, klass, name == NULL ? "?" : name);
577 if (ns && variable->global)
579 std::string(ns) + "::" + variable->name;
581 // The current code needs a variable name,
582 // generate a fake one:
583 if (variable->name.empty())
585 "@anonymous#" + std::to_string(mc_anonymous_variable_index++);
587 return std::move(variable);
590 static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
591 Dwarf_Die * unit, simgrid::mc::Frame* frame,
594 std::unique_ptr<simgrid::mc::Variable> variable =
595 MC_die_to_variable(info, die, unit, frame, ns);
598 // Those arrays are sorted later:
599 else if (variable->global)
600 info->global_variables.push_back(std::move(*variable));
601 else if (frame != nullptr)
602 frame->variables.push_back(std::move(*variable));
604 xbt_die("No frame for this local variable");
607 static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
608 Dwarf_Die * unit, simgrid::mc::Frame* parent_frame,
611 // TODO, handle DW_TAG_type/DW_TAG_location for DW_TAG_with_stmt
612 int tag = dwarf_tag(die);
613 mc_tag_class klass = MC_dwarf_tag_classify(tag);
615 // (Template) Subprogram declaration:
616 if (klass == mc_tag_subprogram
617 && MC_dwarf_attr_flag(die, DW_AT_declaration, false))
620 if (klass == mc_tag_scope)
621 xbt_assert(parent_frame, "No parent scope for this scope");
623 simgrid::mc::Frame frame;
626 frame.id = dwarf_dieoffset(die);
627 frame.object_info = info;
629 if (klass == mc_tag_subprogram) {
630 const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
632 frame.name = std::string(ns) + "::" + name;
639 frame.abstract_origin_id =
640 MC_dwarf_attr_dieoffset(die, DW_AT_abstract_origin);
642 // This is the base address for DWARF addresses.
643 // Relocated addresses are offset from this base address.
644 // See DWARF4 spec 7.5
645 void *base = info->base_address();
647 // TODO, support DW_AT_ranges
648 std::uint64_t low_pc = MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
649 frame.low_pc = low_pc ? ((char *) base) + low_pc : 0;
652 Dwarf_Attribute attr;
653 if (!dwarf_attr_integrate(die, DW_AT_high_pc, &attr)) {
654 xbt_die("Missing DW_AT_high_pc matching with DW_AT_low_pc");
660 switch (MC_dwarf_form_get_class(dwarf_whatform(&attr))) {
662 // DW_AT_high_pc if an offset from the low_pc:
663 case MC_DW_CLASS_CONSTANT:
665 if (dwarf_formsdata(&attr, &offset) != 0)
666 xbt_die("Could not read constant");
667 frame.high_pc = (void *) ((char *) frame.low_pc + offset);
670 // DW_AT_high_pc is a relocatable address:
671 case MC_DW_CLASS_ADDRESS:
672 if (dwarf_formaddr(&attr, &high_pc) != 0)
673 xbt_die("Could not read address");
674 frame.high_pc = ((char *) base) + high_pc;
678 xbt_die("Unexpected class for DW_AT_high_pc");
683 if (klass == mc_tag_subprogram) {
684 Dwarf_Attribute attr_frame_base;
685 if (dwarf_attr_integrate(die, DW_AT_frame_base, &attr_frame_base))
686 mc_dwarf_location_list_init_libdw(&frame.frame_base, info, die,
691 MC_dwarf_handle_children(info, die, unit, &frame, ns);
693 // Someone needs this to be sorted but who?
694 std::sort(frame.variables.begin(), frame.variables.end(),
695 MC_compare_variable);
698 if (klass == mc_tag_subprogram)
699 info->subprograms[frame.id] = frame;
700 else if (klass == mc_tag_scope)
701 parent_frame->scopes.push_back(std::move(frame));
704 static void mc_dwarf_handle_namespace_die(simgrid::mc::ObjectInformation* info,
705 Dwarf_Die * die, Dwarf_Die * unit,
706 simgrid::mc::Frame* frame,
709 const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
711 xbt_die("Unexpected namespace in a subprogram");
712 char *new_ns = ns == NULL ? xbt_strdup(name)
713 : bprintf("%s::%s", ns, name);
714 MC_dwarf_handle_children(info, die, unit, frame, new_ns);
718 static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
719 Dwarf_Die * unit, simgrid::mc::Frame* frame,
722 // For each child DIE:
725 for (res = dwarf_child(die, &child); res == 0;
726 res = dwarf_siblingof(&child, &child)) {
727 MC_dwarf_handle_die(info, &child, unit, frame, ns);
731 static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
732 Dwarf_Die * unit, simgrid::mc::Frame* frame,
735 int tag = dwarf_tag(die);
736 mc_tag_class klass = MC_dwarf_tag_classify(tag);
741 MC_dwarf_handle_type_die(info, die, unit, frame, ns);
744 // Subprogram or scope:
745 case mc_tag_subprogram:
747 MC_dwarf_handle_scope_die(info, die, unit, frame, ns);
751 case mc_tag_variable:
752 MC_dwarf_handle_variable_die(info, die, unit, frame, ns);
755 case mc_tag_namespace:
756 mc_dwarf_handle_namespace_die(info, die, unit, frame, ns);
765 /** \brief Populate the debugging informations of the given ELF object
767 * Read the DWARf information of the EFFL object and populate the
768 * lists of types, variables, functions.
770 void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info)
772 int fd = open(info->file_name.c_str(), O_RDONLY);
774 xbt_die("Could not open file %s", info->file_name.c_str());
775 Dwarf *dwarf = dwarf_begin(fd, DWARF_C_READ);
777 xbt_die("Missing debugging information in %s\n"
778 "Your program and its dependencies must have debugging information.\n"
779 "You might want to recompile with -g or install the suitable debugging package.\n",
780 info->file_name.c_str());
781 // For each compilation unit:
782 Dwarf_Off offset = 0;
783 Dwarf_Off next_offset = 0;
786 while (dwarf_nextcu(dwarf, offset, &next_offset, &length, NULL, NULL, NULL) ==
789 if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL)
790 MC_dwarf_handle_children(info, &unit_die, &unit_die, NULL, NULL);
791 offset = next_offset;