Lines Matching defs:cie
38 Dwarf_Cie cie;
40 STAILQ_FOREACH(cie, &fs->fs_cielist, cie_next) {
41 if (cie->cie_offset == offset)
45 if (cie == NULL)
49 *ret_cie = cie;
55 _dwarf_frame_read_lsb_encoded(Dwarf_Debug dbg, Dwarf_Cie cie, uint64_t *val,
69 *val = dbg->read(data, offsetp, cie->cie_addrsize);
129 _dwarf_frame_parse_lsb_cie_augment(Dwarf_Debug dbg, Dwarf_Cie cie,
137 assert(cie->cie_augment != NULL && *cie->cie_augment == 'z');
141 * and associated CIE augment data, which describes the
144 aug_p = &cie->cie_augment[1];
145 augdata_p = cie->cie_augdata;
158 ret = _dwarf_frame_read_lsb_encoded(dbg, cie, &val,
165 cie->cie_fde_encode = *augdata_p++;
182 Dwarf_Cie cie;
187 /* Check if we already added this CIE. */
188 if (_dwarf_frame_find_cie(fs, *off, &cie) != DW_DLE_NO_ENTRY) {
189 *off += cie->cie_length + 4;
193 if ((cie = calloc(1, sizeof(struct _Dwarf_Cie))) == NULL) {
197 STAILQ_INSERT_TAIL(&fs->fs_cielist, cie, cie_next);
199 cie->cie_dbg = dbg;
200 cie->cie_index = fs->fs_cielen;
201 cie->cie_offset = *off;
215 (void) dbg->read(ds->ds_data, off, dwarf_size); /* Skip CIE id. */
216 cie->cie_length = length;
218 cie->cie_version = dbg->read(ds->ds_data, off, 1);
219 if (cie->cie_version != 1 && cie->cie_version != 3 &&
220 cie->cie_version != 4) {
225 cie->cie_augment = ds->ds_data + *off;
231 if (*cie->cie_augment != 0 && *cie->cie_augment != 'z') {
232 *off = cie->cie_offset + ((dwarf_size == 4) ? 4 : 12) +
233 cie->cie_length;
238 if (strstr((char *)cie->cie_augment, "eh") != NULL)
239 cie->cie_ehdata = dbg->read(ds->ds_data, off,
243 if (cie->cie_version == 4) {
244 cie->cie_addrsize = dbg->read(ds->ds_data, off, 1);
245 cie->cie_segmentsize = dbg->read(ds->ds_data, off, 1);
248 * Otherwise (DWARF[23]) we just set CIE addrsize to the
251 cie->cie_addrsize = dbg->dbg_pointer_size;
254 cie->cie_caf = _dwarf_read_uleb128(ds->ds_data, off);
255 cie->cie_daf = _dwarf_read_sleb128(ds->ds_data, off);
258 if (cie->cie_version == 1)
259 cie->cie_ra = dbg->read(ds->ds_data, off, 1);
261 cie->cie_ra = _dwarf_read_uleb128(ds->ds_data, off);
263 /* Optional CIE augmentation data for .eh_frame section. */
264 if (*cie->cie_augment == 'z') {
265 cie->cie_auglen = _dwarf_read_uleb128(ds->ds_data, off);
266 cie->cie_augdata = ds->ds_data + *off;
267 *off += cie->cie_auglen;
273 cie->cie_fde_encode = DW_EH_PE_absptr;
274 ret = _dwarf_frame_parse_lsb_cie_augment(dbg, cie, error);
279 /* CIE Initial instructions. */
280 cie->cie_initinst = ds->ds_data + *off;
282 cie->cie_instlen = cie->cie_offset + 4 + length - *off;
284 cie->cie_instlen = cie->cie_offset + 12 + length - *off;
286 *off += cie->cie_instlen;
289 printf("cie:\n");
291 " cie_instlen=%ju cie->cie_caf=%ju cie->cie_daf=%jd off=%ju\n",
292 cie->cie_version, cie->cie_offset, cie->cie_length,
293 (char *)cie->cie_augment, cie->cie_instlen, cie->cie_caf,
294 cie->cie_daf, *off);
298 *ret_cie = cie;
309 Dwarf_Cie cie;
353 if (_dwarf_frame_find_cie(fs, cieoff, &cie) ==
355 ret = _dwarf_frame_add_cie(dbg, fs, ds, &cieoff, &cie,
360 fde->fde_cie = cie;
366 ret = _dwarf_frame_read_lsb_encoded(dbg, cie, &val,
367 ds->ds_data, off, cie->cie_fde_encode, ds->ds_addr + *off,
376 ret = _dwarf_frame_read_lsb_encoded(dbg, cie, &val,
377 ds->ds_data, off, cie->cie_fde_encode, 0, error);
383 cie->cie_addrsize);
385 cie->cie_addrsize);
389 if (eh_frame && *cie->cie_augment == 'z') {
421 Dwarf_Cie cie, tcie;
424 STAILQ_FOREACH_SAFE(cie, &fs->fs_cielist, cie_next, tcie) {
425 STAILQ_REMOVE(&fs->fs_cielist, cie, _Dwarf_Cie, cie_next);
426 free(cie);
447 Dwarf_Cie cie;
486 /* GNU .eh_frame use CIE id 0. */
494 /* .dwarf_frame use CIE id ~0 */
510 /* Create CIE array. */
519 STAILQ_FOREACH(cie, &fs->fs_cielist, cie_next) {
520 fs->fs_ciearray[i++] = cie;
1198 Dwarf_Cie cie;
1219 /* Run initial instructions in CIE. */
1220 cie = fde->fde_cie;
1221 assert(cie != NULL);
1222 ret = _dwarf_frame_run_inst(dbg, rt, cie->cie_addrsize,
1223 cie->cie_initinst, cie->cie_instlen, cie->cie_caf, cie->cie_daf, 0,
1230 ret = _dwarf_frame_run_inst(dbg, rt, cie->cie_addrsize,
1231 fde->fde_inst, fde->fde_instlen, cie->cie_caf,
1232 cie->cie_daf, fde->fde_initloc, pc_req, &row_pc, error);
1431 _dwarf_frame_gen_cie(Dwarf_P_Debug dbg, Dwarf_P_Section ds, Dwarf_P_Cie cie,
1438 assert(dbg != NULL && ds != NULL && cie != NULL);
1440 cie->cie_offset = offset = ds->ds_size;
1441 cie->cie_length = 0;
1442 cie->cie_version = 1;
1445 RCHECK(WRITE_VALUE(cie->cie_length, 4));
1447 /* .debug_frame use CIE id ~0. */
1451 RCHECK(WRITE_VALUE(cie->cie_version, 1));
1454 if (cie->cie_augment != NULL)
1455 RCHECK(WRITE_BLOCK(cie->cie_augment,
1456 strlen((char *) cie->cie_augment) + 1));
1461 RCHECK(WRITE_ULEB128(cie->cie_caf));
1462 RCHECK(WRITE_SLEB128(cie->cie_daf));
1463 RCHECK(WRITE_VALUE(cie->cie_ra, 1));
1466 if (cie->cie_initinst != NULL)
1467 RCHECK(WRITE_BLOCK(cie->cie_initinst, cie->cie_instlen));
1470 len = ds->ds_size - cie->cie_offset - 4;
1471 cie->cie_length = roundup(len, dbg->dbg_pointer_size);
1472 while (len++ < cie->cie_length)
1476 dbg->write(ds->ds_data, &offset, cie->cie_length, 4);
1502 /* Write CIE pointer. */
1546 Dwarf_P_Cie cie;
1561 /* Generate list of CIE. */
1562 STAILQ_FOREACH(cie, &dbg->dbgp_cielist, cie_next)
1563 RCHECK(_dwarf_frame_gen_cie(dbg, ds, cie, error));
1589 Dwarf_P_Cie cie, tcie;
1594 STAILQ_FOREACH_SAFE(cie, &dbg->dbgp_cielist, cie_next, tcie) {
1595 STAILQ_REMOVE(&dbg->dbgp_cielist, cie, _Dwarf_Cie, cie_next);
1596 if (cie->cie_augment)
1597 free(cie->cie_augment);
1598 if (cie->cie_initinst)
1599 free(cie->cie_initinst);
1600 free(cie);