Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Please use
GitHub pull requests
for new patches. Avoid migrating existing patches.
Phabricator shutdown timeline
Files
F27260437
a.cpp
wf520gg (Feng Wang)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
wf520gg
Apr 28 2023, 12:05 AM
Size
504 B
Subscribers
None
a.cpp
View Options
// a.c
#include
<unwind.h>
#include
<signal.h>
#include
<stdio.h>
#include
<stdlib.h>
_Unwind_Reason_Code
FrameCounter
(
_Unwind_Context
*
ctx
,
void
*
arg
)
{
int
*
count_ptr
=
reinterpret_cast
<
int
*>
(
arg
);
++*
count_ptr
;
return
_URC_NO_REASON
;
}
int
g_handler_frame_count
=
0
;
static
void
handler
(
int
signo
)
{
_Unwind_Backtrace
(
FrameCounter
,
&
g_handler_frame_count
);
printf
(
"back trace count %d
\n
"
,
g_handler_frame_count
);
}
int
main
()
{
signal
(
SIGUSR1
,
handler
);
raise
(
SIGUSR1
);
return
1
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
19398063
Attached To
D148499: [libunwind] Unwind through Linux riscv sigreturn trampoline
Event Timeline
Log In to Comment