+/** \brief Create a location_list from a given attribute */
+static dw_location_t MC_dwarf_get_location_list_libdw(Dwarf_Die* die, Dwarf_Attribute* attr) {
+
+
+ dw_location_t location = xbt_new0(s_dw_location_t, 1);
+ location->type = e_dw_loclist;
+ xbt_dynar_t loclist = xbt_dynar_new(sizeof(dw_location_entry_t), NULL);
+ location->location.loclist = loclist;
+
+ ptrdiff_t offset = 0;
+ Dwarf_Addr base, start, end;
+ Dwarf_Op *expr;
+ size_t len;
+
+ while (1) {
+
+ offset = dwarf_getlocations(attr, offset, &base, &start, &end, &expr, &len);
+ if (offset==0)
+ return location;
+ else if (offset==-1)
+ xbt_die("Error while loading location list");
+
+ dw_location_entry_t new_entry = xbt_new0(s_dw_location_entry_t, 1);
+ new_entry->lowpc = start;
+ new_entry->highpc = end;
+ new_entry->location = MC_dwarf_get_expression(expr, len);
+
+ xbt_dynar_push(loclist, &new_entry);
+
+ }
+}
+