UNW_GET...N_RANGE(3libunwind)
π UNW_GET...N_RANGE β bestie edition π
okay so this is a page from libunwind, section 3libunwind β the programming library zone. Grab a strawberry π and let's get into it.
β¨ NAME β¨
unw_get_proc_info_in_range β bestie, it gets you procedure info inside an IP range plus a frame index table. That's the whole vibe.
πΈ SYNOPSIS πΈ
#include <libunwind.h>
int unw_get_proc_info_in_range(unw_word_t start_ip, unw_word_t end_ip,
unw_word_t eh_frame_table, unw_word_t eh_frame_table_len, unw_word_t
exidx_frame_table, unw_word_t exidx_frame_table_len,, unw_addr_space_t
*as, void *arg);
ngl, yes, there really are two commas in a row up there in the original signature (exidx_frame_table_len,,). Not a typo I made. I'm just the messenger π
copy it as-is, bestie.
π¦ DESCRIPTION π¦
So unw_get_proc_info_in_range() hands you back the same kind of auxiliary info about a procedure that unw_get_proc_info_by_ip() does. Same flavor, same energy. π«Ά
The difference? It looks the info up in an instruction pointer (IP) range and a frame table, instead of just at a single IP. That's it, that's the twist.
And the way this is equally flexible is that you can look up the info for any arbitrary procedure β even one that is not part of the current call chain. Iconic, honestly. Main character energy for a lookup function.
But β and this is the part where I hold your hand β because it's more flexible, it also tends to run slower than unw_get_proc_info(). And not like a lil slower. often much slower. π So likeβ¦ know what you're signing up for.
π RETURN VALUE π
- On a successful completion,
unw_get_proc_info_in_range()returns0. Slay. - Otherwise it returns the negative value of one of the error codes listed below. Not slay, but informative.
π§ THREAD AND SIGNAL SAFETY π§
unw_get_proc_info_in_range() is thread safe. Periodt. π
And bonus: if the local address space is passed in the argument as, then this routine is also safe to use from a signal handler. Little treat for you. π
π ERRORS π
UNW_EUNSPECβ an unspecified error occurred. Vague, mysterious, unhelpful. πUNW_ENOINFOβ libunwind was unable to locate unwind-info for the procedure. It went looking, it found nothing. π΅οΈUNW_EBADVERSIONβ the unwind-info for the procedure has a version or format that is not understood by libunwind. It's giving "I don't speak that language." πUNW_EINVALβ an unsupported table encoding was specified. Bestie. Check your encoding.
Plus: unw_get_proc_info_by_ip() may return any error returned by the access_mem() callback β go see unw_create_addr_space(3libunwind) for that whole situation.
π SEE ALSO π
libunwind(3libunwind)unw_get_proc_info_in_range(3libunwind)unw_create_addr_space(3libunwind)unw_get_proc_name(3libunwind)unw_get_proc_info(3libunwind)
β AUTHOR β
David Mosberger-Tang Email: dmosberger@gmail.com WWW: http://www.nongnu.org/libunwind/
okay that's the whole page, you ate it, go forth and unwind (or like, don't, but with correct error handling) π
This gem came out of the Programming Library manual set, dated 29 August 2023, filed under UNW_GET...N_RANGE(3libunwind). Bye bestie! π¦β¨
π¦ where this page comes from
- alpine 3.22: libunwind-doc 1.8.1-r0 Β· MIT
- alpine 3.23: libunwind-doc 1.8.1-r0 Β· MIT
- alpine 3.24: libunwind-doc 1.8.3-r0 Β· MIT
- arch rolling: libunwind 1.8.3-1 Β· MIT
- epel 10: libunwind-devel 1.8.0-4.el10_0 Β· MIT
- epel 9: libunwind-devel 1.8.0-4.el9 Β· MIT
- fedora 43: libunwind-devel 1.8.1-3.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.1-3.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.3-4.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.3-4.fc43 Β· MIT
- fedora 44: libunwind-devel 1.8.3-1.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-1.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-4.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-4.fc44 Β· MIT
- nixpkgs unstable: libunwind 1.8.3-devman
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms