Lines Matching full:cu

35 	Dwarf_CU cu;  in _dwarf_info_first_cu()  local
39 cu = STAILQ_FIRST(&dbg->dbg_cu); in _dwarf_info_first_cu()
40 if (cu != NULL) { in _dwarf_info_first_cu()
41 dbg->dbg_cu_current = cu; in _dwarf_info_first_cu()
87 Dwarf_CU cu; in _dwarf_info_next_cu() local
91 cu = STAILQ_NEXT(dbg->dbg_cu_current, cu_next); in _dwarf_info_next_cu()
92 if (cu != NULL) { in _dwarf_info_next_cu()
93 dbg->dbg_cu_current = cu; in _dwarf_info_next_cu()
114 Dwarf_CU cu; in _dwarf_info_next_tu() local
118 cu = STAILQ_NEXT(dbg->dbg_tu_current, cu_next); in _dwarf_info_next_tu()
119 if (cu != NULL) { in _dwarf_info_next_tu()
120 dbg->dbg_tu_current = cu; in _dwarf_info_next_tu()
142 Dwarf_CU cu; in _dwarf_info_load() local
168 if ((cu = calloc(1, sizeof(struct _Dwarf_CU))) == NULL) { in _dwarf_info_load()
173 cu->cu_dbg = dbg; in _dwarf_info_load()
174 cu->cu_is_info = is_info; in _dwarf_info_load()
175 cu->cu_offset = offset; in _dwarf_info_load()
183 cu->cu_dwarf_size = dwarf_size; in _dwarf_info_load()
186 * Check if there is enough ELF data for this CU. This assumes in _dwarf_info_load()
191 free(cu); in _dwarf_info_load()
204 cu->cu_length = length; in _dwarf_info_load()
205 cu->cu_length_size = (dwarf_size == 4 ? 4 : 12); in _dwarf_info_load()
206 cu->cu_version = dbg->read(ds->ds_data, &offset, 2); in _dwarf_info_load()
207 cu->cu_abbrev_offset = dbg->read(ds->ds_data, &offset, in _dwarf_info_load()
209 cu->cu_abbrev_offset_cur = cu->cu_abbrev_offset; in _dwarf_info_load()
210 cu->cu_pointer_size = dbg->read(ds->ds_data, &offset, 1); in _dwarf_info_load()
211 cu->cu_next_offset = next_offset; in _dwarf_info_load()
215 memcpy(cu->cu_type_sig.signature, in _dwarf_info_load()
218 cu->cu_type_offset = dbg->read(ds->ds_data, &offset, in _dwarf_info_load()
224 STAILQ_INSERT_TAIL(&dbg->dbg_cu, cu, cu_next); in _dwarf_info_load()
226 STAILQ_INSERT_TAIL(&dbg->dbg_tu, cu, cu_next); in _dwarf_info_load()
228 if (cu->cu_version < 2 || cu->cu_version > 4) { in _dwarf_info_load()
234 cu->cu_1st_offset = offset; in _dwarf_info_load()
256 Dwarf_CU cu, tcu; in _dwarf_info_cleanup() local
260 STAILQ_FOREACH_SAFE(cu, &dbg->dbg_cu, cu_next, tcu) { in _dwarf_info_cleanup()
261 STAILQ_REMOVE(&dbg->dbg_cu, cu, _Dwarf_CU, cu_next); in _dwarf_info_cleanup()
262 _dwarf_abbrev_cleanup(cu); in _dwarf_info_cleanup()
263 if (cu->cu_lineinfo != NULL) { in _dwarf_info_cleanup()
264 _dwarf_lineno_cleanup(cu->cu_lineinfo); in _dwarf_info_cleanup()
265 cu->cu_lineinfo = NULL; in _dwarf_info_cleanup()
267 free(cu); in _dwarf_info_cleanup()
276 Dwarf_CU cu, tcu; in _dwarf_type_unit_cleanup() local
280 STAILQ_FOREACH_SAFE(cu, &dbg->dbg_tu, cu_next, tcu) { in _dwarf_type_unit_cleanup()
281 STAILQ_REMOVE(&dbg->dbg_tu, cu, _Dwarf_CU, cu_next); in _dwarf_type_unit_cleanup()
282 _dwarf_abbrev_cleanup(cu); in _dwarf_type_unit_cleanup()
283 free(cu); in _dwarf_type_unit_cleanup()
293 Dwarf_CU cu; in _dwarf_info_gen() local
301 /* Create the single CU for this debugging object. */ in _dwarf_info_gen()
302 if ((cu = calloc(1, sizeof(struct _Dwarf_CU))) == NULL) { in _dwarf_info_gen()
306 cu->cu_dbg = dbg; in _dwarf_info_gen()
307 cu->cu_version = 2; /* DWARF2 */ in _dwarf_info_gen()
308 cu->cu_pointer_size = dbg->dbg_pointer_size; in _dwarf_info_gen()
309 STAILQ_INSERT_TAIL(&dbg->dbg_cu, cu, cu_next); in _dwarf_info_gen()
323 RCHECK(WRITE_VALUE(cu->cu_length, 4)); in _dwarf_info_gen()
325 /* Write CU version */ in _dwarf_info_gen()
326 RCHECK(WRITE_VALUE(cu->cu_version, 2)); in _dwarf_info_gen()
329 * Write abbrev offset. (always 0, we only support single CU) in _dwarf_info_gen()
333 ds->ds_size, 0, cu->cu_abbrev_offset, ".debug_abbrev", error)); in _dwarf_info_gen()
336 RCHECK(WRITE_VALUE(cu->cu_pointer_size, 1)); in _dwarf_info_gen()
338 /* Transform the DIE(s) of this CU. */ in _dwarf_info_gen()
339 RCHECK(_dwarf_die_gen(dbg, cu, drs, error)); in _dwarf_info_gen()
341 /* Now we can fill in the length of this CU. */ in _dwarf_info_gen()
342 cu->cu_length = ds->ds_size - 4; in _dwarf_info_gen()
344 dbg->write(ds->ds_data, &offset, cu->cu_length, 4); in _dwarf_info_gen()
364 STAILQ_REMOVE(&dbg->dbg_cu, cu, _Dwarf_CU, cu_next); in _dwarf_info_gen()
365 free(cu); in _dwarf_info_gen()
373 Dwarf_CU cu; in _dwarf_info_pro_cleanup() local
377 cu = STAILQ_FIRST(&dbg->dbg_cu); in _dwarf_info_pro_cleanup()
378 if (cu != NULL) { in _dwarf_info_pro_cleanup()
379 STAILQ_REMOVE(&dbg->dbg_cu, cu, _Dwarf_CU, cu_next); in _dwarf_info_pro_cleanup()
380 _dwarf_abbrev_cleanup(cu); in _dwarf_info_pro_cleanup()
381 free(cu); in _dwarf_info_pro_cleanup()