DWARF_GET_CIE_INDEX(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… DWARF_GET_CIE_INDEX πŸ’…

okay so this whole page lives in the Library Functions Manual and it's all about dwarf_get_cie_index from the DWARF Access Library β€” yes bestie, libdwarf, and you link it with -ldwarf. let's get into it ✨


πŸŽ€ NAME πŸŽ€

dwarf_get_cie_index β€” the function that retrieves the index of a CIE descriptor. that's the whole vibe, that's the job 🫢

πŸ“š LIBRARY πŸ“š

DWARF Access Library β€” libdwarf, -ldwarf. she's iconic, she's linked in with -ldwarf, periodt.

✨ SYNOPSIS ✨

#include <libdwarf.h>

int
dwarf_get_cie_index(Dwarf_Cie cie, Dwarf_Signed *cie_index,
    Dwarf_Error *err);

πŸ’– DESCRIPTION πŸ’–

okay so here's what dwarf_get_cie_index() does: it retrieves the zero-based index of a given CIE descriptor, inside the array of CIE descriptors that the functions dwarf_get_fde_list(3) and dwarf_get_fde_list_eh(3) hand back to you. zero-based, so the first one is 0, not 1 β€” don't come for me, that's just how it is πŸ’€

the argument cie should reference a valid DWARF CIE descriptor. like, an actual valid one. that's the vibe check it has to pass.

and the argument cie_index should point to a location that will hold the returned index. that's where the answer lands, bestie 🎯

πŸ”₯ RETURN VALUES πŸ”₯

when it succeeds, dwarf_get_cie_index() returns DW_DLV_OK. slay.

but 😭 if something goes wrong, it returns DW_DLV_ERROR and sets the argument err. so yeah, check your err, always check your err.

πŸ’€ ERRORS πŸ’€

function dwarf_get_cie_index() can fail with:

  • [DW_DLE_ARGUMENT] β€” either of the arguments cie or cie_index was NULL. literally either one. don't pass NULL, it's giving chaos πŸ™ˆ

🌈 SEE ALSO 🌈

dwarf(3), dwarf_get_cie_info(3), dwarf_get_cie_of_fde(3), dwarf_get_fde_list(3), dwarf_get_fde_list_eh(3) β€” go read those next, iykyk πŸ‘‘


and that's the page, bestie πŸ’… this lil masterpiece is from Debian, dated May 22, 2011 β€” yes, she's an elder icon and she still ate. mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from