Skip to content

Commit

Permalink
doc: Add manpage for unw_set_iterate_phdr_function
Browse files Browse the repository at this point in the history
  • Loading branch information
bertwesarg authored and bregma committed May 8, 2023
1 parent 8a0e2fa commit 3a19368
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ man3_MANS = libunwind.man libunwind-dynamic.man libunwind-ia64.man \
unw_regname.man unw_resume.man \
unw_reg_states_iterate.man \
unw_set_caching_policy.man \
unw_set_iterate_phdr_function.man \
unw_set_cache_size.man \
unw_set_fpreg.man \
unw_set_reg.man \
Expand Down Expand Up @@ -50,6 +51,7 @@ EXTRA_DIST = NOTES libunwind.trans \
unw_is_signal_frame.tex \
unw_create_addr_space.tex unw_destroy_addr_space.tex \
unw_regname.tex unw_resume.tex unw_set_caching_policy.tex \
unw_set_iterate_phdr_function.tex \
unw_reg_states_iterate.tex \
unw_set_cache_size.tex \
unw_set_fpreg.tex \
Expand Down
83 changes: 83 additions & 0 deletions doc/unw_set_iterate_phdr_function.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.\" *********************************** start of \input{common.tex}
.\" *********************************** end of \input{common.tex}
'\" t
.\" Manual page created with latex2man on Sun May 7 19:41:20 2023
.\" NOTE: This file is generated, DO NOT EDIT.
.de Vb
.ft CW
.nf
..
.de Ve
.ft R

.fi
..
.TH "UNW\\_SET\\_ITERATE\\_PHDR\\_FUNCTION" "3" "07 May 2023" "Programming Library " "Programming Library "
.SH NAME
unw_set_iterate_phdr_function
\-\- set dl_iterate_phdr
implementation
.PP
.SH SYNOPSIS

.PP
#include <libunwind.h>
.br
.PP
typedef int
(*unw_iterate_phdr_callback_t)(struct dl_phdr_info *,
size_t,
void *);
.br
typedef int
(*unw_iterate_phdr_func_t)(unw_iterate_phdr_callback_t,
void *);
.br
.PP
void
unw_set_iterate_phdr_function(unw_addr_space_t
as,
unw_iterate_phdr_func_t
function);
.br
.PP
.SH DESCRIPTION

.PP
The unw_set_iterate_phdr_function()
routine sets the dl_iterate_phdr\-implementation
of address space as
to the function by argument function\&.
The function
will be called whenever libunwind
needs to iterate over the program headers of the application.
This is normally done by calling dl_iterate_phdr,
but this function is not signal safe.
With the help of a custom implementation caching and iterating over the program headers is also possible in an signal\-safe manner.
Though the burden lies on the user of libunwind\&.
.PP
.SH THREAD AND SIGNAL SAFETY

.PP
unw_set_iterate_phdr_function()
is thread\-safe. If the local address\-space
is passed in argument as,
this routine is also safe to use from
a signal handler.
.PP
.SH SEE ALSO

.PP
libunwind(3),
unw_create_addr_space(3),
dl_iterate_phdr(3),
.PP
.SH AUTHOR

.PP
Bert Wesarg
.br
Email: \fBbert.wesarg@googlemail.com\fP
.br
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
.\" NOTE: This file is generated, DO NOT EDIT.
50 changes: 50 additions & 0 deletions doc/unw_set_iterate_phdr_function.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
\documentclass{article}
\usepackage[fancyhdr,pdf]{latex2man}

\input{common.tex}

\begin{document}

\begin{Name}{3}{unw\_set\_iterate\_phdr\_function}{Bert Wesarg}{Programming Library}{unw\_set\_iterate\_phdr\_function}unw\_set\_iterate\_phdr\_function -- set \Func{dl\_iterate\_phdr} implementation
\end{Name}

\section{Synopsis}


\File{\#include $<$libunwind.h$>$}\\

\Type{typedef~int} \Func{(*unw_iterate_phdr_callback_t)}(\Type{struct~dl_phdr_info~*}, \Type{size_t}, \Type{void~*});\\
\Type{typedef~int} \Func{(*unw_iterate_phdr_func_t)}(\Type{unw_iterate_phdr_callback_t}, \Type{void~*});\\

\Type{void} \Func{unw\_set\_iterate\_phdr\_function}(\Type{unw\_addr\_space\_t} \Var{as}, \Type{unw_iterate_phdr_func_t} \Var{function});\\

\section{Description}

The \Func{unw\_set\_iterate\_phdr\_function}() routine sets the \Func{dl\_iterate\_phdr}-implementation of address space \Var{as} to the function by argument \Var{function}.
The \Var{function} will be called whenever \Prog{libunwind} needs to iterate over the program headers of the application.
This is normally done by calling \Func{dl\_iterate\_phdr}, but this function is not signal safe.
With the help of a custom implementation caching and iterating over the program headers is also possible in an signal-safe manner.
Though the burden lies on the user of \Prog{libunwind}.

\section{Thread and Signal Safety}

\Func{unw\_set\_iterate\_phdr\_function}() is thread-safe. If the local address-space
is passed in argument \Var{as}, this routine is also safe to use from
a signal handler.


\section{See Also}

\SeeAlso{libunwind(3)},
\SeeAlso{unw\_create\_addr\_space(3)},
\SeeAlso{dl\_iterate\_phdr(3)},

\section{Author}

\noindent
Bert Wesarg\\
Email: \Email{bert.wesarg@googlemail.com}\\
WWW: \URL{http://www.nongnu.org/libunwind/}.
\LatexManEnd

\end{document}

0 comments on commit 3a19368

Please sign in to comment.