DWARF_GET_FDE_AT_PC(3)

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

πŸ’– DWARF_GET_FDE_AT_PC(3) πŸ’–

okay bestie, welcome to this Library Functions Manual page πŸ’… we're talking about dwarf_get_fde_at_pc, and it's literally the little matchmaker between a program counter address and an FDE descriptor. no cap.


✨ NAME ✨

dwarf_get_fde_at_pc β€” retrieve the FDE descriptor for an address πŸŽ€

πŸ¦‹ LIBRARY πŸ¦‹

DWARF Access Library (libdwarf, -ldwarf) β€” yes, that's the whole library vibe πŸ’œ

🌸 SYNOPSIS 🌸

#include <libdwarf.h>

int
dwarf_get_fde_at_pc(Dwarf_Fde *fdelist, Dwarf_Addr pc,
    Dwarf_Fde *ret_fde, Dwarf_Addr *lopc, Dwarf_Addr *hipc,
    Dwarf_Error *err);

πŸ’« DESCRIPTION πŸ’«

Function dwarf_get_fde_at_pc() searches the provided array of DWARF FDE descriptors for a descriptor covering a given program counter address. it's giving "find the one that matches," fr fr πŸ”₯

Here's the cast of arguments, bestie:

  • fdelist β€” should point to an array of FDE descriptors, as returned by the functions dwarf_get_fde_list(3) or dwarf_get_fde_list_eh(3).
  • pc β€” should contain the program counter address being looked up.
  • ret_fde β€” should point to a location that will hold the returned FDE descriptor.
  • lopc β€” should point to a location that will be set to the lowest address covered by the returned FDE descriptor.
  • hipc β€” should point to a location that will be set to the highest address covered by the returned FDE descriptor.
  • err β€” if argument err is not NULL, it will be used to store error information in case of an error.
lowkey important: fdelist, ret_fde, lopc, and hipc are main characters here, so don't be handing over NULL unless you want an error moment πŸ™ˆ

πŸ‘‘ RETURN VALUES πŸ‘‘

Function dwarf_get_fde_at_pc() returns DW_DLV_OK when it succeeds. slay βœ…

It returns DW_DLV_NO_ENTRY if a FDE descriptor that covers the address specified by argument pc is not found. not every search finds its match, and that's okay 😭

In case of an error, it returns DW_DLV_ERROR and sets the argument err.

πŸ’€ ERRORS πŸ’€

Function dwarf_get_fde_at_pc() can fail with:

  • [DW_DLE_ARGUMENT] β€” One of the arguments fdelist, ret_fde, lopc, or hipc was NULL.
  • [DW_DLE_NO_ENTRY] β€” There was no FDE descriptor covering the address specified by argument pc.

🌈 SEE ALSO 🌈


okay that's the whole page, bestie β€” source/version: Debian, dated May 22, 2011 🫢 mwah πŸ’‹

πŸ“¦ where this page comes from