1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-30 13:11:44 +02:00

Change unw_init_local_signal to unw_init_local2(..., UNW_INIT_SIGNAL_FRAME)

Add unw_init_local2 with a flag for better extensibility in the future
This commit is contained in:
Dave Watson 2017-08-16 12:15:16 -07:00
parent 644cce3d72
commit bd3fb89e11
13 changed files with 119 additions and 29 deletions

View file

@ -12,7 +12,7 @@ man3_MANS = libunwind.man libunwind-dynamic.man libunwind-ia64.man \
unw_get_reg.man \ unw_get_reg.man \
unw_getcontext.man \ unw_getcontext.man \
unw_init_local.man unw_init_remote.man \ unw_init_local.man unw_init_remote.man \
unw_init_local_signal.man \ unw_init_local2.man \
unw_is_fpreg.man \ unw_is_fpreg.man \
unw_is_signal_frame.man \ unw_is_signal_frame.man \
unw_create_addr_space.man \ unw_create_addr_space.man \

View file

@ -1,5 +1,5 @@
'\" t '\" t
.\" Manual page created with latex2man on Thu Mar 30 16:13:10 PDT 2017 .\" Manual page created with latex2man on Wed Aug 16 12:11:05 PDT 2017
.\" NOTE: This file is generated, DO NOT EDIT. .\" NOTE: This file is generated, DO NOT EDIT.
.de Vb .de Vb
.ft CW .ft CW
@ -10,7 +10,7 @@
.fi .fi
.. ..
.TH "UNW\\_INIT\\_LOCAL" "3" "30 March 2017" "Programming Library " "Programming Library " .TH "UNW\\_INIT\\_LOCAL" "3" "16 August 2017" "Programming Library " "Programming Library "
.SH NAME .SH NAME
unw_init_local unw_init_local
\-\- initialize cursor for local unwinding \-\- initialize cursor for local unwinding
@ -26,8 +26,10 @@ unw_init_local(unw_cursor_t *c,
unw_context_t *ctxt); unw_context_t *ctxt);
.br .br
int int
unw_init_local_signal(unw_cursor_t *c, unw_init_local2(unw_cursor_t *c,
unw_context_t *ctxt); unw_context_t *ctxt,
int
flag);
.br .br
.PP .PP
.SH DESCRIPTION .SH DESCRIPTION
@ -66,9 +68,9 @@ is not.
.PP .PP
If the unw_context_t is known to be a signal frame (i.e., from the If the unw_context_t is known to be a signal frame (i.e., from the
third argument in a sigaction handler on linux), third argument in a sigaction handler on linux),
unw_init_local_signal() unw_init_local2()
should be used for correct should be used for correct initialization
initialization on some platforms. on some platforms, passing the UNW_INIT_SIGNAL_FRAME flag.
.PP .PP
.SH RETURN VALUE .SH RETURN VALUE

View file

@ -13,7 +13,7 @@
\File{\#include $<$libunwind.h$>$}\\ \File{\#include $<$libunwind.h$>$}\\
\Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_context\_t~*}\Var{ctxt});\\ \Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_context\_t~*}\Var{ctxt});\\
\Type{int} \Func{unw\_init\_local_signal}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_context\_t~*}\Var{ctxt});\\ \Type{int} \Func{unw\_init\_local2}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_context\_t~*}\Var{ctxt}, \Type{int} \Var{flag});\\
\section{Description} \section{Description}
@ -39,8 +39,8 @@ is not.
If the unw_context_t is known to be a signal frame (i.e., from the If the unw_context_t is known to be a signal frame (i.e., from the
third argument in a sigaction handler on linux), third argument in a sigaction handler on linux),
\Func{unw\_init\_local\_signal}() should be used for correct \Func{unw\_init\_local2}() should be used for correct initialization
initialization on some platforms. on some platforms, passing the UNW_INIT_SIGNAL_FRAME flag.
\section{Return Value} \section{Return Value}

View file

@ -59,9 +59,20 @@ unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, unw_context_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -59,9 +59,20 @@ unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, unw_context_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -58,9 +58,20 @@ unw_init_local (unw_cursor_t *cursor, ucontext_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, ucontext_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -57,9 +57,20 @@ unw_init_local(unw_cursor_t *cursor, ucontext_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal(unw_cursor_t *cursor, ucontext_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -69,9 +69,20 @@ unw_init_local(unw_cursor_t *cursor, ucontext_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal(unw_cursor_t *cursor, ucontext_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -59,9 +59,20 @@ unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, unw_context_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -61,9 +61,20 @@ unw_init_local (unw_cursor_t *cursor, ucontext_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, ucontext_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -60,9 +60,20 @@ unw_init_local (unw_cursor_t *cursor, ucontext_t *uc)
} }
PROTECTED int PROTECTED int
unw_init_local_signal (unw_cursor_t *cursor, ucontext_t *uc) unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag)
{ {
return unw_init_local_common(cursor, uc, 0); if (!flag)
{
return unw_init_local_common(cursor, uc, 1);
}
else if (flag == UNW_INIT_SIGNAL_FRAME)
{
return unw_init_local_common(cursor, uc, 0);
}
else
{
return -UNW_EINVAL;
}
} }
#endif /* !UNW_REMOTE_ONLY */ #endif /* !UNW_REMOTE_ONLY */

View file

@ -99,7 +99,7 @@ check_local_unw_abi () {
match _UL${plat}_get_reg match _UL${plat}_get_reg
match _UL${plat}_get_save_loc match _UL${plat}_get_save_loc
match _UL${plat}_init_local match _UL${plat}_init_local
match _UL${plat}_init_local_signal match _UL${plat}_init_local2
match _UL${plat}_init_remote match _UL${plat}_init_remote
match _UL${plat}_is_signal_frame match _UL${plat}_is_signal_frame
match _UL${plat}_handle_signal_frame match _UL${plat}_handle_signal_frame
@ -205,7 +205,7 @@ check_generic_unw_abi () {
match _U${plat}_get_reg match _U${plat}_get_reg
match _U${plat}_get_save_loc match _U${plat}_get_save_loc
match _U${plat}_init_local match _U${plat}_init_local
match _U${plat}_init_local_signal match _U${plat}_init_local2
match _U${plat}_init_remote match _U${plat}_init_remote
match _U${plat}_is_signal_frame match _U${plat}_is_signal_frame
match _U${plat}_handle_signal_frame match _U${plat}_handle_signal_frame