UNW_INIT_REMOTE(3libunwind)
π« UNW_INIT_REMOTE π«
okay bestie, welcome to UNW_INIT_REMOTE from the Programming Library (that's 3libunwind for the catalogue girlies) β the function that gets your unwind cursor set up for remote unwinding. yes queen, remote. we're reaching out π
β¨ NAME β¨
unw_init_remote β initialize cursor for remote unwinding π¦
πΈ SYNOPSIS πΈ
#include <libunwind.h>
int unw_init_remote(unw_cursor_t *c, unw_addr_space_t as, void *arg);
π DESCRIPTION π
so the unw_init_remote() routine initializes the unwind cursor that c points to, for unwinding inside the address space identified by as. and as? she can either be unw_local_addr_space (the local address space, hi bestie π«Ά) or literally any arbitrary address space you made with unw_create_addr_space().
now the arg opaque pointer β this is the part where you tell the address space exactly which entity should be unwound. like, if you passed unw_local_addr_space as as, then arg needs to be a pointer to a context structure holding the machine-state of the initial stack frame. but other address spaces might instead expect a process ID, a thread ID, or a pointer to some arbitrary structure that identifies the stack frame chain to be unwound. in other words: the interpretation of arg is entirely dependent on the address space in use β libunwind never interprets the argument in any way on its own. she minds her own business, periodt.
not me pointing out that unw_init_remote() can be used to initiate unwinding in any process, including the local process in which the unwinder itself is running π
but for local unwinding, it's generally preferable to use unw_init_local() instead β because it's easier to use and because it may perform better. lowkey just take the easier route, bestie.
β RETURN VALUE β
on successful completion, unw_init_remote() returns 0. otherwise the negative value of one of the error-codes below is returned. slay when it works, π when it doesn't.
π§ THREAD AND SIGNAL SAFETY π§
unw_init_remote() is thread safe. and if the local address space is passed in argument as as, this routine is also safe to use from a signal handler. iconic behaviour honestly π
π ERRORS π
UNW_EINVALβunw_init_remote()was called in a version oflibunwindwhich supports local unwinding only (this normally happens when definingUNW_LOCAL_ONLYbefore including<libunwind.h>and then callingunw_init_remote()). yeah... that combo is not the vibe πUNW_EUNSPECβ an unspecified error occurred. mysterious. no explanation. we move.UNW_EBADREGβ a register needed byunw_init_remote()wasn't accessible. she needed that register and it ghosted her π
π₯ SEE ALSO π₯
π AUTHOR π
David Mosberger-Tang Email: dmosberger@gmail.com WWW: http://www.nongnu.org/libunwind/
and that's the whole page, bestie!! this was the Programming Library edition, dated 29 August 2023, filed under UNW_INIT_REMOTE(3libunwind) β go forth and unwind remotely, you absolute main character πβ¨π
π¦ 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